@learncard/ceramic-plugin 1.0.54 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ __p += '`),Pt&&(De+=`' +
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+De+`return __p
20
- }`;var Mt=m3(function(){return zt(K,Ke+"return "+De).apply(r,re)});if(Mt.source=De,Nm(Mt))throw Mt;return Mt}o(xI,"template");function wI(a){return Vt(a).toLowerCase()}o(wI,"toLower");function _I(a){return Vt(a).toUpperCase()}o(_I,"toUpper");function EI(a,c,p){if(a=Vt(a),a&&(p||c===r))return A2(a);if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=Pi(c),K=S2(T,U),re=M2(T,U)+1;return Ps(T,K,re).join("")}o(EI,"trim");function AI(a,c,p){if(a=Vt(a),a&&(p||c===r))return a.slice(0,C2(a)+1);if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=M2(T,Pi(c))+1;return Ps(T,0,U).join("")}o(AI,"trimEnd");function SI(a,c,p){if(a=Vt(a),a&&(p||c===r))return a.replace(Qe,"");if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=S2(T,Pi(c));return Ps(T,U).join("")}o(SI,"trimStart");function MI(a,c){var p=H,T=he;if(ur(c)){var U="separator"in c?c.separator:U;p="length"in c?St(c.length):p,T="omission"in c?Fn(c.omission):T}a=Vt(a);var K=a.length;if(qf(a)){var re=Pi(a);K=re.length}if(p>=K)return a;var ce=p-jf(T);if(ce<1)return T;var be=re?Ps(re,0,ce).join(""):a.slice(0,ce);if(U===r)return be+T;if(re&&(ce+=be.length-ce),Pm(U)){if(a.slice(ce).search(U)){var Te,Ce=be;for(U.global||(U=Zp(U.source,Vt(nt.exec(U))+"g")),U.lastIndex=0;Te=U.exec(Ce);)var De=Te.index;be=be.slice(0,De===r?ce:De)}}else if(a.indexOf(Fn(U),ce)!=ce){var Le=be.lastIndexOf(U);Le>-1&&(be=be.slice(0,Le))}return be+T}o(MI,"truncate");function TI(a){return a=Vt(a),a&&st.test(a)?a.replace(Ze,rS):a}o(TI,"unescape");var CI=Wf(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Um=by("toUpperCase");function p3(a,c,p){return a=Vt(a),c=p?r:c,c===r?Z7(a)?oS(a):j7(a):a.match(c)||[]}o(p3,"words");var m3=kt(function(a,c){try{return Ln(a,r,c)}catch(p){return Nm(p)?p:new xt(p)}}),kI=Jo(function(a,c){return li(c,function(p){p=po(p),Go(a,p,Rm(a[p],a))}),a});function II(a){var c=a==null?0:a.length,p=Xe();return a=c?cr(a,function(T){if(typeof T[1]!="function")throw new hi(i);return[p(T[0]),T[1]]}):[],kt(function(T){for(var U=-1;++U<c;){var K=a[U];if(Ln(K[0],this,T))return Ln(K[1],this,T)}})}o(II,"cond");function DI(a){return rM(pi(a,y))}o(DI,"conforms");function Fm(a){return function(){return a}}o(Fm,"constant");function RI(a,c){return a==null||a!==a?c:a}o(RI,"defaultTo");var OI=vy(),NI=vy(!0);function En(a){return a}o(En,"identity");function $m(a){return W2(typeof a=="function"?a:pi(a,y))}o($m,"iteratee");function PI(a){return Y2(pi(a,y))}o(PI,"matches");function BI(a,c){return Z2(a,pi(c,y))}o(BI,"matchesProperty");var LI=kt(function(a,c){return function(p){return Eu(p,a,c)}}),UI=kt(function(a,c){return function(p){return Eu(a,p,c)}});function qm(a,c,p){var T=kr(c),U=Mh(c,T);p==null&&!(ur(c)&&(U.length||!T.length))&&(p=c,c=a,a=this,U=Mh(c,kr(c)));var K=!(ur(p)&&"chain"in p)||!!p.chain,re=Zo(a);return li(U,function(ce){var be=c[ce];a[ce]=be,re&&(a.prototype[ce]=function(){var Te=this.__chain__;if(K||Te){var Ce=a(this.__wrapped__),De=Ce.__actions__=xn(this.__actions__);return De.push({func:be,args:arguments,thisArg:a}),Ce.__chain__=Te,Ce}return be.apply(a,Cs([this.value()],arguments))})}),a}o(qm,"mixin");function FI(){return Cr._===this&&(Cr._=lS),this}o(FI,"noConflict");function jm(){}o(jm,"noop");function $I(a){return a=St(a),kt(function(c){return X2(c,a)})}o($I,"nthArg");var qI=ym(cr),jI=ym(y2),HI=ym(zp);function b3(a){return Mm(a)?Kp(po(a)):yM(a)}o(b3,"property");function zI(a){return function(c){return a==null?r:Ra(a,c)}}o(zI,"propertyOf");var KI=xy(),VI=xy(!0);function Hm(){return[]}o(Hm,"stubArray");function zm(){return!1}o(zm,"stubFalse");function GI(){return{}}o(GI,"stubObject");function WI(){return""}o(WI,"stubString");function JI(){return!0}o(JI,"stubTrue");function YI(a,c){if(a=St(a),a<1||a>E)return[];var p=x,T=Jr(a,x);c=Xe(c),a-=x;for(var U=Wp(T,c);++p<a;)c(p);return U}o(YI,"times");function ZI(a){return wt(a)?cr(a,po):$n(a)?[a]:xn(By(Vt(a)))}o(ZI,"toPath");function XI(a){var c=++cS;return Vt(a)+c}o(XI,"uniqueId");var QI=Rh(function(a,c){return a+c},0),eD=xm("ceil"),tD=Rh(function(a,c){return a/c},1),rD=xm("floor");function nD(a){return a&&a.length?Sh(a,En,om):r}o(nD,"max");function iD(a,c){return a&&a.length?Sh(a,Xe(c,2),om):r}o(iD,"maxBy");function oD(a){return _2(a,En)}o(oD,"mean");function sD(a,c){return _2(a,Xe(c,2))}o(sD,"meanBy");function aD(a){return a&&a.length?Sh(a,En,cm):r}o(aD,"min");function fD(a,c){return a&&a.length?Sh(a,Xe(c,2),cm):r}o(fD,"minBy");var cD=Rh(function(a,c){return a*c},1),uD=xm("round"),lD=Rh(function(a,c){return a-c},0);function hD(a){return a&&a.length?Gp(a,En):0}o(hD,"sum");function dD(a,c){return a&&a.length?Gp(a,Xe(c,2)):0}return o(dD,"sumBy"),$.after=PC,$.ary=Gy,$.assign=_k,$.assignIn=a3,$.assignInWith=Kh,$.assignWith=Ek,$.at=Ak,$.before=Wy,$.bind=Rm,$.bindAll=kI,$.bindKey=Jy,$.castArray=GC,$.chain=zy,$.chunk=rT,$.compact=nT,$.concat=iT,$.cond=II,$.conforms=DI,$.constant=Fm,$.countBy=hC,$.create=Sk,$.curry=Yy,$.curryRight=Zy,$.debounce=Xy,$.defaults=Mk,$.defaultsDeep=Tk,$.defer=BC,$.delay=LC,$.difference=oT,$.differenceBy=sT,$.differenceWith=aT,$.drop=fT,$.dropRight=cT,$.dropRightWhile=uT,$.dropWhile=lT,$.fill=hT,$.filter=pC,$.flatMap=gC,$.flatMapDeep=vC,$.flatMapDepth=yC,$.flatten=$y,$.flattenDeep=dT,$.flattenDepth=pT,$.flip=UC,$.flow=OI,$.flowRight=NI,$.fromPairs=mT,$.functions=Nk,$.functionsIn=Pk,$.groupBy=xC,$.initial=gT,$.intersection=vT,$.intersectionBy=yT,$.intersectionWith=xT,$.invert=Lk,$.invertBy=Uk,$.invokeMap=_C,$.iteratee=$m,$.keyBy=EC,$.keys=kr,$.keysIn=_n,$.map=Fh,$.mapKeys=$k,$.mapValues=qk,$.matches=PI,$.matchesProperty=BI,$.memoize=qh,$.merge=jk,$.mergeWith=f3,$.method=LI,$.methodOf=UI,$.mixin=qm,$.negate=jh,$.nthArg=$I,$.omit=Hk,$.omitBy=zk,$.once=FC,$.orderBy=AC,$.over=qI,$.overArgs=$C,$.overEvery=jI,$.overSome=HI,$.partial=Om,$.partialRight=Qy,$.partition=SC,$.pick=Kk,$.pickBy=c3,$.property=b3,$.propertyOf=zI,$.pull=AT,$.pullAll=jy,$.pullAllBy=ST,$.pullAllWith=MT,$.pullAt=TT,$.range=KI,$.rangeRight=VI,$.rearg=qC,$.reject=CC,$.remove=CT,$.rest=jC,$.reverse=Im,$.sampleSize=IC,$.set=Gk,$.setWith=Wk,$.shuffle=DC,$.slice=kT,$.sortBy=NC,$.sortedUniq=BT,$.sortedUniqBy=LT,$.split=gI,$.spread=HC,$.tail=UT,$.take=FT,$.takeRight=$T,$.takeRightWhile=qT,$.takeWhile=jT,$.tap=nC,$.throttle=zC,$.thru=Uh,$.toArray=i3,$.toPairs=u3,$.toPairsIn=l3,$.toPath=ZI,$.toPlainObject=s3,$.transform=Jk,$.unary=KC,$.union=HT,$.unionBy=zT,$.unionWith=KT,$.uniq=VT,$.uniqBy=GT,$.uniqWith=WT,$.unset=Yk,$.unzip=Dm,$.unzipWith=Hy,$.update=Zk,$.updateWith=Xk,$.values=Zf,$.valuesIn=Qk,$.without=JT,$.words=p3,$.wrap=VC,$.xor=YT,$.xorBy=ZT,$.xorWith=XT,$.zip=QT,$.zipObject=eC,$.zipObjectDeep=tC,$.zipWith=rC,$.entries=u3,$.entriesIn=l3,$.extend=a3,$.extendWith=Kh,qm($,$),$.add=QI,$.attempt=m3,$.camelCase=nI,$.capitalize=h3,$.ceil=eD,$.clamp=eI,$.clone=WC,$.cloneDeep=YC,$.cloneDeepWith=ZC,$.cloneWith=JC,$.conformsTo=XC,$.deburr=d3,$.defaultTo=RI,$.divide=tD,$.endsWith=iI,$.eq=Li,$.escape=oI,$.escapeRegExp=sI,$.every=dC,$.find=mC,$.findIndex=Uy,$.findKey=Ck,$.findLast=bC,$.findLastIndex=Fy,$.findLastKey=kk,$.floor=rD,$.forEach=Ky,$.forEachRight=Vy,$.forIn=Ik,$.forInRight=Dk,$.forOwn=Rk,$.forOwnRight=Ok,$.get=Bm,$.gt=QC,$.gte=ek,$.has=Bk,$.hasIn=Lm,$.head=qy,$.identity=En,$.includes=wC,$.indexOf=bT,$.inRange=tI,$.invoke=Fk,$.isArguments=Pa,$.isArray=wt,$.isArrayBuffer=tk,$.isArrayLike=wn,$.isArrayLikeObject=vr,$.isBoolean=rk,$.isBuffer=Bs,$.isDate=nk,$.isElement=ik,$.isEmpty=ok,$.isEqual=sk,$.isEqualWith=ak,$.isError=Nm,$.isFinite=fk,$.isFunction=Zo,$.isInteger=e3,$.isLength=Hh,$.isMap=t3,$.isMatch=ck,$.isMatchWith=uk,$.isNaN=lk,$.isNative=hk,$.isNil=pk,$.isNull=dk,$.isNumber=r3,$.isObject=ur,$.isObjectLike=lr,$.isPlainObject=ku,$.isRegExp=Pm,$.isSafeInteger=mk,$.isSet=n3,$.isString=zh,$.isSymbol=$n,$.isTypedArray=Yf,$.isUndefined=bk,$.isWeakMap=gk,$.isWeakSet=vk,$.join=wT,$.kebabCase=aI,$.last=bi,$.lastIndexOf=_T,$.lowerCase=fI,$.lowerFirst=cI,$.lt=yk,$.lte=xk,$.max=nD,$.maxBy=iD,$.mean=oD,$.meanBy=sD,$.min=aD,$.minBy=fD,$.stubArray=Hm,$.stubFalse=zm,$.stubObject=GI,$.stubString=WI,$.stubTrue=JI,$.multiply=cD,$.nth=ET,$.noConflict=FI,$.noop=jm,$.now=$h,$.pad=uI,$.padEnd=lI,$.padStart=hI,$.parseInt=dI,$.random=rI,$.reduce=MC,$.reduceRight=TC,$.repeat=pI,$.replace=mI,$.result=Vk,$.round=uD,$.runInContext=de,$.sample=kC,$.size=RC,$.snakeCase=bI,$.some=OC,$.sortedIndex=IT,$.sortedIndexBy=DT,$.sortedIndexOf=RT,$.sortedLastIndex=OT,$.sortedLastIndexBy=NT,$.sortedLastIndexOf=PT,$.startCase=vI,$.startsWith=yI,$.subtract=lD,$.sum=hD,$.sumBy=dD,$.template=xI,$.times=YI,$.toFinite=Xo,$.toInteger=St,$.toLength=o3,$.toLower=wI,$.toNumber=gi,$.toSafeInteger=wk,$.toString=Vt,$.toUpper=_I,$.trim=EI,$.trimEnd=AI,$.trimStart=SI,$.truncate=MI,$.unescape=TI,$.uniqueId=XI,$.upperCase=CI,$.upperFirst=Um,$.each=Ky,$.eachRight=Vy,$.first=qy,qm($,function(){var a={};return lo($,function(c,p){Jt.call($.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),$.VERSION=e,li(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),li(["drop","take"],function(a,c){Nt.prototype[a]=function(p){p=p===r?1:Ar(St(p),0);var T=this.__filtered__&&!c?new Nt(this):this.clone();return T.__filtered__?T.__takeCount__=Jr(p,T.__takeCount__):T.__views__.push({size:Jr(p,x),type:a+(T.__dir__<0?"Right":"")}),T},Nt.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),li(["filter","map","takeWhile"],function(a,c){var p=c+1,T=p==v||p==l;Nt.prototype[a]=function(U){var K=this.clone();return K.__iteratees__.push({iteratee:Xe(U,3),type:p}),K.__filtered__=K.__filtered__||T,K}}),li(["head","last"],function(a,c){var p="take"+(c?"Right":"");Nt.prototype[a]=function(){return this[p](1).value()[0]}}),li(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");Nt.prototype[a]=function(){return this.__filtered__?new Nt(this):this[p](1)}}),Nt.prototype.compact=function(){return this.filter(En)},Nt.prototype.find=function(a){return this.filter(a).head()},Nt.prototype.findLast=function(a){return this.reverse().find(a)},Nt.prototype.invokeMap=kt(function(a,c){return typeof a=="function"?new Nt(this):this.map(function(p){return Eu(p,a,c)})}),Nt.prototype.reject=function(a){return this.filter(jh(Xe(a)))},Nt.prototype.slice=function(a,c){a=St(a);var p=this;return p.__filtered__&&(a>0||c<0)?new Nt(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==r&&(c=St(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Nt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Nt.prototype.toArray=function(){return this.take(x)},lo(Nt.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),T=/^(?:head|last)$/.test(c),U=$[T?"take"+(c=="last"?"Right":""):c],K=T||/^find/.test(c);!U||($.prototype[c]=function(){var re=this.__wrapped__,ce=T?[1]:arguments,be=re instanceof Nt,Te=ce[0],Ce=be||wt(re),De=o(function(Dt){var Pt=U.apply($,Cs([Dt],ce));return T&&Le?Pt[0]:Pt},"interceptor");Ce&&p&&typeof Te=="function"&&Te.length!=1&&(be=Ce=!1);var Le=this.__chain__,Ke=!!this.__actions__.length,et=K&&!Le,Mt=be&&!Ke;if(!K&&Ce){re=Mt?re:new Nt(this);var tt=a.apply(re,ce);return tt.__actions__.push({func:Uh,args:[De],thisArg:r}),new di(tt,Le)}return et&&Mt?a.apply(this,ce):(tt=this.thru(De),et?T?tt.value()[0]:tt.value():tt)})}),li(["pop","push","shift","sort","splice","unshift"],function(a){var c=uh[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",T=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var U=arguments;if(T&&!this.__chain__){var K=this.value();return c.apply(wt(K)?K:[],U)}return this[p](function(re){return c.apply(wt(re)?re:[],U)})}}),lo(Nt.prototype,function(a,c){var p=$[c];if(p){var T=p.name+"";Jt.call(Kf,T)||(Kf[T]=[]),Kf[T].push({name:c,func:p})}}),Kf[Dh(r,B).name]=[{name:"wrapper",func:r}],Nt.prototype.clone=TS,Nt.prototype.reverse=CS,Nt.prototype.value=kS,$.prototype.at=iC,$.prototype.chain=oC,$.prototype.commit=sC,$.prototype.next=aC,$.prototype.plant=cC,$.prototype.reverse=uC,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=lC,$.prototype.first=$.prototype.head,bu&&($.prototype[bu]=fC),$},"runInContext"),Is=sS();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Cr._=Is,define(function(){return Is})):Ta?((Ta.exports=Is)._=Is,$p._=Is):Cr._=Is}).call(Xf)});function Ba(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var Ou=Gt(()=>{o(Ba,"asUint8Array")});function Nu(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ba(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var Wh=Gt(()=>{Ou();o(Nu,"allocUnsafe")});var _3={};Zt(_3,{concat:()=>Fi});function Fi(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=Nu(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ba(t)}var Km=Gt(()=>{Wh();Ou();o(Fi,"concat")});function OD(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),f=s.charCodeAt(0);if(t[f]!==255)throw new TypeError(s+" is ambiguous");t[f]=i}var u=r.length,d=r.charAt(0),y=Math.log(u)/Math.log(256),w=Math.log(256)/Math.log(u);function A(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var B=0,Y=0,P=0,J=I.length;P!==J&&I[P]===0;)P++,B++;for(var ee=(J-P)*w+1>>>0,Z=new Uint8Array(ee);P!==J;){for(var ne=I[P],V=0,j=ee-1;(ne!==0||V<Y)&&j!==-1;j--,V++)ne+=256*Z[j]>>>0,Z[j]=ne%u>>>0,ne=ne/u>>>0;if(ne!==0)throw new Error("Non-zero carry");Y=V,P++}for(var H=ee-Y;H!==ee&&Z[H]===0;)H++;for(var he=d.repeat(B);H<ee;++H)he+=r.charAt(Z[H]);return he}o(A,"encode");function O(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var B=0;if(I[B]!==" "){for(var Y=0,P=0;I[B]===d;)Y++,B++;for(var J=(I.length-B)*y+1>>>0,ee=new Uint8Array(J);I[B];){var Z=t[I.charCodeAt(B)];if(Z===255)return;for(var ne=0,V=J-1;(Z!==0||ne<P)&&V!==-1;V--,ne++)Z+=u*ee[V]>>>0,ee[V]=Z%256>>>0,Z=Z/256>>>0;if(Z!==0)throw new Error("Non-zero carry");P=ne,B++}if(I[B]!==" "){for(var j=J-P;j!==J&&ee[j]===0;)j++;for(var H=new Uint8Array(Y+(J-j)),he=Y;j!==J;)H[he++]=ee[j++];return H}}}o(O,"decodeUnsafe");function R(I){var B=O(I);if(B)return B;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:A,decodeUnsafe:O,decode:R}}var ND,PD,E3,A3=Gt(()=>{o(OD,"base");ND=OD,PD=ND,E3=PD});var KK,S3,es,M3,T3,Ls=Gt(()=>{KK=new Uint8Array(0),S3=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"),es=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"),M3=o(r=>new TextEncoder().encode(r),"fromString"),T3=o(r=>new TextDecoder().decode(r),"toString")});var Jh,Yh,Zh,C3,Xh,Qf,Us,BD,LD,hr,$i=Gt(()=>{A3();Ls();Jh=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(Jh,"Encoder");Yh=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 C3(this,e)}};o(Yh,"Decoder");Zh=class{constructor(e){this.decoders=e}or(e){return C3(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(Zh,"ComposedDecoder");C3=o((r,e)=>new Zh({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),"or"),Xh=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Jh(e,t,n),this.decoder=new Yh(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Xh,"Codec");Qf=o(({name:r,prefix:e,encode:t,decode:n})=>new Xh(r,e,t,n),"from"),Us=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=E3(t,e);return Qf({prefix:r,name:e,encode:n,decode:s=>es(i(s))})},"baseX"),BD=o((r,e,t,n)=>{let i={};for(let w=0;w<e.length;++w)i[e[w]]=w;let s=r.length;for(;r[s-1]==="=";)--s;let f=new Uint8Array(s*t/8|0),u=0,d=0,y=0;for(let w=0;w<s;++w){let A=i[r[w]];if(A===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|A,u+=t,u>=8&&(u-=8,f[y++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return f},"decode"),LD=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),hr=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Qf({prefix:e,name:r,encode(i){return LD(i,n,t)},decode(i){return BD(i,n,t,r)}}),"rfc4648")});var Gm={};Zt(Gm,{identity:()=>UD});var UD,k3=Gt(()=>{$i();Ls();UD=Qf({prefix:"\0",name:"identity",encode:r=>T3(r),decode:r=>M3(r)})});var Wm={};Zt(Wm,{base2:()=>FD});var FD,I3=Gt(()=>{$i();FD=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Jm={};Zt(Jm,{base8:()=>$D});var $D,D3=Gt(()=>{$i();$D=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Ym={};Zt(Ym,{base10:()=>qD});var qD,R3=Gt(()=>{$i();qD=Us({prefix:"9",name:"base10",alphabet:"0123456789"})});var Zm={};Zt(Zm,{base16:()=>jD,base16upper:()=>HD});var jD,HD,O3=Gt(()=>{$i();jD=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),HD=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Xm={};Zt(Xm,{base32:()=>ec,base32hex:()=>GD,base32hexpad:()=>JD,base32hexpadupper:()=>YD,base32hexupper:()=>WD,base32pad:()=>KD,base32padupper:()=>VD,base32upper:()=>zD,base32z:()=>ZD});var ec,zD,KD,VD,GD,WD,JD,YD,ZD,Qm=Gt(()=>{$i();ec=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zD=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),KD=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),VD=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),GD=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),WD=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),JD=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),YD=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ZD=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var e1={};Zt(e1,{base36:()=>qi,base36upper:()=>XD});var qi,XD,tc=Gt(()=>{$i();qi=Us({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),XD=Us({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var t1={};Zt(t1,{base58btc:()=>vi,base58flickr:()=>QD});var vi,QD,Qh=Gt(()=>{$i();vi=Us({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),QD=Us({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var r1={};Zt(r1,{base64:()=>eR,base64pad:()=>tR,base64url:()=>La,base64urlpad:()=>rR});var eR,tR,La,rR,ed=Gt(()=>{$i();eR=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tR=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),La=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rR=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var n1={};Zt(n1,{base256emoji:()=>aR});function oR(r){return r.reduce((e,t)=>(e+=nR[t],e),"")}function sR(r){let e=[];for(let t of r){let n=iR[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var N3,nR,iR,aR,P3=Gt(()=>{$i();N3=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}"),nR=N3.reduce((r,e,t)=>(r[t]=e,r),[]),iR=N3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(oR,"encode");o(sR,"decode");aR=Qf({prefix:"\u{1F680}",name:"base256emoji",encode:oR,decode:sR})});function U3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=lR;)e[t++]=r&255|B3,r/=128;for(;r&uR;)e[t++]=r&255|B3,r>>>=7;return e[t]=r|0,U3.bytes=t-n+1,e}function i1(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw i1.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&L3)<<i:(f&L3)*Math.pow(2,i),i+=7}while(f>=dR);return i1.bytes=s-n,t}var fR,B3,cR,uR,lR,hR,dR,L3,pR,mR,bR,gR,vR,yR,xR,wR,_R,ER,AR,SR,Pu,F3=Gt(()=>{fR=U3,B3=128,cR=127,uR=~cR,lR=Math.pow(2,31);o(U3,"encode");hR=i1,dR=128,L3=127;o(i1,"read");pR=Math.pow(2,7),mR=Math.pow(2,14),bR=Math.pow(2,21),gR=Math.pow(2,28),vR=Math.pow(2,35),yR=Math.pow(2,42),xR=Math.pow(2,49),wR=Math.pow(2,56),_R=Math.pow(2,63),ER=o(function(r){return r<pR?1:r<mR?2:r<bR?3:r<gR?4:r<vR?5:r<yR?6:r<xR?7:r<wR?8:r<_R?9:10},"length"),AR={encode:fR,decode:hR,encodingLength:ER},SR=AR,Pu=SR});var Bu,rc,nc,rd=Gt(()=>{F3();Bu=o((r,e=0)=>[Pu.decode(r,e),Pu.decode.bytes],"decode"),rc=o((r,e,t=0)=>(Pu.encode(r,e,t),e),"encodeTo"),nc=o(r=>Pu.encodingLength(r),"encodingLength")});var ts,nd,$3,Ua,Fa=Gt(()=>{Ls();rd();ts=o((r,e)=>{let t=e.byteLength,n=nc(r),i=n+nc(t),s=new Uint8Array(i+t);return rc(r,s,0),rc(t,s,n),s.set(e,i),new Ua(r,t,e,s)},"create"),nd=o(r=>{let e=es(r),[t,n]=Bu(e),[i,s]=Bu(e.subarray(n)),f=e.subarray(n+s);if(f.byteLength!==i)throw new Error("Incorrect length");return new Ua(t,i,f,e)},"decode"),$3=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&S3(r.bytes,e.bytes),"equals"),Ua=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Ua,"Digest")});var o1,id,s1=Gt(()=>{Fa();o1=o(({name:r,code:e,encode:t})=>new id(r,e,t),"from"),id=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?ts(this.code,t):t.then(n=>ts(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(id,"Hasher")});var a1={};Zt(a1,{sha256:()=>Fs,sha512:()=>MR});var j3,Fs,MR,Uu=Gt(()=>{s1();j3=o(r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),"sha"),Fs=o1({name:"sha2-256",code:18,encode:j3("SHA-256")}),MR=o1({name:"sha2-512",code:19,encode:j3("SHA-512")})});var f1={};Zt(f1,{identity:()=>od});var H3,TR,z3,CR,od,c1=Gt(()=>{Ls();Fa();H3=0,TR="identity",z3=es,CR=o(r=>ts(H3,z3(r)),"digest"),od={code:H3,name:TR,encode:z3,digest:CR}});var K3=Gt(()=>{Ls()});var hV,dV,V3=Gt(()=>{hV=new TextEncoder,dV=new TextDecoder});var Ye,DR,RR,OR,Fu,NR,G3,W3,sd,ad,PR,BR,LR,ji=Gt(()=>{rd();Fa();Qh();Qm();Ls();Ye=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:ad,byteLength:ad,code:sd,version:sd,multihash:sd,bytes:sd,_baseCache:ad,asCID:ad})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Fu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==NR)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ye.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=ts(e,t);return Ye.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&&$3(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return RR(t,i,e||vi.encoder);default:return OR(t,i,e||ec.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 BR(/^0\.0/,LR),!!(e&&(e[W3]||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 Ye)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Ye(t,n,i,s||G3(t,n,i.bytes))}else if(e!=null&&e[W3]===!0){let{version:t,multihash:n,code:i}=e,s=nd(n);return Ye.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!==Fu)throw new Error(`Version 0 CID must use dag-pb (code: ${Fu}) block encoding`);return new Ye(e,t,n,n.bytes)}case 1:{let i=G3(e,t,n.bytes);return new Ye(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Ye.create(0,Fu,e)}static createV1(e,t){return Ye.create(1,e,t)}static decode(e){let[t,n]=Ye.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Ye.inspectBytes(e),n=t.size-t.multihashSize,i=es(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),f=new Ua(t.multihashCode,t.digestSize,s,i);return[t.version===0?Ye.createV0(f):Ye.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[A,O]=Bu(e.subarray(t));return t+=O,A},"next"),i=n(),s=Fu;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let f=t,u=n(),d=n(),y=t+d,w=y-f;return{version:i,codec:s,multihashCode:u,digestSize:d,multihashSize:w,size:y}}static parse(e,t){let[n,i]=DR(e,t),s=Ye.decode(i);return s._baseCache.set(n,e),s}};o(Ye,"CID");DR=o((r,e)=>{switch(r[0]){case"Q":{let t=e||vi;return[vi.prefix,t.decode(`${vi.prefix}${r}`)]}case vi.prefix:{let t=e||vi;return[vi.prefix,t.decode(r)]}case ec.prefix:{let t=e||ec;return[ec.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"),RR=o((r,e,t)=>{let{prefix:n}=t;if(n!==vi.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"),OR=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"),Fu=112,NR=18,G3=o((r,e,t)=>{let n=nc(r),i=n+nc(e),s=new Uint8Array(i+t.byteLength);return rc(r,s,0),rc(e,s,n),s.set(t,i),s},"encodeCID"),W3=Symbol.for("@ipld/js-cid/CID"),sd={writable:!1,configurable:!1,enumerable:!0},ad={writable:!1,enumerable:!1,configurable:!1},PR="0.0.0-dev",BR=o((r,e)=>{if(r.test(PR))console.warn(e);else throw new Error(e)},"deprecate"),LR=`CID.isCID(v) is deprecated and will be removed in the next major release.
20
+ }`;var Mt=m3(function(){return zt(K,Ke+"return "+De).apply(r,re)});if(Mt.source=De,Nm(Mt))throw Mt;return Mt}o(xI,"template");function wI(a){return Vt(a).toLowerCase()}o(wI,"toLower");function _I(a){return Vt(a).toUpperCase()}o(_I,"toUpper");function EI(a,c,p){if(a=Vt(a),a&&(p||c===r))return A2(a);if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=Pi(c),K=S2(T,U),re=M2(T,U)+1;return Ps(T,K,re).join("")}o(EI,"trim");function AI(a,c,p){if(a=Vt(a),a&&(p||c===r))return a.slice(0,C2(a)+1);if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=M2(T,Pi(c))+1;return Ps(T,0,U).join("")}o(AI,"trimEnd");function SI(a,c,p){if(a=Vt(a),a&&(p||c===r))return a.replace(Qe,"");if(!a||!(c=Fn(c)))return a;var T=Pi(a),U=S2(T,Pi(c));return Ps(T,U).join("")}o(SI,"trimStart");function MI(a,c){var p=H,T=he;if(ur(c)){var U="separator"in c?c.separator:U;p="length"in c?St(c.length):p,T="omission"in c?Fn(c.omission):T}a=Vt(a);var K=a.length;if(qf(a)){var re=Pi(a);K=re.length}if(p>=K)return a;var ce=p-jf(T);if(ce<1)return T;var be=re?Ps(re,0,ce).join(""):a.slice(0,ce);if(U===r)return be+T;if(re&&(ce+=be.length-ce),Pm(U)){if(a.slice(ce).search(U)){var Te,Ce=be;for(U.global||(U=Zp(U.source,Vt(nt.exec(U))+"g")),U.lastIndex=0;Te=U.exec(Ce);)var De=Te.index;be=be.slice(0,De===r?ce:De)}}else if(a.indexOf(Fn(U),ce)!=ce){var Le=be.lastIndexOf(U);Le>-1&&(be=be.slice(0,Le))}return be+T}o(MI,"truncate");function TI(a){return a=Vt(a),a&&st.test(a)?a.replace(Ze,rS):a}o(TI,"unescape");var CI=Wf(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Um=by("toUpperCase");function p3(a,c,p){return a=Vt(a),c=p?r:c,c===r?Z7(a)?oS(a):j7(a):a.match(c)||[]}o(p3,"words");var m3=kt(function(a,c){try{return Ln(a,r,c)}catch(p){return Nm(p)?p:new xt(p)}}),kI=Jo(function(a,c){return li(c,function(p){p=po(p),Go(a,p,Rm(a[p],a))}),a});function II(a){var c=a==null?0:a.length,p=Xe();return a=c?cr(a,function(T){if(typeof T[1]!="function")throw new hi(i);return[p(T[0]),T[1]]}):[],kt(function(T){for(var U=-1;++U<c;){var K=a[U];if(Ln(K[0],this,T))return Ln(K[1],this,T)}})}o(II,"cond");function DI(a){return rM(pi(a,y))}o(DI,"conforms");function Fm(a){return function(){return a}}o(Fm,"constant");function RI(a,c){return a==null||a!==a?c:a}o(RI,"defaultTo");var OI=vy(),NI=vy(!0);function En(a){return a}o(En,"identity");function $m(a){return W2(typeof a=="function"?a:pi(a,y))}o($m,"iteratee");function PI(a){return Y2(pi(a,y))}o(PI,"matches");function BI(a,c){return Z2(a,pi(c,y))}o(BI,"matchesProperty");var LI=kt(function(a,c){return function(p){return Eu(p,a,c)}}),UI=kt(function(a,c){return function(p){return Eu(a,p,c)}});function qm(a,c,p){var T=kr(c),U=Mh(c,T);p==null&&!(ur(c)&&(U.length||!T.length))&&(p=c,c=a,a=this,U=Mh(c,kr(c)));var K=!(ur(p)&&"chain"in p)||!!p.chain,re=Zo(a);return li(U,function(ce){var be=c[ce];a[ce]=be,re&&(a.prototype[ce]=function(){var Te=this.__chain__;if(K||Te){var Ce=a(this.__wrapped__),De=Ce.__actions__=xn(this.__actions__);return De.push({func:be,args:arguments,thisArg:a}),Ce.__chain__=Te,Ce}return be.apply(a,Cs([this.value()],arguments))})}),a}o(qm,"mixin");function FI(){return Cr._===this&&(Cr._=lS),this}o(FI,"noConflict");function jm(){}o(jm,"noop");function $I(a){return a=St(a),kt(function(c){return X2(c,a)})}o($I,"nthArg");var qI=ym(cr),jI=ym(y2),HI=ym(zp);function b3(a){return Mm(a)?Kp(po(a)):yM(a)}o(b3,"property");function zI(a){return function(c){return a==null?r:Ra(a,c)}}o(zI,"propertyOf");var KI=xy(),VI=xy(!0);function Hm(){return[]}o(Hm,"stubArray");function zm(){return!1}o(zm,"stubFalse");function GI(){return{}}o(GI,"stubObject");function WI(){return""}o(WI,"stubString");function JI(){return!0}o(JI,"stubTrue");function YI(a,c){if(a=St(a),a<1||a>E)return[];var p=x,T=Jr(a,x);c=Xe(c),a-=x;for(var U=Wp(T,c);++p<a;)c(p);return U}o(YI,"times");function ZI(a){return wt(a)?cr(a,po):$n(a)?[a]:xn(By(Vt(a)))}o(ZI,"toPath");function XI(a){var c=++cS;return Vt(a)+c}o(XI,"uniqueId");var QI=Rh(function(a,c){return a+c},0),eD=xm("ceil"),tD=Rh(function(a,c){return a/c},1),rD=xm("floor");function nD(a){return a&&a.length?Sh(a,En,om):r}o(nD,"max");function iD(a,c){return a&&a.length?Sh(a,Xe(c,2),om):r}o(iD,"maxBy");function oD(a){return _2(a,En)}o(oD,"mean");function sD(a,c){return _2(a,Xe(c,2))}o(sD,"meanBy");function aD(a){return a&&a.length?Sh(a,En,cm):r}o(aD,"min");function fD(a,c){return a&&a.length?Sh(a,Xe(c,2),cm):r}o(fD,"minBy");var cD=Rh(function(a,c){return a*c},1),uD=xm("round"),lD=Rh(function(a,c){return a-c},0);function hD(a){return a&&a.length?Gp(a,En):0}o(hD,"sum");function dD(a,c){return a&&a.length?Gp(a,Xe(c,2)):0}return o(dD,"sumBy"),$.after=PC,$.ary=Gy,$.assign=_k,$.assignIn=a3,$.assignInWith=Kh,$.assignWith=Ek,$.at=Ak,$.before=Wy,$.bind=Rm,$.bindAll=kI,$.bindKey=Jy,$.castArray=GC,$.chain=zy,$.chunk=rT,$.compact=nT,$.concat=iT,$.cond=II,$.conforms=DI,$.constant=Fm,$.countBy=hC,$.create=Sk,$.curry=Yy,$.curryRight=Zy,$.debounce=Xy,$.defaults=Mk,$.defaultsDeep=Tk,$.defer=BC,$.delay=LC,$.difference=oT,$.differenceBy=sT,$.differenceWith=aT,$.drop=fT,$.dropRight=cT,$.dropRightWhile=uT,$.dropWhile=lT,$.fill=hT,$.filter=pC,$.flatMap=gC,$.flatMapDeep=vC,$.flatMapDepth=yC,$.flatten=$y,$.flattenDeep=dT,$.flattenDepth=pT,$.flip=UC,$.flow=OI,$.flowRight=NI,$.fromPairs=mT,$.functions=Nk,$.functionsIn=Pk,$.groupBy=xC,$.initial=gT,$.intersection=vT,$.intersectionBy=yT,$.intersectionWith=xT,$.invert=Lk,$.invertBy=Uk,$.invokeMap=_C,$.iteratee=$m,$.keyBy=EC,$.keys=kr,$.keysIn=_n,$.map=Fh,$.mapKeys=$k,$.mapValues=qk,$.matches=PI,$.matchesProperty=BI,$.memoize=qh,$.merge=jk,$.mergeWith=f3,$.method=LI,$.methodOf=UI,$.mixin=qm,$.negate=jh,$.nthArg=$I,$.omit=Hk,$.omitBy=zk,$.once=FC,$.orderBy=AC,$.over=qI,$.overArgs=$C,$.overEvery=jI,$.overSome=HI,$.partial=Om,$.partialRight=Qy,$.partition=SC,$.pick=Kk,$.pickBy=c3,$.property=b3,$.propertyOf=zI,$.pull=AT,$.pullAll=jy,$.pullAllBy=ST,$.pullAllWith=MT,$.pullAt=TT,$.range=KI,$.rangeRight=VI,$.rearg=qC,$.reject=CC,$.remove=CT,$.rest=jC,$.reverse=Im,$.sampleSize=IC,$.set=Gk,$.setWith=Wk,$.shuffle=DC,$.slice=kT,$.sortBy=NC,$.sortedUniq=BT,$.sortedUniqBy=LT,$.split=gI,$.spread=HC,$.tail=UT,$.take=FT,$.takeRight=$T,$.takeRightWhile=qT,$.takeWhile=jT,$.tap=nC,$.throttle=zC,$.thru=Uh,$.toArray=i3,$.toPairs=u3,$.toPairsIn=l3,$.toPath=ZI,$.toPlainObject=s3,$.transform=Jk,$.unary=KC,$.union=HT,$.unionBy=zT,$.unionWith=KT,$.uniq=VT,$.uniqBy=GT,$.uniqWith=WT,$.unset=Yk,$.unzip=Dm,$.unzipWith=Hy,$.update=Zk,$.updateWith=Xk,$.values=Zf,$.valuesIn=Qk,$.without=JT,$.words=p3,$.wrap=VC,$.xor=YT,$.xorBy=ZT,$.xorWith=XT,$.zip=QT,$.zipObject=eC,$.zipObjectDeep=tC,$.zipWith=rC,$.entries=u3,$.entriesIn=l3,$.extend=a3,$.extendWith=Kh,qm($,$),$.add=QI,$.attempt=m3,$.camelCase=nI,$.capitalize=h3,$.ceil=eD,$.clamp=eI,$.clone=WC,$.cloneDeep=YC,$.cloneDeepWith=ZC,$.cloneWith=JC,$.conformsTo=XC,$.deburr=d3,$.defaultTo=RI,$.divide=tD,$.endsWith=iI,$.eq=Li,$.escape=oI,$.escapeRegExp=sI,$.every=dC,$.find=mC,$.findIndex=Uy,$.findKey=Ck,$.findLast=bC,$.findLastIndex=Fy,$.findLastKey=kk,$.floor=rD,$.forEach=Ky,$.forEachRight=Vy,$.forIn=Ik,$.forInRight=Dk,$.forOwn=Rk,$.forOwnRight=Ok,$.get=Bm,$.gt=QC,$.gte=ek,$.has=Bk,$.hasIn=Lm,$.head=qy,$.identity=En,$.includes=wC,$.indexOf=bT,$.inRange=tI,$.invoke=Fk,$.isArguments=Pa,$.isArray=wt,$.isArrayBuffer=tk,$.isArrayLike=wn,$.isArrayLikeObject=vr,$.isBoolean=rk,$.isBuffer=Bs,$.isDate=nk,$.isElement=ik,$.isEmpty=ok,$.isEqual=sk,$.isEqualWith=ak,$.isError=Nm,$.isFinite=fk,$.isFunction=Zo,$.isInteger=e3,$.isLength=Hh,$.isMap=t3,$.isMatch=ck,$.isMatchWith=uk,$.isNaN=lk,$.isNative=hk,$.isNil=pk,$.isNull=dk,$.isNumber=r3,$.isObject=ur,$.isObjectLike=lr,$.isPlainObject=ku,$.isRegExp=Pm,$.isSafeInteger=mk,$.isSet=n3,$.isString=zh,$.isSymbol=$n,$.isTypedArray=Yf,$.isUndefined=bk,$.isWeakMap=gk,$.isWeakSet=vk,$.join=wT,$.kebabCase=aI,$.last=bi,$.lastIndexOf=_T,$.lowerCase=fI,$.lowerFirst=cI,$.lt=yk,$.lte=xk,$.max=nD,$.maxBy=iD,$.mean=oD,$.meanBy=sD,$.min=aD,$.minBy=fD,$.stubArray=Hm,$.stubFalse=zm,$.stubObject=GI,$.stubString=WI,$.stubTrue=JI,$.multiply=cD,$.nth=ET,$.noConflict=FI,$.noop=jm,$.now=$h,$.pad=uI,$.padEnd=lI,$.padStart=hI,$.parseInt=dI,$.random=rI,$.reduce=MC,$.reduceRight=TC,$.repeat=pI,$.replace=mI,$.result=Vk,$.round=uD,$.runInContext=de,$.sample=kC,$.size=RC,$.snakeCase=bI,$.some=OC,$.sortedIndex=IT,$.sortedIndexBy=DT,$.sortedIndexOf=RT,$.sortedLastIndex=OT,$.sortedLastIndexBy=NT,$.sortedLastIndexOf=PT,$.startCase=vI,$.startsWith=yI,$.subtract=lD,$.sum=hD,$.sumBy=dD,$.template=xI,$.times=YI,$.toFinite=Xo,$.toInteger=St,$.toLength=o3,$.toLower=wI,$.toNumber=gi,$.toSafeInteger=wk,$.toString=Vt,$.toUpper=_I,$.trim=EI,$.trimEnd=AI,$.trimStart=SI,$.truncate=MI,$.unescape=TI,$.uniqueId=XI,$.upperCase=CI,$.upperFirst=Um,$.each=Ky,$.eachRight=Vy,$.first=qy,qm($,function(){var a={};return lo($,function(c,p){Jt.call($.prototype,p)||(a[p]=c)}),a}(),{chain:!1}),$.VERSION=e,li(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),li(["drop","take"],function(a,c){Nt.prototype[a]=function(p){p=p===r?1:Ar(St(p),0);var T=this.__filtered__&&!c?new Nt(this):this.clone();return T.__filtered__?T.__takeCount__=Jr(p,T.__takeCount__):T.__views__.push({size:Jr(p,x),type:a+(T.__dir__<0?"Right":"")}),T},Nt.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),li(["filter","map","takeWhile"],function(a,c){var p=c+1,T=p==v||p==l;Nt.prototype[a]=function(U){var K=this.clone();return K.__iteratees__.push({iteratee:Xe(U,3),type:p}),K.__filtered__=K.__filtered__||T,K}}),li(["head","last"],function(a,c){var p="take"+(c?"Right":"");Nt.prototype[a]=function(){return this[p](1).value()[0]}}),li(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");Nt.prototype[a]=function(){return this.__filtered__?new Nt(this):this[p](1)}}),Nt.prototype.compact=function(){return this.filter(En)},Nt.prototype.find=function(a){return this.filter(a).head()},Nt.prototype.findLast=function(a){return this.reverse().find(a)},Nt.prototype.invokeMap=kt(function(a,c){return typeof a=="function"?new Nt(this):this.map(function(p){return Eu(p,a,c)})}),Nt.prototype.reject=function(a){return this.filter(jh(Xe(a)))},Nt.prototype.slice=function(a,c){a=St(a);var p=this;return p.__filtered__&&(a>0||c<0)?new Nt(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==r&&(c=St(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Nt.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Nt.prototype.toArray=function(){return this.take(x)},lo(Nt.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),T=/^(?:head|last)$/.test(c),U=$[T?"take"+(c=="last"?"Right":""):c],K=T||/^find/.test(c);!U||($.prototype[c]=function(){var re=this.__wrapped__,ce=T?[1]:arguments,be=re instanceof Nt,Te=ce[0],Ce=be||wt(re),De=o(function(Dt){var Pt=U.apply($,Cs([Dt],ce));return T&&Le?Pt[0]:Pt},"interceptor");Ce&&p&&typeof Te=="function"&&Te.length!=1&&(be=Ce=!1);var Le=this.__chain__,Ke=!!this.__actions__.length,et=K&&!Le,Mt=be&&!Ke;if(!K&&Ce){re=Mt?re:new Nt(this);var tt=a.apply(re,ce);return tt.__actions__.push({func:Uh,args:[De],thisArg:r}),new di(tt,Le)}return et&&Mt?a.apply(this,ce):(tt=this.thru(De),et?T?tt.value()[0]:tt.value():tt)})}),li(["pop","push","shift","sort","splice","unshift"],function(a){var c=uh[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",T=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var U=arguments;if(T&&!this.__chain__){var K=this.value();return c.apply(wt(K)?K:[],U)}return this[p](function(re){return c.apply(wt(re)?re:[],U)})}}),lo(Nt.prototype,function(a,c){var p=$[c];if(p){var T=p.name+"";Jt.call(Kf,T)||(Kf[T]=[]),Kf[T].push({name:c,func:p})}}),Kf[Dh(r,B).name]=[{name:"wrapper",func:r}],Nt.prototype.clone=TS,Nt.prototype.reverse=CS,Nt.prototype.value=kS,$.prototype.at=iC,$.prototype.chain=oC,$.prototype.commit=sC,$.prototype.next=aC,$.prototype.plant=cC,$.prototype.reverse=uC,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=lC,$.prototype.first=$.prototype.head,bu&&($.prototype[bu]=fC),$},"runInContext"),Is=sS();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Cr._=Is,define(function(){return Is})):Ta?((Ta.exports=Is)._=Is,$p._=Is):Cr._=Is}).call(Xf)});function Ba(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}var Ou=Gt(()=>{o(Ba,"asUint8Array")});function Nu(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ba(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var Wh=Gt(()=>{Ou();o(Nu,"allocUnsafe")});var _3={};Zt(_3,{concat:()=>Fi});function Fi(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=Nu(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ba(t)}var Km=Gt(()=>{Wh();Ou();o(Fi,"concat")});function OD(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),f=s.charCodeAt(0);if(t[f]!==255)throw new TypeError(s+" is ambiguous");t[f]=i}var u=r.length,d=r.charAt(0),y=Math.log(u)/Math.log(256),w=Math.log(256)/Math.log(u);function A(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var B=0,Y=0,P=0,J=I.length;P!==J&&I[P]===0;)P++,B++;for(var ee=(J-P)*w+1>>>0,Z=new Uint8Array(ee);P!==J;){for(var ne=I[P],V=0,j=ee-1;(ne!==0||V<Y)&&j!==-1;j--,V++)ne+=256*Z[j]>>>0,Z[j]=ne%u>>>0,ne=ne/u>>>0;if(ne!==0)throw new Error("Non-zero carry");Y=V,P++}for(var H=ee-Y;H!==ee&&Z[H]===0;)H++;for(var he=d.repeat(B);H<ee;++H)he+=r.charAt(Z[H]);return he}o(A,"encode");function O(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var B=0;if(I[B]!==" "){for(var Y=0,P=0;I[B]===d;)Y++,B++;for(var J=(I.length-B)*y+1>>>0,ee=new Uint8Array(J);I[B];){var Z=t[I.charCodeAt(B)];if(Z===255)return;for(var ne=0,V=J-1;(Z!==0||ne<P)&&V!==-1;V--,ne++)Z+=u*ee[V]>>>0,ee[V]=Z%256>>>0,Z=Z/256>>>0;if(Z!==0)throw new Error("Non-zero carry");P=ne,B++}if(I[B]!==" "){for(var j=J-P;j!==J&&ee[j]===0;)j++;for(var H=new Uint8Array(Y+(J-j)),he=Y;j!==J;)H[he++]=ee[j++];return H}}}o(O,"decodeUnsafe");function R(I){var B=O(I);if(B)return B;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:A,decodeUnsafe:O,decode:R}}var ND,PD,E3,A3=Gt(()=>{o(OD,"base");ND=OD,PD=ND,E3=PD});var zK,S3,es,M3,T3,Ls=Gt(()=>{zK=new Uint8Array(0),S3=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"),es=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"),M3=o(r=>new TextEncoder().encode(r),"fromString"),T3=o(r=>new TextDecoder().decode(r),"toString")});var Jh,Yh,Zh,C3,Xh,Qf,Us,BD,LD,hr,$i=Gt(()=>{A3();Ls();Jh=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(Jh,"Encoder");Yh=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 C3(this,e)}};o(Yh,"Decoder");Zh=class{constructor(e){this.decoders=e}or(e){return C3(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(Zh,"ComposedDecoder");C3=o((r,e)=>new Zh({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),"or"),Xh=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Jh(e,t,n),this.decoder=new Yh(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Xh,"Codec");Qf=o(({name:r,prefix:e,encode:t,decode:n})=>new Xh(r,e,t,n),"from"),Us=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=E3(t,e);return Qf({prefix:r,name:e,encode:n,decode:s=>es(i(s))})},"baseX"),BD=o((r,e,t,n)=>{let i={};for(let w=0;w<e.length;++w)i[e[w]]=w;let s=r.length;for(;r[s-1]==="=";)--s;let f=new Uint8Array(s*t/8|0),u=0,d=0,y=0;for(let w=0;w<s;++w){let A=i[r[w]];if(A===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<t|A,u+=t,u>=8&&(u-=8,f[y++]=255&d>>u)}if(u>=t||255&d<<8-u)throw new SyntaxError("Unexpected end of data");return f},"decode"),LD=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),hr=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Qf({prefix:e,name:r,encode(i){return LD(i,n,t)},decode(i){return BD(i,n,t,r)}}),"rfc4648")});var Gm={};Zt(Gm,{identity:()=>UD});var UD,k3=Gt(()=>{$i();Ls();UD=Qf({prefix:"\0",name:"identity",encode:r=>T3(r),decode:r=>M3(r)})});var Wm={};Zt(Wm,{base2:()=>FD});var FD,I3=Gt(()=>{$i();FD=hr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Jm={};Zt(Jm,{base8:()=>$D});var $D,D3=Gt(()=>{$i();$D=hr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Ym={};Zt(Ym,{base10:()=>qD});var qD,R3=Gt(()=>{$i();qD=Us({prefix:"9",name:"base10",alphabet:"0123456789"})});var Zm={};Zt(Zm,{base16:()=>jD,base16upper:()=>HD});var jD,HD,O3=Gt(()=>{$i();jD=hr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),HD=hr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Xm={};Zt(Xm,{base32:()=>ec,base32hex:()=>GD,base32hexpad:()=>JD,base32hexpadupper:()=>YD,base32hexupper:()=>WD,base32pad:()=>KD,base32padupper:()=>VD,base32upper:()=>zD,base32z:()=>ZD});var ec,zD,KD,VD,GD,WD,JD,YD,ZD,Qm=Gt(()=>{$i();ec=hr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zD=hr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),KD=hr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),VD=hr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),GD=hr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),WD=hr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),JD=hr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),YD=hr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ZD=hr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var e1={};Zt(e1,{base36:()=>qi,base36upper:()=>XD});var qi,XD,tc=Gt(()=>{$i();qi=Us({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),XD=Us({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var t1={};Zt(t1,{base58btc:()=>vi,base58flickr:()=>QD});var vi,QD,Qh=Gt(()=>{$i();vi=Us({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),QD=Us({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var r1={};Zt(r1,{base64:()=>eR,base64pad:()=>tR,base64url:()=>La,base64urlpad:()=>rR});var eR,tR,La,rR,ed=Gt(()=>{$i();eR=hr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tR=hr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),La=hr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rR=hr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var n1={};Zt(n1,{base256emoji:()=>aR});function oR(r){return r.reduce((e,t)=>(e+=nR[t],e),"")}function sR(r){let e=[];for(let t of r){let n=iR[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var N3,nR,iR,aR,P3=Gt(()=>{$i();N3=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}"),nR=N3.reduce((r,e,t)=>(r[t]=e,r),[]),iR=N3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(oR,"encode");o(sR,"decode");aR=Qf({prefix:"\u{1F680}",name:"base256emoji",encode:oR,decode:sR})});function U3(r,e,t){e=e||[],t=t||0;for(var n=t;r>=lR;)e[t++]=r&255|B3,r/=128;for(;r&uR;)e[t++]=r&255|B3,r>>>=7;return e[t]=r|0,U3.bytes=t-n+1,e}function i1(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw i1.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&L3)<<i:(f&L3)*Math.pow(2,i),i+=7}while(f>=dR);return i1.bytes=s-n,t}var fR,B3,cR,uR,lR,hR,dR,L3,pR,mR,bR,gR,vR,yR,xR,wR,_R,ER,AR,SR,Pu,F3=Gt(()=>{fR=U3,B3=128,cR=127,uR=~cR,lR=Math.pow(2,31);o(U3,"encode");hR=i1,dR=128,L3=127;o(i1,"read");pR=Math.pow(2,7),mR=Math.pow(2,14),bR=Math.pow(2,21),gR=Math.pow(2,28),vR=Math.pow(2,35),yR=Math.pow(2,42),xR=Math.pow(2,49),wR=Math.pow(2,56),_R=Math.pow(2,63),ER=o(function(r){return r<pR?1:r<mR?2:r<bR?3:r<gR?4:r<vR?5:r<yR?6:r<xR?7:r<wR?8:r<_R?9:10},"length"),AR={encode:fR,decode:hR,encodingLength:ER},SR=AR,Pu=SR});var Bu,rc,nc,rd=Gt(()=>{F3();Bu=o((r,e=0)=>[Pu.decode(r,e),Pu.decode.bytes],"decode"),rc=o((r,e,t=0)=>(Pu.encode(r,e,t),e),"encodeTo"),nc=o(r=>Pu.encodingLength(r),"encodingLength")});var ts,nd,$3,Ua,Fa=Gt(()=>{Ls();rd();ts=o((r,e)=>{let t=e.byteLength,n=nc(r),i=n+nc(t),s=new Uint8Array(i+t);return rc(r,s,0),rc(t,s,n),s.set(e,i),new Ua(r,t,e,s)},"create"),nd=o(r=>{let e=es(r),[t,n]=Bu(e),[i,s]=Bu(e.subarray(n)),f=e.subarray(n+s);if(f.byteLength!==i)throw new Error("Incorrect length");return new Ua(t,i,f,e)},"decode"),$3=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&S3(r.bytes,e.bytes),"equals"),Ua=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Ua,"Digest")});var o1,id,s1=Gt(()=>{Fa();o1=o(({name:r,code:e,encode:t})=>new id(r,e,t),"from"),id=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?ts(this.code,t):t.then(n=>ts(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(id,"Hasher")});var a1={};Zt(a1,{sha256:()=>Fs,sha512:()=>MR});var j3,Fs,MR,Uu=Gt(()=>{s1();j3=o(r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),"sha"),Fs=o1({name:"sha2-256",code:18,encode:j3("SHA-256")}),MR=o1({name:"sha2-512",code:19,encode:j3("SHA-512")})});var f1={};Zt(f1,{identity:()=>od});var H3,TR,z3,CR,od,c1=Gt(()=>{Ls();Fa();H3=0,TR="identity",z3=es,CR=o(r=>ts(H3,z3(r)),"digest"),od={code:H3,name:TR,encode:z3,digest:CR}});var K3=Gt(()=>{Ls()});var lV,hV,V3=Gt(()=>{lV=new TextEncoder,hV=new TextDecoder});var Ye,DR,RR,OR,Fu,NR,G3,W3,sd,ad,PR,BR,LR,ji=Gt(()=>{rd();Fa();Qh();Qm();Ls();Ye=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:ad,byteLength:ad,code:sd,version:sd,multihash:sd,bytes:sd,_baseCache:ad,asCID:ad})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Fu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==NR)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ye.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=ts(e,t);return Ye.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&&$3(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return RR(t,i,e||vi.encoder);default:return OR(t,i,e||ec.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 BR(/^0\.0/,LR),!!(e&&(e[W3]||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 Ye)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Ye(t,n,i,s||G3(t,n,i.bytes))}else if(e!=null&&e[W3]===!0){let{version:t,multihash:n,code:i}=e,s=nd(n);return Ye.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!==Fu)throw new Error(`Version 0 CID must use dag-pb (code: ${Fu}) block encoding`);return new Ye(e,t,n,n.bytes)}case 1:{let i=G3(e,t,n.bytes);return new Ye(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Ye.create(0,Fu,e)}static createV1(e,t){return Ye.create(1,e,t)}static decode(e){let[t,n]=Ye.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Ye.inspectBytes(e),n=t.size-t.multihashSize,i=es(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),f=new Ua(t.multihashCode,t.digestSize,s,i);return[t.version===0?Ye.createV0(f):Ye.createV1(t.codec,f),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[A,O]=Bu(e.subarray(t));return t+=O,A},"next"),i=n(),s=Fu;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let f=t,u=n(),d=n(),y=t+d,w=y-f;return{version:i,codec:s,multihashCode:u,digestSize:d,multihashSize:w,size:y}}static parse(e,t){let[n,i]=DR(e,t),s=Ye.decode(i);return s._baseCache.set(n,e),s}};o(Ye,"CID");DR=o((r,e)=>{switch(r[0]){case"Q":{let t=e||vi;return[vi.prefix,t.decode(`${vi.prefix}${r}`)]}case vi.prefix:{let t=e||vi;return[vi.prefix,t.decode(r)]}case ec.prefix:{let t=e||ec;return[ec.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"),RR=o((r,e,t)=>{let{prefix:n}=t;if(n!==vi.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"),OR=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"),Fu=112,NR=18,G3=o((r,e,t)=>{let n=nc(r),i=n+nc(e),s=new Uint8Array(i+t.byteLength);return rc(r,s,0),rc(e,s,n),s.set(t,i),s},"encodeCID"),W3=Symbol.for("@ipld/js-cid/CID"),sd={writable:!1,configurable:!1,enumerable:!0},ad={writable:!1,enumerable:!1,configurable:!1},PR="0.0.0-dev",BR=o((r,e)=>{if(r.test(PR))console.warn(e);else throw new Error(e)},"deprecate"),LR=`CID.isCID(v) is deprecated and will be removed in the next major release.
21
21
  Following code pattern:
22
22
 
23
23
  if (CID.isCID(value)) {
@@ -31,11 +31,11 @@ if (cid) {
31
31
  // Make sure to use cid instead of value
32
32
  doSomethingWithCID(cid)
33
33
  }
34
- `});var u1=Gt(()=>{ji();rd();Ls();s1();Fa()});var $u,wV,l1=Gt(()=>{k3();I3();D3();R3();O3();Qm();tc();Qh();ed();P3();Uu();c1();K3();V3();u1();$u={...Gm,...Wm,...Jm,...Ym,...Zm,...Xm,...e1,...t1,...r1,...n1},wV={...a1,...f1}});function Y3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var J3,h1,UR,fd,d1=Gt(()=>{l1();Wh();o(Y3,"createCodec");J3=Y3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),h1=Y3("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=Nu(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),UR={utf8:J3,"utf-8":J3,hex:$u.base16,latin1:h1,ascii:h1,binary:h1,...$u},fd=UR});var Z3={};Zt(Z3,{fromString:()=>$t});function $t(r,e="utf8"){let t=fd[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ba(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var cd=Gt(()=>{d1();Ou();o($t,"fromString")});var X3={};Zt(X3,{toString:()=>Rt});function Rt(r,e="utf8"){let t=fd[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var ic=Gt(()=>{d1();o(Rt,"toString")});var Q3=Re(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});function FR(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(FR,"imulShim");Hn.mul=Math.imul||FR;function $R(r,e){return r+e|0}o($R,"add");Hn.add=$R;function qR(r,e){return r-e|0}o(qR,"sub");Hn.sub=qR;function jR(r,e){return r<<e|r>>>32-e}o(jR,"rotl");Hn.rotl=jR;function HR(r,e){return r<<32-e|r>>>e}o(HR,"rotr");Hn.rotr=HR;function zR(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(zR,"isIntegerShim");Hn.isInteger=Number.isInteger||zR;Hn.MAX_SAFE_INTEGER=9007199254740991;Hn.isSafeInteger=function(r){return Hn.isInteger(r)&&r>=-Hn.MAX_SAFE_INTEGER&&r<=Hn.MAX_SAFE_INTEGER}});var $a=Re(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});var ex=Q3();function KR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(KR,"readInt16BE");It.readInt16BE=KR;function VR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(VR,"readUint16BE");It.readUint16BE=VR;function GR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(GR,"readInt16LE");It.readInt16LE=GR;function WR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(WR,"readUint16LE");It.readUint16LE=WR;function tx(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(tx,"writeUint16BE");It.writeUint16BE=tx;It.writeInt16BE=tx;function rx(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(rx,"writeUint16LE");It.writeUint16LE=rx;It.writeInt16LE=rx;function p1(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(p1,"readInt32BE");It.readInt32BE=p1;function m1(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(m1,"readUint32BE");It.readUint32BE=m1;function b1(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(b1,"readInt32LE");It.readInt32LE=b1;function g1(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(g1,"readUint32LE");It.readUint32LE=g1;function ud(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(ud,"writeUint32BE");It.writeUint32BE=ud;It.writeInt32BE=ud;function ld(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(ld,"writeUint32LE");It.writeUint32LE=ld;It.writeInt32LE=ld;function JR(r,e){e===void 0&&(e=0);var t=p1(r,e),n=p1(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(JR,"readInt64BE");It.readInt64BE=JR;function YR(r,e){e===void 0&&(e=0);var t=m1(r,e),n=m1(r,e+4);return t*4294967296+n}o(YR,"readUint64BE");It.readUint64BE=YR;function ZR(r,e){e===void 0&&(e=0);var t=b1(r,e),n=b1(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(ZR,"readInt64LE");It.readInt64LE=ZR;function XR(r,e){e===void 0&&(e=0);var t=g1(r,e),n=g1(r,e+4);return n*4294967296+t}o(XR,"readUint64LE");It.readUint64LE=XR;function nx(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ud(r/4294967296>>>0,e,t),ud(r>>>0,e,t+4),e}o(nx,"writeUint64BE");It.writeUint64BE=nx;It.writeInt64BE=nx;function ix(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ld(r>>>0,e,t),ld(r/4294967296>>>0,e,t+4),e}o(ix,"writeUint64LE");It.writeUint64LE=ix;It.writeInt64LE=ix;function QR(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(QR,"readUintBE");It.readUintBE=QR;function eO(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(eO,"readUintLE");It.readUintLE=eO;function tO(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(!ex.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(tO,"writeUintBE");It.writeUintBE=tO;function rO(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(!ex.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(rO,"writeUintLE");It.writeUintLE=rO;function nO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(nO,"readFloat32BE");It.readFloat32BE=nO;function iO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(iO,"readFloat32LE");It.readFloat32LE=iO;function oO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(oO,"readFloat64BE");It.readFloat64BE=oO;function sO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(sO,"readFloat64LE");It.readFloat64LE=sO;function aO(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(aO,"writeFloat32BE");It.writeFloat32BE=aO;function fO(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(fO,"writeFloat32LE");It.writeFloat32LE=fO;function cO(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(cO,"writeFloat64BE");It.writeFloat64BE=cO;function uO(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(uO,"writeFloat64LE");It.writeFloat64LE=uO});var xi=Re(v1=>{"use strict";Object.defineProperty(v1,"__esModule",{value:!0});function lO(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(lO,"wipe");v1.wipe=lO});var sx=Re($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var dd=$a(),hd=xi();$s.DIGEST_LENGTH=32;$s.BLOCK_SIZE=64;var ox=function(){function r(){this.digestLength=$s.DIGEST_LENGTH,this.blockSize=$s.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(){hd.wipe(this._buffer),hd.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&&(y1(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=y1(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,f=t%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;dd.writeUint32BE(i,this._buffer,f-8),dd.writeUint32BE(s,this._buffer,f-4),y1(this._temp,this._state,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)dd.writeUint32BE(this._state[u],e,u*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){hd.wipe(e.state),e.buffer&&hd.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();$s.SHA256=ox;var hO=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 y1(r,e,t,n,i){for(;i>=64;){for(var s=e[0],f=e[1],u=e[2],d=e[3],y=e[4],w=e[5],A=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;r[R]=dd.readUint32BE(t,I)}for(var R=16;R<64;R++){var B=r[R-2],Y=(B>>>17|B<<32-17)^(B>>>19|B<<32-19)^B>>>10;B=r[R-15];var P=(B>>>7|B<<32-7)^(B>>>18|B<<32-18)^B>>>3;r[R]=(Y+r[R-7]|0)+(P+r[R-16]|0)}for(var R=0;R<64;R++){var Y=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&w^~y&A)|0)+(O+(hO[R]+r[R]|0)|0)|0,P=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&f^s&u^f&u)|0;O=A,A=w,w=y,y=d+Y|0,d=u,u=f,f=s,s=Y+P|0}e[0]+=s,e[1]+=f,e[2]+=u,e[3]+=d,e[4]+=y,e[5]+=w,e[6]+=A,e[7]+=O,n+=64,i-=64}return n}o(y1,"hashBlocks");function dO(r){var e=new ox;e.update(r);var t=e.digest();return e.clean(),t}o(dO,"hash");$s.hash=dO});var x1=Re((KV,pd)=>{(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 f=!n.JS_SHA3_NO_COMMON_JS&&typeof pd=="object"&&pd.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",y="0123456789abcdef".split(""),w=[31,7936,2031616,520093696],A=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],B=[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],Y=[224,256,384,512],P=[128,256],J=["hex","buffer","arrayBuffer","array","digest"],ee={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),d&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var Z=o(function(D,Q,se){return function(q){return new _(D,Q,D).update(q)[se]()}},"createOutputMethod"),ne=o(function(D,Q,se){return function(q,z){return new _(D,Q,z).update(q)[se]()}},"createShakeOutputMethod"),V=o(function(D,Q,se){return function(q,z,G,te){return l["cshake"+D].update(q,z,G,te)[se]()}},"createCshakeOutputMethod"),j=o(function(D,Q,se){return function(q,z,G,te){return l["kmac"+D].update(q,z,G,te)[se]()}},"createKmacOutputMethod"),H=o(function(D,Q,se,q){for(var z=0;z<J.length;++z){var G=J[z];D[G]=Q(se,q,G)}return D},"createOutputMethods"),he=o(function(D,Q){var se=Z(D,Q,"hex");return se.create=function(){return new _(D,Q,D)},se.update=function(q){return se.create().update(q)},H(se,Z,D,Q)},"createMethod"),L=o(function(D,Q){var se=ne(D,Q,"hex");return se.create=function(q){return new _(D,Q,q)},se.update=function(q,z){return se.create(z).update(q)},H(se,ne,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=ee[D],q=V(D,Q,"hex");return q.create=function(z,G,te){return!G&&!te?l["shake"+D].create(z):new _(D,Q,z).bytepad([G,te],se)},q.update=function(z,G,te,ae){return q.create(G,te,ae).update(z)},H(q,V,D,Q)},"createCshakeMethod"),v=o(function(D,Q){var se=ee[D],q=j(D,Q,"hex");return q.create=function(z,G,te){return new k(D,Q,G).bytepad(["KMAC",te],se).bytepad([z],se)},q.update=function(z,G,te,ae){return q.create(z,te,ae).update(G)},H(q,j,D,Q)},"createKmacMethod"),g=[{name:"keccak",padding:O,bits:Y,createMethod:he},{name:"sha3",padding:R,bits:Y,createMethod:he},{name:"shake",padding:w,bits:P,createMethod:L},{name:"cshake",padding:A,bits:P,createMethod:h},{name:"kmac",padding:A,bits:P,createMethod:v}],l={},b=[],E=0;E<g.length;++E)for(var M=g[E],S=M.bits,x=0;x<S.length;++x){var C=M.name+"_"+S[x];if(b.push(C),l[C]=M.createMethod(S[x],M.padding),M.name!=="sha3"){var N=M.name+S[x];b.push(N),l[N]=l[C]}}function _(D,Q,se){this.blocks=[],this.s=[],this.padding=Q,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=se>>5,this.extraBytes=(se&31)>>3;for(var q=0;q<50;++q)this.s[q]=0}o(_,"Keccak"),_.prototype.update=function(D){if(this.finalized)throw new Error(e);var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}for(var q=this.blocks,z=this.byteCount,G=D.length,te=this.blockCount,ae=0,Ae=this.s,ge,ie;ae<G;){if(this.reset)for(this.reset=!1,q[0]=this.block,ge=1;ge<te+1;++ge)q[ge]=0;if(Q)for(ge=this.start;ae<G&&ge<z;++ae)q[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<G&&ge<z;++ae)ie=D.charCodeAt(ae),ie<128?q[ge>>2]|=ie<<I[ge++&3]:ie<2048?(q[ge>>2]|=(192|ie>>6)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):ie<55296||ie>=57344?(q[ge>>2]|=(224|ie>>12)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):(ie=65536+((ie&1023)<<10|D.charCodeAt(++ae)&1023),q[ge>>2]|=(240|ie>>18)<<I[ge++&3],q[ge>>2]|=(128|ie>>12&63)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=z){for(this.start=ge-z,this.block=q[te],ge=0;ge<te;++ge)Ae[ge]^=q[ge];fe(Ae),this.reset=!0}else this.start=ge}return this},_.prototype.encode=function(D,Q){var se=D&255,q=1,z=[se];for(D=D>>8,se=D&255;se>0;)z.unshift(se),D=D>>8,se=D&255,++q;return Q?z.push(q):z.unshift(q),this.update(z),z.length},_.prototype.encodeString=function(D){var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}var q=0,z=D.length;if(Q)q=z;else for(var G=0;G<D.length;++G){var te=D.charCodeAt(G);te<128?q+=1:te<2048?q+=2:te<55296||te>=57344?q+=3:(te=65536+((te&1023)<<10|D.charCodeAt(++G)&1023),q+=4)}return q+=this.encode(q*8),this.update(D),q},_.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),q=0;q<D.length;++q)se+=this.encodeString(D[q]);var z=Q-se%Q,G=[];return G.length=z,this.update(G),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,q=this.s;if(D[Q>>2]|=this.padding[Q&3],this.lastByteIndex===this.byteCount)for(D[0]=D[se],Q=1;Q<se+1;++Q)D[Q]=0;for(D[se-1]|=2147483648,Q=0;Q<se;++Q)q[Q]^=D[Q];fe(q)}},_.prototype.toString=_.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,z=0,G=0,te="",ae;G<se;){for(z=0;z<D&&G<se;++z,++G)ae=Q[z],te+=y[ae>>4&15]+y[ae&15]+y[ae>>12&15]+y[ae>>8&15]+y[ae>>20&15]+y[ae>>16&15]+y[ae>>28&15]+y[ae>>24&15];G%D===0&&(fe(Q),z=0)}return q&&(ae=Q[z],te+=y[ae>>4&15]+y[ae&15],q>1&&(te+=y[ae>>12&15]+y[ae>>8&15]),q>2&&(te+=y[ae>>20&15]+y[ae>>16&15])),te},_.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,z=0,G=0,te=this.outputBits>>3,ae;q?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(te);for(var Ae=new Uint32Array(ae);G<se;){for(z=0;z<D&&G<se;++z,++G)Ae[G]=Q[z];G%D===0&&fe(Q)}return q&&(Ae[z]=Q[z],ae=ae.slice(0,te)),ae},_.prototype.buffer=_.prototype.arrayBuffer,_.prototype.digest=_.prototype.array=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,z=0,G=0,te=[],ae,Ae;G<se;){for(z=0;z<D&&G<se;++z,++G)ae=G<<2,Ae=Q[z],te[ae]=Ae&255,te[ae+1]=Ae>>8&255,te[ae+2]=Ae>>16&255,te[ae+3]=Ae>>24&255;G%D===0&&fe(Q)}return q&&(ae=G<<2,Ae=Q[z],te[ae]=Ae&255,q>1&&(te[ae+1]=Ae>>8&255),q>2&&(te[ae+2]=Ae>>16&255)),te};function k(D,Q,se){_.call(this,D,Q,se)}o(k,"Kmac"),k.prototype=new _,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),_.prototype.finalize.call(this)};var fe=o(function(D){var Q,se,q,z,G,te,ae,Ae,ge,ie,Me,ue,ve,W,pe,ke,ze,Pe,Je,gr,le,oe,F,X,me,ye,we,Ie,Ot,Fe,Ne,Ut,Ve,Ze,Pn,st,at,ii,ft,rt,oi,ct,ut,mn,lt,Qe,si,ht,dt,ai,pt,mt,fi,bt,nt,Bn,jt,Ht,bn,gn,vn,Fr,yn;for(q=0;q<48;q+=2)z=D[0]^D[10]^D[20]^D[30]^D[40],G=D[1]^D[11]^D[21]^D[31]^D[41],te=D[2]^D[12]^D[22]^D[32]^D[42],ae=D[3]^D[13]^D[23]^D[33]^D[43],Ae=D[4]^D[14]^D[24]^D[34]^D[44],ge=D[5]^D[15]^D[25]^D[35]^D[45],ie=D[6]^D[16]^D[26]^D[36]^D[46],Me=D[7]^D[17]^D[27]^D[37]^D[47],ue=D[8]^D[18]^D[28]^D[38]^D[48],ve=D[9]^D[19]^D[29]^D[39]^D[49],Q=ue^(te<<1|ae>>>31),se=ve^(ae<<1|te>>>31),D[0]^=Q,D[1]^=se,D[10]^=Q,D[11]^=se,D[20]^=Q,D[21]^=se,D[30]^=Q,D[31]^=se,D[40]^=Q,D[41]^=se,Q=z^(Ae<<1|ge>>>31),se=G^(ge<<1|Ae>>>31),D[2]^=Q,D[3]^=se,D[12]^=Q,D[13]^=se,D[22]^=Q,D[23]^=se,D[32]^=Q,D[33]^=se,D[42]^=Q,D[43]^=se,Q=te^(ie<<1|Me>>>31),se=ae^(Me<<1|ie>>>31),D[4]^=Q,D[5]^=se,D[14]^=Q,D[15]^=se,D[24]^=Q,D[25]^=se,D[34]^=Q,D[35]^=se,D[44]^=Q,D[45]^=se,Q=Ae^(ue<<1|ve>>>31),se=ge^(ve<<1|ue>>>31),D[6]^=Q,D[7]^=se,D[16]^=Q,D[17]^=se,D[26]^=Q,D[27]^=se,D[36]^=Q,D[37]^=se,D[46]^=Q,D[47]^=se,Q=ie^(z<<1|G>>>31),se=Me^(G<<1|z>>>31),D[8]^=Q,D[9]^=se,D[18]^=Q,D[19]^=se,D[28]^=Q,D[29]^=se,D[38]^=Q,D[39]^=se,D[48]^=Q,D[49]^=se,W=D[0],pe=D[1],Qe=D[11]<<4|D[10]>>>28,si=D[10]<<4|D[11]>>>28,Ie=D[20]<<3|D[21]>>>29,Ot=D[21]<<3|D[20]>>>29,gn=D[31]<<9|D[30]>>>23,vn=D[30]<<9|D[31]>>>23,ct=D[40]<<18|D[41]>>>14,ut=D[41]<<18|D[40]>>>14,Ze=D[2]<<1|D[3]>>>31,Pn=D[3]<<1|D[2]>>>31,ke=D[13]<<12|D[12]>>>20,ze=D[12]<<12|D[13]>>>20,ht=D[22]<<10|D[23]>>>22,dt=D[23]<<10|D[22]>>>22,Fe=D[33]<<13|D[32]>>>19,Ne=D[32]<<13|D[33]>>>19,Fr=D[42]<<2|D[43]>>>30,yn=D[43]<<2|D[42]>>>30,bt=D[5]<<30|D[4]>>>2,nt=D[4]<<30|D[5]>>>2,st=D[14]<<6|D[15]>>>26,at=D[15]<<6|D[14]>>>26,Pe=D[25]<<11|D[24]>>>21,Je=D[24]<<11|D[25]>>>21,ai=D[34]<<15|D[35]>>>17,pt=D[35]<<15|D[34]>>>17,Ut=D[45]<<29|D[44]>>>3,Ve=D[44]<<29|D[45]>>>3,X=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Bn=D[17]<<23|D[16]>>>9,jt=D[16]<<23|D[17]>>>9,ii=D[26]<<25|D[27]>>>7,ft=D[27]<<25|D[26]>>>7,gr=D[36]<<21|D[37]>>>11,le=D[37]<<21|D[36]>>>11,mt=D[47]<<24|D[46]>>>8,fi=D[46]<<24|D[47]>>>8,mn=D[8]<<27|D[9]>>>5,lt=D[9]<<27|D[8]>>>5,ye=D[18]<<20|D[19]>>>12,we=D[19]<<20|D[18]>>>12,Ht=D[29]<<7|D[28]>>>25,bn=D[28]<<7|D[29]>>>25,rt=D[38]<<8|D[39]>>>24,oi=D[39]<<8|D[38]>>>24,oe=D[48]<<14|D[49]>>>18,F=D[49]<<14|D[48]>>>18,D[0]=W^~ke&Pe,D[1]=pe^~ze&Je,D[10]=X^~ye&Ie,D[11]=me^~we&Ot,D[20]=Ze^~st&ii,D[21]=Pn^~at&ft,D[30]=mn^~Qe&ht,D[31]=lt^~si&dt,D[40]=bt^~Bn&Ht,D[41]=nt^~jt&bn,D[2]=ke^~Pe&gr,D[3]=ze^~Je&le,D[12]=ye^~Ie&Fe,D[13]=we^~Ot&Ne,D[22]=st^~ii&rt,D[23]=at^~ft&oi,D[32]=Qe^~ht&ai,D[33]=si^~dt&pt,D[42]=Bn^~Ht&gn,D[43]=jt^~bn&vn,D[4]=Pe^~gr&oe,D[5]=Je^~le&F,D[14]=Ie^~Fe&Ut,D[15]=Ot^~Ne&Ve,D[24]=ii^~rt&ct,D[25]=ft^~oi&ut,D[34]=ht^~ai&mt,D[35]=dt^~pt&fi,D[44]=Ht^~gn&Fr,D[45]=bn^~vn&yn,D[6]=gr^~oe&W,D[7]=le^~F&pe,D[16]=Fe^~Ut&X,D[17]=Ne^~Ve&me,D[26]=rt^~ct&Ze,D[27]=oi^~ut&Pn,D[36]=ai^~mt&mn,D[37]=pt^~fi&lt,D[46]=gn^~Fr&bt,D[47]=vn^~yn&nt,D[8]=oe^~W&ke,D[9]=F^~pe&ze,D[18]=Ut^~X&ye,D[19]=Ve^~me&we,D[28]=ct^~Ze&st,D[29]=ut^~Pn&at,D[38]=mt^~mn&Qe,D[39]=fi^~lt&si,D[48]=Fr^~bt&Bn,D[49]=yn^~nt&jt,D[0]^=B[q],D[1]^=B[q+1]},"f");if(f)pd.exports=l;else{for(E=0;E<b.length;++E)n[b[E]]=l[b[E]];u&&define(function(){return l})}})()});var ax=Re((VV,pO)=>{pO.exports={name:"elliptic",version:"6.6.1",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 w1=Re(()=>{});var mo=Re((fx,_1)=>{(function(r,e){"use strict";function t(L,h){if(!L)throw new Error(h||"Assertion failed")}o(t,"assert");function n(L,h){L.super_=h;var v=o(function(){},"TempCtor");v.prototype=h.prototype,L.prototype=new v,L.prototype.constructor=L}o(n,"inherits");function i(L,h,v){if(i.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(L||0,h||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<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=w1().Buffer}catch{}i.isBN=o(function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},"isBN"),i.max=o(function(h,v){return h.cmp(v)>0?h:v},"max"),i.min=o(function(h,v){return h.cmp(v)<0?h:v},"min"),i.prototype._init=o(function(h,v,g){if(typeof h=="number")return this._initNumber(h,v,g);if(typeof h=="object")return this._initArray(h,v,g);v==="hex"&&(v=16),t(v===(v|0)&&v>=2&&v<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(v===16?this._parseHex(h,l,g):(this._parseBase(h,v,l),g==="le"&&this._initArray(this.toArray(),v,g)))},"init"),i.prototype._initNumber=o(function(h,v,g){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(t(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),v,g)},"_initNumber"),i.prototype._initArray=o(function(h,v,g){if(t(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var b,E,M=0;if(g==="be")for(l=h.length-1,b=0;l>=0;l-=3)E=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[b]|=E<<M&67108863,this.words[b+1]=E>>>26-M&67108863,M+=24,M>=26&&(M-=26,b++);else if(g==="le")for(l=0,b=0;l<h.length;l+=3)E=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[b]|=E<<M&67108863,this.words[b+1]=E>>>26-M&67108863,M+=24,M>=26&&(M-=26,b++);return this.strip()},"_initArray");function f(L,h){var v=L.charCodeAt(h);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}o(f,"parseHex4Bits");function u(L,h,v){var g=f(L,v);return v-1>=h&&(g|=f(L,v-1)<<4),g}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,v,g){this.length=Math.ceil((h.length-v)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var b=0,E=0,M;if(g==="be")for(l=h.length-1;l>=v;l-=2)M=u(h,v,l)<<b,this.words[E]|=M&67108863,b>=18?(b-=18,E+=1,this.words[E]|=M>>>26):b+=8;else{var S=h.length-v;for(l=S%2===0?v+1:v;l<h.length;l+=2)M=u(h,v,l)<<b,this.words[E]|=M&67108863,b>=18?(b-=18,E+=1,this.words[E]|=M>>>26):b+=8}this.strip()},"_parseHex");function d(L,h,v,g){for(var l=0,b=Math.min(L.length,v),E=h;E<b;E++){var M=L.charCodeAt(E)-48;l*=g,M>=49?l+=M-49+10:M>=17?l+=M-17+10:l+=M}return l}o(d,"parseBase"),i.prototype._parseBase=o(function(h,v,g){this.words=[0],this.length=1;for(var l=0,b=1;b<=67108863;b*=v)l++;l--,b=b/v|0;for(var E=h.length-g,M=E%l,S=Math.min(E,E-M)+g,x=0,C=g;C<S;C+=l)x=d(h,C,C+l,v),this.imuln(b),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(M!==0){var N=1;for(x=d(h,C,h.length,v),C=0;C<M;C++)N*=v;this.imuln(N),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var v=0;v<this.length;v++)h.words[v]=this.words[v];h.length=this.length,h.negative=this.negative,h.red=this.red},"copy"),i.prototype.clone=o(function(){var h=new i(null);return this.copy(h),h},"clone"),i.prototype._expand=o(function(h){for(;this.length<h;)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 y=["","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"],w=[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],A=[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(h,v){h=h||10,v=v|0||1;var g;if(h===16||h==="hex"){g="";for(var l=0,b=0,E=0;E<this.length;E++){var M=this.words[E],S=((M<<l|b)&16777215).toString(16);b=M>>>24-l&16777215,l+=2,l>=26&&(l-=26,E--),b!==0||E!==this.length-1?g=y[6-S.length]+S+g:g=S+g}for(b!==0&&(g=b.toString(16)+g);g.length%v!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(h===(h|0)&&h>=2&&h<=36){var x=w[h],C=A[h];g="";var N=this.clone();for(N.negative=0;!N.isZero();){var _=N.modn(C).toString(h);N=N.idivn(C),N.isZero()?g=_+g:g=y[x-_.length]+_+g}for(this.isZero()&&(g="0"+g);g.length%v!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(h,v){return t(typeof s<"u"),this.toArrayLike(s,h,v)},"toBuffer"),i.prototype.toArray=o(function(h,v){return this.toArrayLike(Array,h,v)},"toArray"),i.prototype.toArrayLike=o(function(h,v,g){var l=this.byteLength(),b=g||Math.max(1,l);t(l<=b,"byte array longer than desired length"),t(b>0,"Requested array length <= 0"),this.strip();var E=v==="le",M=new h(b),S,x,C=this.clone();if(E){for(x=0;!C.isZero();x++)S=C.andln(255),C.iushrn(8),M[x]=S;for(;x<b;x++)M[x]=0}else{for(x=0;x<b-l;x++)M[x]=0;for(x=0;!C.isZero();x++)S=C.andln(255),C.iushrn(8),M[b-x-1]=S}return M},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var v=h,g=0;return v>=4096&&(g+=13,v>>>=13),v>=64&&(g+=7,v>>>=7),v>=8&&(g+=4,v>>>=4),v>=2&&(g+=2,v>>>=2),g+v},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var v=h,g=0;return(v&8191)===0&&(g+=13,v>>>=13),(v&127)===0&&(g+=7,v>>>=7),(v&15)===0&&(g+=4,v>>>=4),(v&3)===0&&(g+=2,v>>>=2),(v&1)===0&&g++,g},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],v=this._countBits(h);return(this.length-1)*26+v},"bitLength");function O(L){for(var h=new Array(L.bitLength()),v=0;v<h.length;v++){var g=v/26|0,l=v%26;h[v]=(L.words[g]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,v=0;v<this.length;v++){var g=this._zeroBits(this.words[v]);if(h+=g,g!==26)break}return h},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]|h.words[v];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return t((this.negative|h.negative)===0),this.iuor(h)},"ior"),i.prototype.or=o(function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},"or"),i.prototype.uor=o(function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(h){var v;this.length>h.length?v=h:v=this;for(var g=0;g<v.length;g++)this.words[g]=this.words[g]&h.words[g];return this.length=v.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return t((this.negative|h.negative)===0),this.iuand(h)},"iand"),i.prototype.and=o(function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},"and"),i.prototype.uand=o(function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(h){var v,g;this.length>h.length?(v=this,g=h):(v=h,g=this);for(var l=0;l<g.length;l++)this.words[l]=v.words[l]^g.words[l];if(this!==v)for(;l<v.length;l++)this.words[l]=v.words[l];return this.length=v.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return t((this.negative|h.negative)===0),this.iuxor(h)},"ixor"),i.prototype.xor=o(function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(h){t(typeof h=="number"&&h>=0);var v=Math.ceil(h/26)|0,g=h%26;this._expand(v),g>0&&v--;for(var l=0;l<v;l++)this.words[l]=~this.words[l]&67108863;return g>0&&(this.words[l]=~this.words[l]&67108863>>26-g),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,v){t(typeof h=="number"&&h>=0);var g=h/26|0,l=h%26;return this._expand(g+1),v?this.words[g]=this.words[g]|1<<l:this.words[g]=this.words[g]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var v;if(this.negative!==0&&h.negative===0)return this.negative=0,v=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,v=this.isub(h),h.negative=1,v._normSign();var g,l;this.length>h.length?(g=this,l=h):(g=h,l=this);for(var b=0,E=0;E<l.length;E++)v=(g.words[E]|0)+(l.words[E]|0)+b,this.words[E]=v&67108863,b=v>>>26;for(;b!==0&&E<g.length;E++)v=(g.words[E]|0)+b,this.words[E]=v&67108863,b=v>>>26;if(this.length=g.length,b!==0)this.words[this.length]=b,this.length++;else if(g!==this)for(;E<g.length;E++)this.words[E]=g.words[E];return this},"iadd"),i.prototype.add=o(function(h){var v;return h.negative!==0&&this.negative===0?(h.negative=0,v=this.sub(h),h.negative^=1,v):h.negative===0&&this.negative!==0?(this.negative=0,v=h.sub(this),this.negative=1,v):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},"add"),i.prototype.isub=o(function(h){if(h.negative!==0){h.negative=0;var v=this.iadd(h);return h.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var g=this.cmp(h);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,b;g>0?(l=this,b=h):(l=h,b=this);for(var E=0,M=0;M<b.length;M++)v=(l.words[M]|0)-(b.words[M]|0)+E,E=v>>26,this.words[M]=v&67108863;for(;E!==0&&M<l.length;M++)v=(l.words[M]|0)+E,E=v>>26,this.words[M]=v&67108863;if(E===0&&M<l.length&&l!==this)for(;M<l.length;M++)this.words[M]=l.words[M];return this.length=Math.max(this.length,M),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(L,h,v){v.negative=h.negative^L.negative;var g=L.length+h.length|0;v.length=g,g=g-1|0;var l=L.words[0]|0,b=h.words[0]|0,E=l*b,M=E&67108863,S=E/67108864|0;v.words[0]=M;for(var x=1;x<g;x++){for(var C=S>>>26,N=S&67108863,_=Math.min(x,h.length-1),k=Math.max(0,x-L.length+1);k<=_;k++){var fe=x-k|0;l=L.words[fe]|0,b=h.words[k]|0,E=l*b+N,C+=E/67108864|0,N=E&67108863}v.words[x]=N|0,S=C|0}return S!==0?v.words[x]=S|0:v.length--,v.strip()}o(R,"smallMulTo");var I=o(function(h,v,g){var l=h.words,b=v.words,E=g.words,M=0,S,x,C,N=l[0]|0,_=N&8191,k=N>>>13,fe=l[1]|0,D=fe&8191,Q=fe>>>13,se=l[2]|0,q=se&8191,z=se>>>13,G=l[3]|0,te=G&8191,ae=G>>>13,Ae=l[4]|0,ge=Ae&8191,ie=Ae>>>13,Me=l[5]|0,ue=Me&8191,ve=Me>>>13,W=l[6]|0,pe=W&8191,ke=W>>>13,ze=l[7]|0,Pe=ze&8191,Je=ze>>>13,gr=l[8]|0,le=gr&8191,oe=gr>>>13,F=l[9]|0,X=F&8191,me=F>>>13,ye=b[0]|0,we=ye&8191,Ie=ye>>>13,Ot=b[1]|0,Fe=Ot&8191,Ne=Ot>>>13,Ut=b[2]|0,Ve=Ut&8191,Ze=Ut>>>13,Pn=b[3]|0,st=Pn&8191,at=Pn>>>13,ii=b[4]|0,ft=ii&8191,rt=ii>>>13,oi=b[5]|0,ct=oi&8191,ut=oi>>>13,mn=b[6]|0,lt=mn&8191,Qe=mn>>>13,si=b[7]|0,ht=si&8191,dt=si>>>13,ai=b[8]|0,pt=ai&8191,mt=ai>>>13,fi=b[9]|0,bt=fi&8191,nt=fi>>>13;g.negative=h.negative^v.negative,g.length=19,S=Math.imul(_,we),x=Math.imul(_,Ie),x=x+Math.imul(k,we)|0,C=Math.imul(k,Ie);var Bn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,S=Math.imul(D,we),x=Math.imul(D,Ie),x=x+Math.imul(Q,we)|0,C=Math.imul(Q,Ie),S=S+Math.imul(_,Fe)|0,x=x+Math.imul(_,Ne)|0,x=x+Math.imul(k,Fe)|0,C=C+Math.imul(k,Ne)|0;var jt=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(jt>>>26)|0,jt&=67108863,S=Math.imul(q,we),x=Math.imul(q,Ie),x=x+Math.imul(z,we)|0,C=Math.imul(z,Ie),S=S+Math.imul(D,Fe)|0,x=x+Math.imul(D,Ne)|0,x=x+Math.imul(Q,Fe)|0,C=C+Math.imul(Q,Ne)|0,S=S+Math.imul(_,Ve)|0,x=x+Math.imul(_,Ze)|0,x=x+Math.imul(k,Ve)|0,C=C+Math.imul(k,Ze)|0;var Ht=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,S=Math.imul(te,we),x=Math.imul(te,Ie),x=x+Math.imul(ae,we)|0,C=Math.imul(ae,Ie),S=S+Math.imul(q,Fe)|0,x=x+Math.imul(q,Ne)|0,x=x+Math.imul(z,Fe)|0,C=C+Math.imul(z,Ne)|0,S=S+Math.imul(D,Ve)|0,x=x+Math.imul(D,Ze)|0,x=x+Math.imul(Q,Ve)|0,C=C+Math.imul(Q,Ze)|0,S=S+Math.imul(_,st)|0,x=x+Math.imul(_,at)|0,x=x+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var bn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(bn>>>26)|0,bn&=67108863,S=Math.imul(ge,we),x=Math.imul(ge,Ie),x=x+Math.imul(ie,we)|0,C=Math.imul(ie,Ie),S=S+Math.imul(te,Fe)|0,x=x+Math.imul(te,Ne)|0,x=x+Math.imul(ae,Fe)|0,C=C+Math.imul(ae,Ne)|0,S=S+Math.imul(q,Ve)|0,x=x+Math.imul(q,Ze)|0,x=x+Math.imul(z,Ve)|0,C=C+Math.imul(z,Ze)|0,S=S+Math.imul(D,st)|0,x=x+Math.imul(D,at)|0,x=x+Math.imul(Q,st)|0,C=C+Math.imul(Q,at)|0,S=S+Math.imul(_,ft)|0,x=x+Math.imul(_,rt)|0,x=x+Math.imul(k,ft)|0,C=C+Math.imul(k,rt)|0;var gn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(gn>>>26)|0,gn&=67108863,S=Math.imul(ue,we),x=Math.imul(ue,Ie),x=x+Math.imul(ve,we)|0,C=Math.imul(ve,Ie),S=S+Math.imul(ge,Fe)|0,x=x+Math.imul(ge,Ne)|0,x=x+Math.imul(ie,Fe)|0,C=C+Math.imul(ie,Ne)|0,S=S+Math.imul(te,Ve)|0,x=x+Math.imul(te,Ze)|0,x=x+Math.imul(ae,Ve)|0,C=C+Math.imul(ae,Ze)|0,S=S+Math.imul(q,st)|0,x=x+Math.imul(q,at)|0,x=x+Math.imul(z,st)|0,C=C+Math.imul(z,at)|0,S=S+Math.imul(D,ft)|0,x=x+Math.imul(D,rt)|0,x=x+Math.imul(Q,ft)|0,C=C+Math.imul(Q,rt)|0,S=S+Math.imul(_,ct)|0,x=x+Math.imul(_,ut)|0,x=x+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var vn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(vn>>>26)|0,vn&=67108863,S=Math.imul(pe,we),x=Math.imul(pe,Ie),x=x+Math.imul(ke,we)|0,C=Math.imul(ke,Ie),S=S+Math.imul(ue,Fe)|0,x=x+Math.imul(ue,Ne)|0,x=x+Math.imul(ve,Fe)|0,C=C+Math.imul(ve,Ne)|0,S=S+Math.imul(ge,Ve)|0,x=x+Math.imul(ge,Ze)|0,x=x+Math.imul(ie,Ve)|0,C=C+Math.imul(ie,Ze)|0,S=S+Math.imul(te,st)|0,x=x+Math.imul(te,at)|0,x=x+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,S=S+Math.imul(q,ft)|0,x=x+Math.imul(q,rt)|0,x=x+Math.imul(z,ft)|0,C=C+Math.imul(z,rt)|0,S=S+Math.imul(D,ct)|0,x=x+Math.imul(D,ut)|0,x=x+Math.imul(Q,ct)|0,C=C+Math.imul(Q,ut)|0,S=S+Math.imul(_,lt)|0,x=x+Math.imul(_,Qe)|0,x=x+Math.imul(k,lt)|0,C=C+Math.imul(k,Qe)|0;var Fr=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,S=Math.imul(Pe,we),x=Math.imul(Pe,Ie),x=x+Math.imul(Je,we)|0,C=Math.imul(Je,Ie),S=S+Math.imul(pe,Fe)|0,x=x+Math.imul(pe,Ne)|0,x=x+Math.imul(ke,Fe)|0,C=C+Math.imul(ke,Ne)|0,S=S+Math.imul(ue,Ve)|0,x=x+Math.imul(ue,Ze)|0,x=x+Math.imul(ve,Ve)|0,C=C+Math.imul(ve,Ze)|0,S=S+Math.imul(ge,st)|0,x=x+Math.imul(ge,at)|0,x=x+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,S=S+Math.imul(te,ft)|0,x=x+Math.imul(te,rt)|0,x=x+Math.imul(ae,ft)|0,C=C+Math.imul(ae,rt)|0,S=S+Math.imul(q,ct)|0,x=x+Math.imul(q,ut)|0,x=x+Math.imul(z,ct)|0,C=C+Math.imul(z,ut)|0,S=S+Math.imul(D,lt)|0,x=x+Math.imul(D,Qe)|0,x=x+Math.imul(Q,lt)|0,C=C+Math.imul(Q,Qe)|0,S=S+Math.imul(_,ht)|0,x=x+Math.imul(_,dt)|0,x=x+Math.imul(k,ht)|0,C=C+Math.imul(k,dt)|0;var yn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(yn>>>26)|0,yn&=67108863,S=Math.imul(le,we),x=Math.imul(le,Ie),x=x+Math.imul(oe,we)|0,C=Math.imul(oe,Ie),S=S+Math.imul(Pe,Fe)|0,x=x+Math.imul(Pe,Ne)|0,x=x+Math.imul(Je,Fe)|0,C=C+Math.imul(Je,Ne)|0,S=S+Math.imul(pe,Ve)|0,x=x+Math.imul(pe,Ze)|0,x=x+Math.imul(ke,Ve)|0,C=C+Math.imul(ke,Ze)|0,S=S+Math.imul(ue,st)|0,x=x+Math.imul(ue,at)|0,x=x+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,S=S+Math.imul(ge,ft)|0,x=x+Math.imul(ge,rt)|0,x=x+Math.imul(ie,ft)|0,C=C+Math.imul(ie,rt)|0,S=S+Math.imul(te,ct)|0,x=x+Math.imul(te,ut)|0,x=x+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,S=S+Math.imul(q,lt)|0,x=x+Math.imul(q,Qe)|0,x=x+Math.imul(z,lt)|0,C=C+Math.imul(z,Qe)|0,S=S+Math.imul(D,ht)|0,x=x+Math.imul(D,dt)|0,x=x+Math.imul(Q,ht)|0,C=C+Math.imul(Q,dt)|0,S=S+Math.imul(_,pt)|0,x=x+Math.imul(_,mt)|0,x=x+Math.imul(k,pt)|0,C=C+Math.imul(k,mt)|0;var ci=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(ci>>>26)|0,ci&=67108863,S=Math.imul(X,we),x=Math.imul(X,Ie),x=x+Math.imul(me,we)|0,C=Math.imul(me,Ie),S=S+Math.imul(le,Fe)|0,x=x+Math.imul(le,Ne)|0,x=x+Math.imul(oe,Fe)|0,C=C+Math.imul(oe,Ne)|0,S=S+Math.imul(Pe,Ve)|0,x=x+Math.imul(Pe,Ze)|0,x=x+Math.imul(Je,Ve)|0,C=C+Math.imul(Je,Ze)|0,S=S+Math.imul(pe,st)|0,x=x+Math.imul(pe,at)|0,x=x+Math.imul(ke,st)|0,C=C+Math.imul(ke,at)|0,S=S+Math.imul(ue,ft)|0,x=x+Math.imul(ue,rt)|0,x=x+Math.imul(ve,ft)|0,C=C+Math.imul(ve,rt)|0,S=S+Math.imul(ge,ct)|0,x=x+Math.imul(ge,ut)|0,x=x+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,S=S+Math.imul(te,lt)|0,x=x+Math.imul(te,Qe)|0,x=x+Math.imul(ae,lt)|0,C=C+Math.imul(ae,Qe)|0,S=S+Math.imul(q,ht)|0,x=x+Math.imul(q,dt)|0,x=x+Math.imul(z,ht)|0,C=C+Math.imul(z,dt)|0,S=S+Math.imul(D,pt)|0,x=x+Math.imul(D,mt)|0,x=x+Math.imul(Q,pt)|0,C=C+Math.imul(Q,mt)|0,S=S+Math.imul(_,bt)|0,x=x+Math.imul(_,nt)|0,x=x+Math.imul(k,bt)|0,C=C+Math.imul(k,nt)|0;var Uo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,S=Math.imul(X,Fe),x=Math.imul(X,Ne),x=x+Math.imul(me,Fe)|0,C=Math.imul(me,Ne),S=S+Math.imul(le,Ve)|0,x=x+Math.imul(le,Ze)|0,x=x+Math.imul(oe,Ve)|0,C=C+Math.imul(oe,Ze)|0,S=S+Math.imul(Pe,st)|0,x=x+Math.imul(Pe,at)|0,x=x+Math.imul(Je,st)|0,C=C+Math.imul(Je,at)|0,S=S+Math.imul(pe,ft)|0,x=x+Math.imul(pe,rt)|0,x=x+Math.imul(ke,ft)|0,C=C+Math.imul(ke,rt)|0,S=S+Math.imul(ue,ct)|0,x=x+Math.imul(ue,ut)|0,x=x+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,S=S+Math.imul(ge,lt)|0,x=x+Math.imul(ge,Qe)|0,x=x+Math.imul(ie,lt)|0,C=C+Math.imul(ie,Qe)|0,S=S+Math.imul(te,ht)|0,x=x+Math.imul(te,dt)|0,x=x+Math.imul(ae,ht)|0,C=C+Math.imul(ae,dt)|0,S=S+Math.imul(q,pt)|0,x=x+Math.imul(q,mt)|0,x=x+Math.imul(z,pt)|0,C=C+Math.imul(z,mt)|0,S=S+Math.imul(D,bt)|0,x=x+Math.imul(D,nt)|0,x=x+Math.imul(Q,bt)|0,C=C+Math.imul(Q,nt)|0;var Fo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,S=Math.imul(X,Ve),x=Math.imul(X,Ze),x=x+Math.imul(me,Ve)|0,C=Math.imul(me,Ze),S=S+Math.imul(le,st)|0,x=x+Math.imul(le,at)|0,x=x+Math.imul(oe,st)|0,C=C+Math.imul(oe,at)|0,S=S+Math.imul(Pe,ft)|0,x=x+Math.imul(Pe,rt)|0,x=x+Math.imul(Je,ft)|0,C=C+Math.imul(Je,rt)|0,S=S+Math.imul(pe,ct)|0,x=x+Math.imul(pe,ut)|0,x=x+Math.imul(ke,ct)|0,C=C+Math.imul(ke,ut)|0,S=S+Math.imul(ue,lt)|0,x=x+Math.imul(ue,Qe)|0,x=x+Math.imul(ve,lt)|0,C=C+Math.imul(ve,Qe)|0,S=S+Math.imul(ge,ht)|0,x=x+Math.imul(ge,dt)|0,x=x+Math.imul(ie,ht)|0,C=C+Math.imul(ie,dt)|0,S=S+Math.imul(te,pt)|0,x=x+Math.imul(te,mt)|0,x=x+Math.imul(ae,pt)|0,C=C+Math.imul(ae,mt)|0,S=S+Math.imul(q,bt)|0,x=x+Math.imul(q,nt)|0,x=x+Math.imul(z,bt)|0,C=C+Math.imul(z,nt)|0;var $o=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+($o>>>26)|0,$o&=67108863,S=Math.imul(X,st),x=Math.imul(X,at),x=x+Math.imul(me,st)|0,C=Math.imul(me,at),S=S+Math.imul(le,ft)|0,x=x+Math.imul(le,rt)|0,x=x+Math.imul(oe,ft)|0,C=C+Math.imul(oe,rt)|0,S=S+Math.imul(Pe,ct)|0,x=x+Math.imul(Pe,ut)|0,x=x+Math.imul(Je,ct)|0,C=C+Math.imul(Je,ut)|0,S=S+Math.imul(pe,lt)|0,x=x+Math.imul(pe,Qe)|0,x=x+Math.imul(ke,lt)|0,C=C+Math.imul(ke,Qe)|0,S=S+Math.imul(ue,ht)|0,x=x+Math.imul(ue,dt)|0,x=x+Math.imul(ve,ht)|0,C=C+Math.imul(ve,dt)|0,S=S+Math.imul(ge,pt)|0,x=x+Math.imul(ge,mt)|0,x=x+Math.imul(ie,pt)|0,C=C+Math.imul(ie,mt)|0,S=S+Math.imul(te,bt)|0,x=x+Math.imul(te,nt)|0,x=x+Math.imul(ae,bt)|0,C=C+Math.imul(ae,nt)|0;var fo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(fo>>>26)|0,fo&=67108863,S=Math.imul(X,ft),x=Math.imul(X,rt),x=x+Math.imul(me,ft)|0,C=Math.imul(me,rt),S=S+Math.imul(le,ct)|0,x=x+Math.imul(le,ut)|0,x=x+Math.imul(oe,ct)|0,C=C+Math.imul(oe,ut)|0,S=S+Math.imul(Pe,lt)|0,x=x+Math.imul(Pe,Qe)|0,x=x+Math.imul(Je,lt)|0,C=C+Math.imul(Je,Qe)|0,S=S+Math.imul(pe,ht)|0,x=x+Math.imul(pe,dt)|0,x=x+Math.imul(ke,ht)|0,C=C+Math.imul(ke,dt)|0,S=S+Math.imul(ue,pt)|0,x=x+Math.imul(ue,mt)|0,x=x+Math.imul(ve,pt)|0,C=C+Math.imul(ve,mt)|0,S=S+Math.imul(ge,bt)|0,x=x+Math.imul(ge,nt)|0,x=x+Math.imul(ie,bt)|0,C=C+Math.imul(ie,nt)|0;var co=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(co>>>26)|0,co&=67108863,S=Math.imul(X,ct),x=Math.imul(X,ut),x=x+Math.imul(me,ct)|0,C=Math.imul(me,ut),S=S+Math.imul(le,lt)|0,x=x+Math.imul(le,Qe)|0,x=x+Math.imul(oe,lt)|0,C=C+Math.imul(oe,Qe)|0,S=S+Math.imul(Pe,ht)|0,x=x+Math.imul(Pe,dt)|0,x=x+Math.imul(Je,ht)|0,C=C+Math.imul(Je,dt)|0,S=S+Math.imul(pe,pt)|0,x=x+Math.imul(pe,mt)|0,x=x+Math.imul(ke,pt)|0,C=C+Math.imul(ke,mt)|0,S=S+Math.imul(ue,bt)|0,x=x+Math.imul(ue,nt)|0,x=x+Math.imul(ve,bt)|0,C=C+Math.imul(ve,nt)|0;var uo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(uo>>>26)|0,uo&=67108863,S=Math.imul(X,lt),x=Math.imul(X,Qe),x=x+Math.imul(me,lt)|0,C=Math.imul(me,Qe),S=S+Math.imul(le,ht)|0,x=x+Math.imul(le,dt)|0,x=x+Math.imul(oe,ht)|0,C=C+Math.imul(oe,dt)|0,S=S+Math.imul(Pe,pt)|0,x=x+Math.imul(Pe,mt)|0,x=x+Math.imul(Je,pt)|0,C=C+Math.imul(Je,mt)|0,S=S+Math.imul(pe,bt)|0,x=x+Math.imul(pe,nt)|0,x=x+Math.imul(ke,bt)|0,C=C+Math.imul(ke,nt)|0;var qo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(qo>>>26)|0,qo&=67108863,S=Math.imul(X,ht),x=Math.imul(X,dt),x=x+Math.imul(me,ht)|0,C=Math.imul(me,dt),S=S+Math.imul(le,pt)|0,x=x+Math.imul(le,mt)|0,x=x+Math.imul(oe,pt)|0,C=C+Math.imul(oe,mt)|0,S=S+Math.imul(Pe,bt)|0,x=x+Math.imul(Pe,nt)|0,x=x+Math.imul(Je,bt)|0,C=C+Math.imul(Je,nt)|0;var jo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(jo>>>26)|0,jo&=67108863,S=Math.imul(X,pt),x=Math.imul(X,mt),x=x+Math.imul(me,pt)|0,C=Math.imul(me,mt),S=S+Math.imul(le,bt)|0,x=x+Math.imul(le,nt)|0,x=x+Math.imul(oe,bt)|0,C=C+Math.imul(oe,nt)|0;var Ho=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,S=Math.imul(X,bt),x=Math.imul(X,nt),x=x+Math.imul(me,bt)|0,C=Math.imul(me,nt);var zo=(M+S|0)+((x&8191)<<13)|0;return M=(C+(x>>>13)|0)+(zo>>>26)|0,zo&=67108863,E[0]=Bn,E[1]=jt,E[2]=Ht,E[3]=bn,E[4]=gn,E[5]=vn,E[6]=Fr,E[7]=yn,E[8]=ci,E[9]=Uo,E[10]=Fo,E[11]=$o,E[12]=fo,E[13]=co,E[14]=uo,E[15]=qo,E[16]=jo,E[17]=Ho,E[18]=zo,M!==0&&(E[19]=M,g.length++),g},"comb10MulTo");Math.imul||(I=R);function B(L,h,v){v.negative=h.negative^L.negative,v.length=L.length+h.length;for(var g=0,l=0,b=0;b<v.length-1;b++){var E=l;l=0;for(var M=g&67108863,S=Math.min(b,h.length-1),x=Math.max(0,b-L.length+1);x<=S;x++){var C=b-x,N=L.words[C]|0,_=h.words[x]|0,k=N*_,fe=k&67108863;E=E+(k/67108864|0)|0,fe=fe+M|0,M=fe&67108863,E=E+(fe>>>26)|0,l+=E>>>26,E&=67108863}v.words[b]=M,g=E,E=l}return g!==0?v.words[b]=g:v.length--,v.strip()}o(B,"bigMulTo");function Y(L,h,v){var g=new P;return g.mulp(L,h,v)}o(Y,"jumboMulTo"),i.prototype.mulTo=o(function(h,v){var g,l=this.length+h.length;return this.length===10&&h.length===10?g=I(this,h,v):l<63?g=R(this,h,v):l<1024?g=B(this,h,v):g=Y(this,h,v),g},"mulTo");function P(L,h){this.x=L,this.y=h}o(P,"FFTM"),P.prototype.makeRBT=o(function(h){for(var v=new Array(h),g=i.prototype._countBits(h)-1,l=0;l<h;l++)v[l]=this.revBin(l,g,h);return v},"makeRBT"),P.prototype.revBin=o(function(h,v,g){if(h===0||h===g-1)return h;for(var l=0,b=0;b<v;b++)l|=(h&1)<<v-b-1,h>>=1;return l},"revBin"),P.prototype.permute=o(function(h,v,g,l,b,E){for(var M=0;M<E;M++)l[M]=v[h[M]],b[M]=g[h[M]]},"permute"),P.prototype.transform=o(function(h,v,g,l,b,E){this.permute(E,h,v,g,l,b);for(var M=1;M<b;M<<=1)for(var S=M<<1,x=Math.cos(2*Math.PI/S),C=Math.sin(2*Math.PI/S),N=0;N<b;N+=S)for(var _=x,k=C,fe=0;fe<M;fe++){var D=g[N+fe],Q=l[N+fe],se=g[N+fe+M],q=l[N+fe+M],z=_*se-k*q;q=_*q+k*se,se=z,g[N+fe]=D+se,l[N+fe]=Q+q,g[N+fe+M]=D-se,l[N+fe+M]=Q-q,fe!==S&&(z=x*_-C*k,k=x*k+C*_,_=z)}},"transform"),P.prototype.guessLen13b=o(function(h,v){var g=Math.max(v,h)|1,l=g&1,b=0;for(g=g/2|0;g;g=g>>>1)b++;return 1<<b+1+l},"guessLen13b"),P.prototype.conjugate=o(function(h,v,g){if(!(g<=1))for(var l=0;l<g/2;l++){var b=h[l];h[l]=h[g-l-1],h[g-l-1]=b,b=v[l],v[l]=-v[g-l-1],v[g-l-1]=-b}},"conjugate"),P.prototype.normalize13b=o(function(h,v){for(var g=0,l=0;l<v/2;l++){var b=Math.round(h[2*l+1]/v)*8192+Math.round(h[2*l]/v)+g;h[l]=b&67108863,b<67108864?g=0:g=b/67108864|0}return h},"normalize13b"),P.prototype.convert13b=o(function(h,v,g,l){for(var b=0,E=0;E<v;E++)b=b+(h[E]|0),g[2*E]=b&8191,b=b>>>13,g[2*E+1]=b&8191,b=b>>>13;for(E=2*v;E<l;++E)g[E]=0;t(b===0),t((b&-8192)===0)},"convert13b"),P.prototype.stub=o(function(h){for(var v=new Array(h),g=0;g<h;g++)v[g]=0;return v},"stub"),P.prototype.mulp=o(function(h,v,g){var l=2*this.guessLen13b(h.length,v.length),b=this.makeRBT(l),E=this.stub(l),M=new Array(l),S=new Array(l),x=new Array(l),C=new Array(l),N=new Array(l),_=new Array(l),k=g.words;k.length=l,this.convert13b(h.words,h.length,M,l),this.convert13b(v.words,v.length,C,l),this.transform(M,E,S,x,l,b),this.transform(C,E,N,_,l,b);for(var fe=0;fe<l;fe++){var D=S[fe]*N[fe]-x[fe]*_[fe];x[fe]=S[fe]*_[fe]+x[fe]*N[fe],S[fe]=D}return this.conjugate(S,x,l),this.transform(S,x,k,E,l,b),this.conjugate(k,E,l),this.normalize13b(k,l),g.negative=h.negative^v.negative,g.length=h.length+v.length,g.strip()},"mulp"),i.prototype.mul=o(function(h){var v=new i(null);return v.words=new Array(this.length+h.length),this.mulTo(h,v)},"mul"),i.prototype.mulf=o(function(h){var v=new i(null);return v.words=new Array(this.length+h.length),Y(this,h,v)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){t(typeof h=="number"),t(h<67108864);for(var v=0,g=0;g<this.length;g++){var l=(this.words[g]|0)*h,b=(l&67108863)+(v&67108863);v>>=26,v+=l/67108864|0,v+=b>>>26,this.words[g]=b&67108863}return v!==0&&(this.words[g]=v,this.length++),this},"imuln"),i.prototype.muln=o(function(h){return this.clone().imuln(h)},"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(h){var v=O(h);if(v.length===0)return new i(1);for(var g=this,l=0;l<v.length&&v[l]===0;l++,g=g.sqr());if(++l<v.length)for(var b=g.sqr();l<v.length;l++,b=b.sqr())v[l]!==0&&(g=g.mul(b));return g},"pow"),i.prototype.iushln=o(function(h){t(typeof h=="number"&&h>=0);var v=h%26,g=(h-v)/26,l=67108863>>>26-v<<26-v,b;if(v!==0){var E=0;for(b=0;b<this.length;b++){var M=this.words[b]&l,S=(this.words[b]|0)-M<<v;this.words[b]=S|E,E=M>>>26-v}E&&(this.words[b]=E,this.length++)}if(g!==0){for(b=this.length-1;b>=0;b--)this.words[b+g]=this.words[b];for(b=0;b<g;b++)this.words[b]=0;this.length+=g}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return t(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,v,g){t(typeof h=="number"&&h>=0);var l;v?l=(v-v%26)/26:l=0;var b=h%26,E=Math.min((h-b)/26,this.length),M=67108863^67108863>>>b<<b,S=g;if(l-=E,l=Math.max(0,l),S){for(var x=0;x<E;x++)S.words[x]=this.words[x];S.length=E}if(E!==0)if(this.length>E)for(this.length-=E,x=0;x<this.length;x++)this.words[x]=this.words[x+E];else this.words[0]=0,this.length=1;var C=0;for(x=this.length-1;x>=0&&(C!==0||x>=l);x--){var N=this.words[x]|0;this.words[x]=C<<26-b|N>>>b,C=N&M}return S&&C!==0&&(S.words[S.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,v,g){return t(this.negative===0),this.iushrn(h,v,g)},"ishrn"),i.prototype.shln=o(function(h){return this.clone().ishln(h)},"shln"),i.prototype.ushln=o(function(h){return this.clone().iushln(h)},"ushln"),i.prototype.shrn=o(function(h){return this.clone().ishrn(h)},"shrn"),i.prototype.ushrn=o(function(h){return this.clone().iushrn(h)},"ushrn"),i.prototype.testn=o(function(h){t(typeof h=="number"&&h>=0);var v=h%26,g=(h-v)/26,l=1<<v;if(this.length<=g)return!1;var b=this.words[g];return!!(b&l)},"testn"),i.prototype.imaskn=o(function(h){t(typeof h=="number"&&h>=0);var v=h%26,g=(h-v)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(v!==0&&g++,this.length=Math.min(g,this.length),v!==0){var l=67108863^67108863>>>v<<v;this.words[this.length-1]&=l}return this.strip()},"imaskn"),i.prototype.maskn=o(function(h){return this.clone().imaskn(h)},"maskn"),i.prototype.iaddn=o(function(h){return t(typeof h=="number"),t(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},"iaddn"),i.prototype._iaddn=o(function(h){this.words[0]+=h;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(h){if(t(typeof h=="number"),t(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var 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(h){return this.clone().iaddn(h)},"addn"),i.prototype.subn=o(function(h){return this.clone().isubn(h)},"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(h,v,g){var l=h.length+g,b;this._expand(l);var E,M=0;for(b=0;b<h.length;b++){E=(this.words[b+g]|0)+M;var S=(h.words[b]|0)*v;E-=S&67108863,M=(E>>26)-(S/67108864|0),this.words[b+g]=E&67108863}for(;b<this.length-g;b++)E=(this.words[b+g]|0)+M,M=E>>26,this.words[b+g]=E&67108863;if(M===0)return this.strip();for(t(M===-1),M=0,b=0;b<this.length;b++)E=-(this.words[b]|0)+M,M=E>>26,this.words[b]=E&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,v){var g=this.length-h.length,l=this.clone(),b=h,E=b.words[b.length-1]|0,M=this._countBits(E);g=26-M,g!==0&&(b=b.ushln(g),l.iushln(g),E=b.words[b.length-1]|0);var S=l.length-b.length,x;if(v!=="mod"){x=new i(null),x.length=S+1,x.words=new Array(x.length);for(var C=0;C<x.length;C++)x.words[C]=0}var N=l.clone()._ishlnsubmul(b,1,S);N.negative===0&&(l=N,x&&(x.words[S]=1));for(var _=S-1;_>=0;_--){var k=(l.words[b.length+_]|0)*67108864+(l.words[b.length+_-1]|0);for(k=Math.min(k/E|0,67108863),l._ishlnsubmul(b,k,_);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(b,1,_),l.isZero()||(l.negative^=1);x&&(x.words[_]=k)}return x&&x.strip(),l.strip(),v!=="div"&&g!==0&&l.iushrn(g),{div:x||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,v,g){if(t(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,b,E;return this.negative!==0&&h.negative===0?(E=this.neg().divmod(h,v),v!=="mod"&&(l=E.div.neg()),v!=="div"&&(b=E.mod.neg(),g&&b.negative!==0&&b.iadd(h)),{div:l,mod:b}):this.negative===0&&h.negative!==0?(E=this.divmod(h.neg(),v),v!=="mod"&&(l=E.div.neg()),{div:l,mod:E.mod}):(this.negative&h.negative)!==0?(E=this.neg().divmod(h.neg(),v),v!=="div"&&(b=E.mod.neg(),g&&b.negative!==0&&b.isub(h)),{div:E.div,mod:b}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?v==="div"?{div:this.divn(h.words[0]),mod:null}:v==="mod"?{div:null,mod:new i(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modn(h.words[0]))}:this._wordDiv(h,v)},"divmod"),i.prototype.div=o(function(h){return this.divmod(h,"div",!1).div},"div"),i.prototype.mod=o(function(h){return this.divmod(h,"mod",!1).mod},"mod"),i.prototype.umod=o(function(h){return this.divmod(h,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(h){var v=this.divmod(h);if(v.mod.isZero())return v.div;var g=v.div.negative!==0?v.mod.isub(h):v.mod,l=h.ushrn(1),b=h.andln(1),E=g.cmp(l);return E<0||b===1&&E===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){t(h<=67108863);for(var v=(1<<26)%h,g=0,l=this.length-1;l>=0;l--)g=(v*g+(this.words[l]|0))%h;return g},"modn"),i.prototype.idivn=o(function(h){t(h<=67108863);for(var v=0,g=this.length-1;g>=0;g--){var l=(this.words[g]|0)+v*67108864;this.words[g]=l/h|0,v=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){t(h.negative===0),t(!h.isZero());var v=this,g=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var l=new i(1),b=new i(0),E=new i(0),M=new i(1),S=0;v.isEven()&&g.isEven();)v.iushrn(1),g.iushrn(1),++S;for(var x=g.clone(),C=v.clone();!v.isZero();){for(var N=0,_=1;(v.words[0]&_)===0&&N<26;++N,_<<=1);if(N>0)for(v.iushrn(N);N-- >0;)(l.isOdd()||b.isOdd())&&(l.iadd(x),b.isub(C)),l.iushrn(1),b.iushrn(1);for(var k=0,fe=1;(g.words[0]&fe)===0&&k<26;++k,fe<<=1);if(k>0)for(g.iushrn(k);k-- >0;)(E.isOdd()||M.isOdd())&&(E.iadd(x),M.isub(C)),E.iushrn(1),M.iushrn(1);v.cmp(g)>=0?(v.isub(g),l.isub(E),b.isub(M)):(g.isub(v),E.isub(l),M.isub(b))}return{a:E,b:M,gcd:g.iushln(S)}},"egcd"),i.prototype._invmp=o(function(h){t(h.negative===0),t(!h.isZero());var v=this,g=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var l=new i(1),b=new i(0),E=g.clone();v.cmpn(1)>0&&g.cmpn(1)>0;){for(var M=0,S=1;(v.words[0]&S)===0&&M<26;++M,S<<=1);if(M>0)for(v.iushrn(M);M-- >0;)l.isOdd()&&l.iadd(E),l.iushrn(1);for(var x=0,C=1;(g.words[0]&C)===0&&x<26;++x,C<<=1);if(x>0)for(g.iushrn(x);x-- >0;)b.isOdd()&&b.iadd(E),b.iushrn(1);v.cmp(g)>=0?(v.isub(g),l.isub(b)):(g.isub(v),b.isub(l))}var N;return v.cmpn(1)===0?N=l:N=b,N.cmpn(0)<0&&N.iadd(h),N},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var v=this.clone(),g=h.clone();v.negative=0,g.negative=0;for(var l=0;v.isEven()&&g.isEven();l++)v.iushrn(1),g.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;g.isEven();)g.iushrn(1);var b=v.cmp(g);if(b<0){var E=v;v=g,g=E}else if(b===0||g.cmpn(1)===0)break;v.isub(g)}while(!0);return g.iushln(l)},"gcd"),i.prototype.invm=o(function(h){return this.egcd(h).a.umod(h)},"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(h){return this.words[0]&h},"andln"),i.prototype.bincn=o(function(h){t(typeof h=="number");var v=h%26,g=(h-v)/26,l=1<<v;if(this.length<=g)return this._expand(g+1),this.words[g]|=l,this;for(var b=l,E=g;b!==0&&E<this.length;E++){var M=this.words[E]|0;M+=b,b=M>>>26,M&=67108863,this.words[E]=M}return b!==0&&(this.words[E]=b,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(h){var v=h<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var g;if(this.length>1)g=1;else{v&&(h=-h),t(h<=67108863,"Number is too big");var l=this.words[0]|0;g=l===h?0:l<h?-1:1}return this.negative!==0?-g|0:g},"cmpn"),i.prototype.cmp=o(function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var v=this.ucmp(h);return this.negative!==0?-v|0:v},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var v=0,g=this.length-1;g>=0;g--){var l=this.words[g]|0,b=h.words[g]|0;if(l!==b){l<b?v=-1:l>b&&(v=1);break}}return v},"ucmp"),i.prototype.gtn=o(function(h){return this.cmpn(h)===1},"gtn"),i.prototype.gt=o(function(h){return this.cmp(h)===1},"gt"),i.prototype.gten=o(function(h){return this.cmpn(h)>=0},"gten"),i.prototype.gte=o(function(h){return this.cmp(h)>=0},"gte"),i.prototype.ltn=o(function(h){return this.cmpn(h)===-1},"ltn"),i.prototype.lt=o(function(h){return this.cmp(h)===-1},"lt"),i.prototype.lten=o(function(h){return this.cmpn(h)<=0},"lten"),i.prototype.lte=o(function(h){return this.cmp(h)<=0},"lte"),i.prototype.eqn=o(function(h){return this.cmpn(h)===0},"eqn"),i.prototype.eq=o(function(h){return this.cmp(h)===0},"eq"),i.red=o(function(h){return new H(h)},"red"),i.prototype.toRed=o(function(h){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"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(h){return this.red=h,this},"_forceRed"),i.prototype.forceRed=o(function(h){return t(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},"redMul"),i.prototype.redIMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},"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(h){return t(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var J={k256:null,p224:null,p192:null,p25519:null};function ee(L,h){this.name=L,this.p=new i(h,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(ee,"MPrime"),ee.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),ee.prototype.ireduce=o(function(h){var v=h,g;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),g=v.bitLength();while(g>this.n);var l=g<this.n?-1:v.ucmp(this.p);return l===0?(v.words[0]=0,v.length=1):l>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},"ireduce"),ee.prototype.split=o(function(h,v){h.iushrn(this.n,0,v)},"split"),ee.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Z(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Z,"K256"),n(Z,ee),Z.prototype.split=o(function(h,v){for(var g=4194303,l=Math.min(h.length,9),b=0;b<l;b++)v.words[b]=h.words[b];if(v.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var E=h.words[9];for(v.words[v.length++]=E&g,b=10;b<h.length;b++){var M=h.words[b]|0;h.words[b-10]=(M&g)<<4|E>>>22,E=M}E>>>=22,h.words[b-10]=E,E===0&&h.length>10?h.length-=10:h.length-=9},"split"),Z.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var v=0,g=0;g<h.length;g++){var l=h.words[g]|0;v+=l*977,h.words[g]=v&67108863,v=l*64+(v/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function ne(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ne,"P224"),n(ne,ee);function V(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(V,"P192"),n(V,ee);function j(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(j,"P25519"),n(j,ee),j.prototype.imulK=o(function(h){for(var v=0,g=0;g<h.length;g++){var l=(h.words[g]|0)*19+v,b=l&67108863;l>>>=26,h.words[g]=b,v=l}return v!==0&&(h.words[h.length++]=v),h},"imulK"),i._prime=o(function(h){if(J[h])return J[h];var v;if(h==="k256")v=new Z;else if(h==="p224")v=new ne;else if(h==="p192")v=new V;else if(h==="p25519")v=new j;else throw new Error("Unknown prime "+h);return J[h]=v,v},"prime");function H(L){if(typeof L=="string"){var h=i._prime(L);this.m=h.p,this.prime=h}else t(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}o(H,"Red"),H.prototype._verify1=o(function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},"_verify1"),H.prototype._verify2=o(function(h,v){t((h.negative|v.negative)===0,"red works only with positives"),t(h.red&&h.red===v.red,"red works only with red numbers")},"_verify2"),H.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),H.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),H.prototype.add=o(function(h,v){this._verify2(h,v);var g=h.add(v);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},"add"),H.prototype.iadd=o(function(h,v){this._verify2(h,v);var g=h.iadd(v);return g.cmp(this.m)>=0&&g.isub(this.m),g},"iadd"),H.prototype.sub=o(function(h,v){this._verify2(h,v);var g=h.sub(v);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},"sub"),H.prototype.isub=o(function(h,v){this._verify2(h,v);var g=h.isub(v);return g.cmpn(0)<0&&g.iadd(this.m),g},"isub"),H.prototype.shl=o(function(h,v){return this._verify1(h),this.imod(h.ushln(v))},"shl"),H.prototype.imul=o(function(h,v){return this._verify2(h,v),this.imod(h.imul(v))},"imul"),H.prototype.mul=o(function(h,v){return this._verify2(h,v),this.imod(h.mul(v))},"mul"),H.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),H.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),H.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var v=this.m.andln(3);if(t(v%2===1),v===3){var g=this.m.add(new i(1)).iushrn(2);return this.pow(h,g)}for(var l=this.m.subn(1),b=0;!l.isZero()&&l.andln(1)===0;)b++,l.iushrn(1);t(!l.isZero());var E=new i(1).toRed(this),M=E.redNeg(),S=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new i(2*x*x).toRed(this);this.pow(x,S).cmp(M)!==0;)x.redIAdd(M);for(var C=this.pow(x,l),N=this.pow(h,l.addn(1).iushrn(1)),_=this.pow(h,l),k=b;_.cmp(E)!==0;){for(var fe=_,D=0;fe.cmp(E)!==0;D++)fe=fe.redSqr();t(D<k);var Q=this.pow(C,new i(1).iushln(k-D-1));N=N.redMul(Q),C=Q.redSqr(),_=_.redMul(C),k=D}return N},"sqrt"),H.prototype.invm=o(function(h){var v=h._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},"invm"),H.prototype.pow=o(function(h,v){if(v.isZero())return new i(1).toRed(this);if(v.cmpn(1)===0)return h.clone();var g=4,l=new Array(1<<g);l[0]=new i(1).toRed(this),l[1]=h;for(var b=2;b<l.length;b++)l[b]=this.mul(l[b-1],h);var E=l[0],M=0,S=0,x=v.bitLength()%26;for(x===0&&(x=26),b=v.length-1;b>=0;b--){for(var C=v.words[b],N=x-1;N>=0;N--){var _=C>>N&1;if(E!==l[0]&&(E=this.sqr(E)),_===0&&M===0){S=0;continue}M<<=1,M|=_,S++,!(S!==g&&(b!==0||N!==0))&&(E=this.mul(E,l[M]),S=0,M=0)}x=26}return E},"pow"),H.prototype.convertTo=o(function(h){var v=h.umod(this.m);return v===h?v.clone():v},"convertTo"),H.prototype.convertFrom=o(function(h){var v=h.clone();return v.red=null,v},"convertFrom"),i.mont=o(function(h){return new he(h)},"mont");function he(L){H.call(this,L),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(he,"Mont"),n(he,H),he.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),he.prototype.convertFrom=o(function(h){var v=this.imod(h.mul(this.rinv));return v.red=null,v},"convertFrom"),he.prototype.imul=o(function(h,v){if(h.isZero()||v.isZero())return h.words[0]=0,h.length=1,h;var g=h.imul(v),l=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=g.isub(l).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},"imul"),he.prototype.mul=o(function(h,v){if(h.isZero()||v.isZero())return new i(0)._forceRed(this);var g=h.mul(v),l=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=g.isub(l).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},"mul"),he.prototype.invm=o(function(h){var v=this.imod(h._invmp(this.m).mul(this.r2));return v._forceRed(this)},"invm")})(typeof _1>"u"||_1,fx)});var qs=Re((JV,ux)=>{ux.exports=cx;function cx(r,e){if(!r)throw new Error(e||"Assertion failed")}o(cx,"assert");cx.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var E1=Re(dx=>{"use strict";var md=dx;function mO(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,f=i&255;s?t.push(s,f):t.push(f)}return t}o(mO,"toArray");md.toArray=mO;function lx(r){return r.length===1?"0"+r:r}o(lx,"zero2");md.zero2=lx;function hx(r){for(var e="",t=0;t<r.length;t++)e+=lx(r[t].toString(16));return e}o(hx,"toHex");md.toHex=hx;md.encode=o(function(e,t){return t==="hex"?hx(e):e},"encode")});var zn=Re(px=>{"use strict";var Hi=px,bO=mo(),gO=qs(),bd=E1();Hi.assert=gO;Hi.toArray=bd.toArray;Hi.zero2=bd.zero2;Hi.toHex=bd.toHex;Hi.encode=bd.encode;function vO(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1),i;for(i=0;i<n.length;i+=1)n[i]=0;var s=1<<e+1,f=r.clone();for(i=0;i<n.length;i++){var u,d=f.andln(s-1);f.isOdd()?(d>(s>>1)-1?u=(s>>1)-d:u=d,f.isubn(u)):u=0,n[i]=u,f.iushrn(1)}return n}o(vO,"getNAF");Hi.getNAF=vO;function yO(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 f=r.andln(3)+n&3,u=e.andln(3)+i&3;f===3&&(f=-1),u===3&&(u=-1);var d;(f&1)===0?d=0:(s=r.andln(7)+n&7,(s===3||s===5)&&u===2?d=-f:d=f),t[0].push(d);var y;(u&1)===0?y=0:(s=e.andln(7)+i&7,(s===3||s===5)&&f===2?y=-u:y=u),t[1].push(y),2*n===d+1&&(n=1-n),2*i===y+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(yO,"getJSF");Hi.getJSF=yO;function xO(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(xO,"cachedProperty");Hi.cachedProperty=xO;function wO(r){return typeof r=="string"?Hi.toArray(r,"hex"):r}o(wO,"parseBytes");Hi.parseBytes=wO;function _O(r){return new bO(r,"hex","le")}o(_O,"intFromLE");Hi.intFromLE=_O});var T1=Re((XV,M1)=>{var A1;M1.exports=o(function(e){return A1||(A1=new js(null)),A1.generate(e)},"rand");function js(r){this.rand=r}o(js,"Rand");M1.exports.Rand=js;js.prototype.generate=o(function(e){return this._rand(e)},"generate");js.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?js.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?js.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(js.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(S1=require("crypto"),typeof S1.randomBytes!="function")throw new Error("Not supported");js.prototype._rand=o(function(e){return S1.randomBytes(e)},"_rand")}catch{}var S1});var ju=Re((QV,mx)=>{"use strict";var qa=mo(),qu=zn(),gd=qu.getNAF,EO=qu.getJSF,vd=qu.assert;function Hs(r,e){this.type=r,this.p=new qa(e.p,16),this.red=e.prime?qa.red(e.prime):qa.mont(this.p),this.zero=new qa(0).toRed(this.red),this.one=new qa(1).toRed(this.red),this.two=new qa(2).toRed(this.red),this.n=e.n&&new qa(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(Hs,"BaseCurve");mx.exports=Hs;Hs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Hs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Hs.prototype._fixedNafMul=o(function(e,t){vd(e.precomputed);var n=e._getDoubles(),i=gd(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var y=u+n.step-1;y>=u;y--)d=(d<<1)+i[y];f.push(d)}for(var w=this.jpoint(null,null,null),A=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?A=A.mixedAdd(n.points[u]):d===-O&&(A=A.mixedAdd(n.points[u].neg()));w=w.add(A)}return w.toP()},"_fixedNafMul");Hs.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=gd(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var y=0;d>=0&&f[d]===0;d--)y++;if(d>=0&&y++,u=u.dblp(y),d<0)break;var w=f[d];vd(w!==0),e.type==="affine"?w>0?u=u.mixedAdd(s[w-1>>1]):u=u.mixedAdd(s[-w-1>>1].neg()):w>0?u=u.add(s[w-1>>1]):u=u.add(s[-w-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Hs.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,y=0,w,A,O;for(w=0;w<i;w++){O=t[w];var R=O._getNAFPoints(e);f[w]=R.wnd,u[w]=R.points}for(w=i-1;w>=1;w-=2){var I=w-1,B=w;if(f[I]!==1||f[B]!==1){d[I]=gd(n[I],f[I],this._bitLength),d[B]=gd(n[B],f[B],this._bitLength),y=Math.max(d[I].length,y),y=Math.max(d[B].length,y);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=EO(n[I],n[B]);for(y=Math.max(J[0].length,y),d[I]=new Array(y),d[B]=new Array(y),A=0;A<y;A++){var ee=J[0][A]|0,Z=J[1][A]|0;d[I][A]=P[(ee+1)*3+(Z+1)],d[B][A]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(w=y;w>=0;w--){for(var j=0;w>=0;){var H=!0;for(A=0;A<i;A++)V[A]=d[A][w]|0,V[A]!==0&&(H=!1);if(!H)break;j++,w--}if(w>=0&&j++,ne=ne.dblp(j),w<0)break;for(A=0;A<i;A++){var he=V[A];he!==0&&(he>0?O=u[A][he-1>>1]:he<0&&(O=u[A][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(w=0;w<i;w++)u[w]=null;return s?ne:ne.toP()},"_wnafMulAdd");function wi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(wi,"BasePoint");Hs.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Hs.prototype.decodePoint=o(function(e,t){e=qu.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?vd(e[e.length-1]%2===0):e[0]===7&&vd(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");wi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");wi.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");wi.prototype.encode=o(function(e,t){return qu.encode(this._encode(t),e)},"encode");wi.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");wi.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");wi.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");wi.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");wi.prototype._getBeta=o(function(){return null},"_getBeta");wi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var Hu=Re((eG,C1)=>{typeof Object.create=="function"?C1.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"):C1.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 gx=Re((tG,bx)=>{"use strict";var AO=zn(),dr=mo(),k1=Hu(),oc=ju(),SO=AO.assert;function _i(r){oc.call(this,"short",r),this.a=new dr(r.a,16).toRed(this.red),this.b=new dr(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(_i,"ShortCurve");k1(_i,oc);bx.exports=_i;_i.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 dr(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 dr(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],SO(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new dr(u.a,16),b:new dr(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");_i.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:dr.mont(e),n=new dr(2).toRed(t).redInvm(),i=n.redNeg(),s=new dr(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");_i.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 dr(1),f=new dr(0),u=new dr(0),d=new dr(1),y,w,A,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Z=d.sub(ee.mul(f));if(!A&&P.cmp(t)<0)y=B.neg(),w=s,A=P.neg(),O=J;else if(A&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=Z}R=P.neg(),I=J;var ne=A.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=y,I=w),A.negative&&(A=A.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:A,b:O},{a:R,b:I}]},"_getEndoBasis");_i.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),y=s.mul(n.b),w=f.mul(i.b),A=e.sub(u).sub(d),O=y.add(w).neg();return{k1:A,k2:O}},"_endoSplit");_i.prototype.pointFromX=o(function(e,t){e=new dr(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");_i.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");_i.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],y=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),y=y.neg(!0)),i[f*2]=d,i[f*2+1]=y,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var w=this._wnafMulAdd(1,i,s,f*2,n),A=0;A<f*2;A++)i[A]=null,s[A]=null;return w},"_endoWnafMulAdd");function Ir(r,e,t,n){oc.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new dr(e,16),this.y=new dr(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(Ir,"Point");k1(Ir,oc.BasePoint);_i.prototype.point=o(function(e,t,n){return new Ir(this,e,t,n)},"point");_i.prototype.pointFromJSON=o(function(e,t){return Ir.fromJSON(this,e,t)},"pointFromJSON");Ir.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");Ir.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");Ir.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Ir.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");Ir.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Ir.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");Ir.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Ir.prototype.getX=o(function(){return this.x.fromRed()},"getX");Ir.prototype.getY=o(function(){return this.y.fromRed()},"getY");Ir.prototype.mul=o(function(e){return e=new dr(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");Ir.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");Ir.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");Ir.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");Ir.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");Ir.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 qr(r,e,t,n){oc.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new dr(0)):(this.x=new dr(e,16),this.y=new dr(t,16),this.z=new dr(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(qr,"JPoint");k1(qr,oc.BasePoint);_i.prototype.jpoint=o(function(e,t,n){return new qr(this,e,t,n)},"jpoint");qr.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");qr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");qr.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),y=f.redSub(u);if(d.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=d.redSqr(),A=w.redMul(d),O=i.redMul(w),R=y.redSqr().redIAdd(A).redISub(O).redISub(O),I=y.redMul(O.redISub(R)).redISub(f.redMul(A)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");qr.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=u.redSqr(),w=y.redMul(u),A=n.redMul(y),O=d.redSqr().redIAdd(w).redISub(A).redISub(A),R=d.redMul(A.redISub(O)).redISub(s.redMul(w)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");qr.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,f=this.x,u=this.y,d=this.z,y=d.redSqr().redSqr(),w=u.redAdd(u);for(t=0;t<e;t++){var A=f.redSqr(),O=w.redSqr(),R=O.redSqr(),I=A.redAdd(A).redIAdd(A).redIAdd(i.redMul(y)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=w.redMul(d);t+1<e&&(y=y.redMul(R)),f=Y,d=ee,w=J}return this.curve.jpoint(f,w.redMul(s),d)},"dblp");qr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");qr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),y=d.redSqr().redISub(u).redISub(u),w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),e=y,t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(A).redISub(R);I=I.redIAdd(I);var B=A.redAdd(A).redIAdd(A),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");qr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),y=d.redSqr().redISub(u).redISub(u);e=y;var w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(A).redMul(this.x.redAdd(A));I=I.redAdd(I).redIAdd(I);var B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(A);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");qr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),y=t.redAdd(t);y=y.redIAdd(y);var w=y.redMul(u),A=d.redSqr().redISub(w.redAdd(w)),O=w.redISub(A),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(A,I,B)},"_dbl");qr.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),y=i.redIAdd(i);y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var w=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(y),A=t.redMul(w);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.x.redMul(d).redISub(A);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(w.redMul(y.redISub(w)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");qr.prototype.mul=o(function(e,t){return e=new dr(e,t),this.curve._wnafMul(this,e)},"mul");qr.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");qr.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");qr.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");qr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var xx=Re((rG,yx)=>{"use strict";var sc=mo(),vx=Hu(),yd=ju(),MO=zn();function ac(r){yd.call(this,"mont",r),this.a=new sc(r.a,16).toRed(this.red),this.b=new sc(r.b,16).toRed(this.red),this.i4=new sc(4).toRed(this.red).redInvm(),this.two=new sc(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(ac,"MontCurve");vx(ac,yd);yx.exports=ac;ac.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 Dr(r,e,t){yd.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new sc(e,16),this.z=new sc(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(Dr,"Point");vx(Dr,yd.BasePoint);ac.prototype.decodePoint=o(function(e,t){return this.point(MO.toArray(e,t),1)},"decodePoint");ac.prototype.point=o(function(e,t){return new Dr(this,e,t)},"point");ac.prototype.pointFromJSON=o(function(e){return Dr.fromJSON(this,e)},"pointFromJSON");Dr.prototype.precompute=o(function(){},"precompute");Dr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Dr.fromJSON=o(function(e,t){return new Dr(e,t[0],t[1]||e.one)},"fromJSON");Dr.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");Dr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Dr.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),f=t.redMul(i),u=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(f,u)},"dbl");Dr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Dr.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),f=e.x.redSub(e.z),u=f.redMul(n),d=s.redMul(i),y=t.z.redMul(u.redAdd(d).redSqr()),w=t.x.redMul(u.redISub(d).redSqr());return this.curve.point(y,w)},"diffAdd");Dr.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var u=f.length-1;u>=0;u--)f[u]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");Dr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Dr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Dr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Dr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Dr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var Ex=Re((nG,_x)=>{"use strict";var TO=zn(),rs=mo(),wx=Hu(),xd=ju(),CO=TO.assert;function bo(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,xd.call(this,"edwards",r),this.a=new rs(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new rs(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new rs(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),CO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(bo,"EdwardsCurve");wx(bo,xd);_x.exports=bo;bo.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");bo.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");bo.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");bo.prototype.pointFromX=o(function(e,t){e=new rs(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)),f=i.redMul(s.redInvm()),u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(t&&!d||!t&&d)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");bo.prototype.pointFromY=o(function(e,t){e=new rs(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),f=i.redMul(s.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)},"pointFromY");bo.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 nr(r,e,t,n,i){xd.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 rs(e,16),this.y=new rs(t,16),this.z=n?new rs(n,16):this.curve.one,this.t=i&&new rs(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(nr,"Point");wx(nr,xd.BasePoint);bo.prototype.pointFromJSON=o(function(e){return nr.fromJSON(this,e)},"pointFromJSON");bo.prototype.point=o(function(e,t,n,i){return new nr(this,e,t,n,i)},"point");nr.fromJSON=o(function(e,t){return new nr(e,t[0],t[1],t[2])},"fromJSON");nr.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");nr.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");nr.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),f=i.redAdd(t),u=f.redSub(n),d=i.redSub(t),y=s.redMul(u),w=f.redMul(d),A=s.redMul(d),O=u.redMul(f);return this.curve.point(y,w,O,A)},"_extDbl");nr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,f,u,d,y;if(this.curve.twisted){u=this.curve._mulA(t);var w=u.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(w.redSub(this.curve.two)),s=w.redMul(u.redSub(n)),f=w.redSqr().redSub(w).redSub(w)):(d=this.z.redSqr(),y=w.redSub(d).redISub(d),i=e.redSub(t).redISub(n).redMul(y),s=w.redMul(u.redSub(n)),f=w.redMul(y))}else u=t.redAdd(n),d=this.curve._mulC(this.z).redSqr(),y=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(y),s=this.curve._mulC(u).redMul(t.redISub(n)),f=u.redMul(y);return this.curve.point(i,s,f)},"_projDbl");nr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");nr.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)),f=n.redSub(t),u=s.redSub(i),d=s.redAdd(i),y=n.redAdd(t),w=f.redMul(u),A=d.redMul(y),O=f.redMul(y),R=u.redMul(d);return this.curve.point(w,A,R,O)},"_extAdd");nr.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),f=this.curve.d.redMul(i).redMul(s),u=n.redSub(f),d=n.redAdd(f),y=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),w=t.redMul(u).redMul(y),A,O;return this.curve.twisted?(A=t.redMul(d).redMul(s.redSub(this.curve._mulA(i))),O=u.redMul(d)):(A=t.redMul(d).redMul(s.redSub(i)),O=this.curve._mulC(u).redMul(d)),this.curve.point(w,A,O)},"_projAdd");nr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");nr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");nr.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");nr.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");nr.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");nr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");nr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");nr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");nr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");nr.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");nr.prototype.toP=nr.prototype.normalize;nr.prototype.mixedAdd=nr.prototype.add});var I1=Re(Ax=>{"use strict";var wd=Ax;wd.base=ju();wd.short=gx();wd.mont=xx();wd.edwards=Ex()});var zi=Re(tr=>{"use strict";var kO=qs(),IO=Hu();tr.inherits=IO;function DO(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(DO,"isSurrogatePair");function RO(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):DO(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(RO,"toArray");tr.toArray=RO;function OO(r){for(var e="",t=0;t<r.length;t++)e+=Mx(r[t].toString(16));return e}o(OO,"toHex");tr.toHex=OO;function Sx(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(Sx,"htonl");tr.htonl=Sx;function NO(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=Sx(i)),t+=Tx(i.toString(16))}return t}o(NO,"toHex32");tr.toHex32=NO;function Mx(r){return r.length===1?"0"+r:r}o(Mx,"zero2");tr.zero2=Mx;function Tx(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(Tx,"zero8");tr.zero8=Tx;function PO(r,e,t,n){var i=t-e;kO(i%4===0);for(var s=new Array(i/4),f=0,u=e;f<s.length;f++,u+=4){var d;n==="big"?d=r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:d=r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],s[f]=d>>>0}return s}o(PO,"join32");tr.join32=PO;function BO(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(BO,"split32");tr.split32=BO;function LO(r,e){return r>>>e|r<<32-e}o(LO,"rotr32");tr.rotr32=LO;function UO(r,e){return r<<e|r>>>32-e}o(UO,"rotl32");tr.rotl32=UO;function FO(r,e){return r+e>>>0}o(FO,"sum32");tr.sum32=FO;function $O(r,e,t){return r+e+t>>>0}o($O,"sum32_3");tr.sum32_3=$O;function qO(r,e,t,n){return r+e+t+n>>>0}o(qO,"sum32_4");tr.sum32_4=qO;function jO(r,e,t,n,i){return r+e+t+n+i>>>0}o(jO,"sum32_5");tr.sum32_5=jO;function HO(r,e,t,n){var i=r[e],s=r[e+1],f=n+s>>>0,u=(f<n?1:0)+t+i;r[e]=u>>>0,r[e+1]=f}o(HO,"sum64");tr.sum64=HO;function zO(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(zO,"sum64_hi");tr.sum64_hi=zO;function KO(r,e,t,n){var i=e+n;return i>>>0}o(KO,"sum64_lo");tr.sum64_lo=KO;function VO(r,e,t,n,i,s,f,u){var d=0,y=e;y=y+n>>>0,d+=y<e?1:0,y=y+s>>>0,d+=y<s?1:0,y=y+u>>>0,d+=y<u?1:0;var w=r+t+i+f+d;return w>>>0}o(VO,"sum64_4_hi");tr.sum64_4_hi=VO;function GO(r,e,t,n,i,s,f,u){var d=e+n+s+u;return d>>>0}o(GO,"sum64_4_lo");tr.sum64_4_lo=GO;function WO(r,e,t,n,i,s,f,u,d,y){var w=0,A=e;A=A+n>>>0,w+=A<e?1:0,A=A+s>>>0,w+=A<s?1:0,A=A+u>>>0,w+=A<u?1:0,A=A+y>>>0,w+=A<y?1:0;var O=r+t+i+f+d+w;return O>>>0}o(WO,"sum64_5_hi");tr.sum64_5_hi=WO;function JO(r,e,t,n,i,s,f,u,d,y){var w=e+n+s+u+y;return w>>>0}o(JO,"sum64_5_lo");tr.sum64_5_lo=JO;function YO(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(YO,"rotr64_hi");tr.rotr64_hi=YO;function ZO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(ZO,"rotr64_lo");tr.rotr64_lo=ZO;function XO(r,e,t){return r>>>t}o(XO,"shr64_hi");tr.shr64_hi=XO;function QO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(QO,"shr64_lo");tr.shr64_lo=QO});var fc=Re(kx=>{"use strict";var Cx=zi(),eN=qs();function _d(){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(_d,"BlockHash");kx.BlockHash=_d;_d.prototype.update=o(function(e,t){if(e=Cx.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=Cx.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");_d.prototype.digest=o(function(e){return this.update(this._pad()),eN(this.pending===null),this._digest(e)},"digest");_d.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 f=8;f<this.padLength;f++)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,f=8;f<this.padLength;f++)i[s++]=0;return i},"pad")});var D1=Re(ns=>{"use strict";var tN=zi(),go=tN.rotr32;function rN(r,e,t,n){if(r===0)return Ix(e,t,n);if(r===1||r===3)return Rx(e,t,n);if(r===2)return Dx(e,t,n)}o(rN,"ft_1");ns.ft_1=rN;function Ix(r,e,t){return r&e^~r&t}o(Ix,"ch32");ns.ch32=Ix;function Dx(r,e,t){return r&e^r&t^e&t}o(Dx,"maj32");ns.maj32=Dx;function Rx(r,e,t){return r^e^t}o(Rx,"p32");ns.p32=Rx;function nN(r){return go(r,2)^go(r,13)^go(r,22)}o(nN,"s0_256");ns.s0_256=nN;function iN(r){return go(r,6)^go(r,11)^go(r,25)}o(iN,"s1_256");ns.s1_256=iN;function oN(r){return go(r,7)^go(r,18)^r>>>3}o(oN,"g0_256");ns.g0_256=oN;function sN(r){return go(r,17)^go(r,19)^r>>>10}o(sN,"g1_256");ns.g1_256=sN});var Px=Re((fG,Nx)=>{"use strict";var cc=zi(),aN=fc(),fN=D1(),R1=cc.rotl32,zu=cc.sum32,cN=cc.sum32_5,uN=fN.ft_1,Ox=aN.BlockHash,lN=[1518500249,1859775393,2400959708,3395469782];function vo(){if(!(this instanceof vo))return new vo;Ox.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(vo,"SHA1");cc.inherits(vo,Ox);Nx.exports=vo;vo.blockSize=512;vo.outSize=160;vo.hmacStrength=80;vo.padLength=64;vo.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]=R1(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],y=this.h[4];for(i=0;i<n.length;i++){var w=~~(i/20),A=cN(R1(s,5),uN(w,f,u,d),y,n[i],lN[w]);y=d,d=u,u=R1(f,30),f=s,s=A}this.h[0]=zu(this.h[0],s),this.h[1]=zu(this.h[1],f),this.h[2]=zu(this.h[2],u),this.h[3]=zu(this.h[3],d),this.h[4]=zu(this.h[4],y)},"_update");vo.prototype._digest=o(function(e){return e==="hex"?cc.toHex32(this.h,"big"):cc.split32(this.h,"big")},"digest")});var O1=Re((cG,Lx)=>{"use strict";var uc=zi(),hN=fc(),lc=D1(),dN=qs(),Ki=uc.sum32,pN=uc.sum32_4,mN=uc.sum32_5,bN=lc.ch32,gN=lc.maj32,vN=lc.s0_256,yN=lc.s1_256,xN=lc.g0_256,wN=lc.g1_256,Bx=hN.BlockHash,_N=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function yo(){if(!(this instanceof yo))return new yo;Bx.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=_N,this.W=new Array(64)}o(yo,"SHA256");uc.inherits(yo,Bx);Lx.exports=yo;yo.blockSize=512;yo.outSize=256;yo.hmacStrength=192;yo.padLength=64;yo.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]=pN(wN(n[i-2]),n[i-7],xN(n[i-15]),n[i-16]);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],y=this.h[4],w=this.h[5],A=this.h[6],O=this.h[7];for(dN(this.k.length===n.length),i=0;i<n.length;i++){var R=mN(O,yN(y),bN(y,w,A),this.k[i],n[i]),I=Ki(vN(s),gN(s,f,u));O=A,A=w,w=y,y=Ki(d,R),d=u,u=f,f=s,s=Ki(R,I)}this.h[0]=Ki(this.h[0],s),this.h[1]=Ki(this.h[1],f),this.h[2]=Ki(this.h[2],u),this.h[3]=Ki(this.h[3],d),this.h[4]=Ki(this.h[4],y),this.h[5]=Ki(this.h[5],w),this.h[6]=Ki(this.h[6],A),this.h[7]=Ki(this.h[7],O)},"_update");yo.prototype._digest=o(function(e){return e==="hex"?uc.toHex32(this.h,"big"):uc.split32(this.h,"big")},"digest")});var $x=Re((uG,Fx)=>{"use strict";var N1=zi(),Ux=O1();function is(){if(!(this instanceof is))return new is;Ux.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(is,"SHA224");N1.inherits(is,Ux);Fx.exports=is;is.blockSize=512;is.outSize=224;is.hmacStrength=192;is.padLength=64;is.prototype._digest=o(function(e){return e==="hex"?N1.toHex32(this.h.slice(0,7),"big"):N1.split32(this.h.slice(0,7),"big")},"digest")});var L1=Re((lG,zx)=>{"use strict";var An=zi(),EN=fc(),AN=qs(),xo=An.rotr64_hi,wo=An.rotr64_lo,qx=An.shr64_hi,jx=An.shr64_lo,zs=An.sum64,P1=An.sum64_hi,B1=An.sum64_lo,SN=An.sum64_4_hi,MN=An.sum64_4_lo,TN=An.sum64_5_hi,CN=An.sum64_5_lo,Hx=EN.BlockHash,kN=[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 Vi(){if(!(this instanceof Vi))return new Vi;Hx.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=kN,this.W=new Array(160)}o(Vi,"SHA512");An.inherits(Vi,Hx);zx.exports=Vi;Vi.blockSize=1024;Vi.outSize=512;Vi.hmacStrength=192;Vi.padLength=128;Vi.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=$N(n[i-4],n[i-3]),f=qN(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],y=UN(n[i-30],n[i-29]),w=FN(n[i-30],n[i-29]),A=n[i-32],O=n[i-31];n[i]=SN(s,f,u,d,y,w,A,O),n[i+1]=MN(s,f,u,d,y,w,A,O)}},"_prepareBlock");Vi.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],f=this.h[2],u=this.h[3],d=this.h[4],y=this.h[5],w=this.h[6],A=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],B=this.h[11],Y=this.h[12],P=this.h[13],J=this.h[14],ee=this.h[15];AN(this.k.length===n.length);for(var Z=0;Z<n.length;Z+=2){var ne=J,V=ee,j=BN(O,R),H=LN(O,R),he=IN(O,R,I,B,Y,P),L=DN(O,R,I,B,Y,P),h=this.k[Z],v=this.k[Z+1],g=n[Z],l=n[Z+1],b=TN(ne,V,j,H,he,L,h,v,g,l),E=CN(ne,V,j,H,he,L,h,v,g,l);ne=NN(i,s),V=PN(i,s),j=RN(i,s,f,u,d,y),H=ON(i,s,f,u,d,y);var M=P1(ne,V,j,H),S=B1(ne,V,j,H);J=Y,ee=P,Y=I,P=B,I=O,B=R,O=P1(w,A,b,E),R=B1(A,A,b,E),w=d,A=y,d=f,y=u,f=i,u=s,i=P1(b,E,M,S),s=B1(b,E,M,S)}zs(this.h,0,i,s),zs(this.h,2,f,u),zs(this.h,4,d,y),zs(this.h,6,w,A),zs(this.h,8,O,R),zs(this.h,10,I,B),zs(this.h,12,Y,P),zs(this.h,14,J,ee)},"_update");Vi.prototype._digest=o(function(e){return e==="hex"?An.toHex32(this.h,"big"):An.split32(this.h,"big")},"digest");function IN(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(IN,"ch64_hi");function DN(r,e,t,n,i,s){var f=e&n^~e&s;return f<0&&(f+=4294967296),f}o(DN,"ch64_lo");function RN(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(RN,"maj64_hi");function ON(r,e,t,n,i,s){var f=e&n^e&s^n&s;return f<0&&(f+=4294967296),f}o(ON,"maj64_lo");function NN(r,e){var t=xo(r,e,28),n=xo(e,r,2),i=xo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(NN,"s0_512_hi");function PN(r,e){var t=wo(r,e,28),n=wo(e,r,2),i=wo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(PN,"s0_512_lo");function BN(r,e){var t=xo(r,e,14),n=xo(r,e,18),i=xo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(BN,"s1_512_hi");function LN(r,e){var t=wo(r,e,14),n=wo(r,e,18),i=wo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(LN,"s1_512_lo");function UN(r,e){var t=xo(r,e,1),n=xo(r,e,8),i=qx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(UN,"g0_512_hi");function FN(r,e){var t=wo(r,e,1),n=wo(r,e,8),i=jx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(FN,"g0_512_lo");function $N(r,e){var t=xo(r,e,19),n=xo(e,r,29),i=qx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o($N,"g1_512_hi");function qN(r,e){var t=wo(r,e,19),n=wo(e,r,29),i=jx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(qN,"g1_512_lo")});var Gx=Re((hG,Vx)=>{"use strict";var U1=zi(),Kx=L1();function os(){if(!(this instanceof os))return new os;Kx.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(os,"SHA384");U1.inherits(os,Kx);Vx.exports=os;os.blockSize=1024;os.outSize=384;os.hmacStrength=192;os.padLength=128;os.prototype._digest=o(function(e){return e==="hex"?U1.toHex32(this.h.slice(0,12),"big"):U1.split32(this.h.slice(0,12),"big")},"digest")});var Wx=Re(hc=>{"use strict";hc.sha1=Px();hc.sha224=$x();hc.sha256=O1();hc.sha384=Gx();hc.sha512=L1()});var e6=Re(Qx=>{"use strict";var ja=zi(),jN=fc(),Ed=ja.rotl32,Jx=ja.sum32,Ku=ja.sum32_3,Yx=ja.sum32_4,Xx=jN.BlockHash;function _o(){if(!(this instanceof _o))return new _o;Xx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(_o,"RIPEMD160");ja.inherits(_o,Xx);Qx.ripemd160=_o;_o.blockSize=512;_o.outSize=160;_o.hmacStrength=192;_o.padLength=64;_o.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],f=this.h[3],u=this.h[4],d=n,y=i,w=s,A=f,O=u,R=0;R<80;R++){var I=Jx(Ed(Yx(n,Zx(R,i,s,f),e[KN[R]+t],HN(R)),GN[R]),u);n=u,u=f,f=Ed(s,10),s=i,i=I,I=Jx(Ed(Yx(d,Zx(79-R,y,w,A),e[VN[R]+t],zN(R)),WN[R]),O),d=O,O=A,A=Ed(w,10),w=y,y=I}I=Ku(this.h[1],s,A),this.h[1]=Ku(this.h[2],f,O),this.h[2]=Ku(this.h[3],u,d),this.h[3]=Ku(this.h[4],n,y),this.h[4]=Ku(this.h[0],i,w),this.h[0]=I},"update");_o.prototype._digest=o(function(e){return e==="hex"?ja.toHex32(this.h,"little"):ja.split32(this.h,"little")},"digest");function Zx(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(Zx,"f");function HN(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(HN,"K");function zN(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(zN,"Kh");var KN=[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],VN=[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],GN=[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],WN=[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 r6=Re((mG,t6)=>{"use strict";var JN=zi(),YN=qs();function dc(r,e,t){if(!(this instanceof dc))return new dc(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(JN.toArray(e,t))}o(dc,"Hmac");t6.exports=dc;dc.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),YN(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");dc.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");dc.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var Vu=Re(n6=>{var jr=n6;jr.utils=zi();jr.common=fc();jr.sha=Wx();jr.ripemd=e6();jr.hmac=r6();jr.sha1=jr.sha.sha1;jr.sha256=jr.sha.sha256;jr.sha224=jr.sha.sha224;jr.sha384=jr.sha.sha384;jr.sha512=jr.sha.sha512;jr.ripemd160=jr.ripemd.ripemd160});var o6=Re((gG,i6)=>{i6.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 Ad=Re(f6=>{"use strict";var $1=f6,Ks=Vu(),F1=I1(),ZN=zn(),s6=ZN.assert;function a6(r){r.type==="short"?this.curve=new F1.short(r):r.type==="edwards"?this.curve=new F1.edwards(r):this.curve=new F1.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,s6(this.g.validate(),"Invalid curve"),s6(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(a6,"PresetCurve");$1.PresetCurve=a6;function Vs(r,e){Object.defineProperty($1,r,{configurable:!0,enumerable:!0,get:function(){var t=new a6(e);return Object.defineProperty($1,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(Vs,"defineCurve");Vs("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:Ks.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Vs("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:Ks.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Vs("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:Ks.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Vs("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:Ks.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"]});Vs("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:Ks.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"]});Vs("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ks.sha256,gRed:!1,g:["9"]});Vs("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:Ks.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var q1;try{q1=o6()}catch{q1=void 0}Vs("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:Ks.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",q1]})});var l6=Re((yG,u6)=>{"use strict";var XN=Vu(),Ha=E1(),c6=qs();function Gs(r){if(!(this instanceof Gs))return new Gs(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=Ha.toArray(r.entropy,r.entropyEnc||"hex"),t=Ha.toArray(r.nonce,r.nonceEnc||"hex"),n=Ha.toArray(r.pers,r.persEnc||"hex");c6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(Gs,"HmacDRBG");u6.exports=Gs;Gs.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");Gs.prototype._hmac=o(function(){return new XN.hmac(this.hash,this.K)},"hmac");Gs.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");Gs.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Ha.toArray(e,t),n=Ha.toArray(n,i),c6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Gs.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=Ha.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 f=s.slice(0,e);return this._update(n),this._reseed++,Ha.encode(f,t)},"generate")});var d6=Re((xG,h6)=>{"use strict";var QN=mo(),eP=zn(),j1=eP.assert;function Zr(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(Zr,"KeyPair");h6.exports=Zr;Zr.fromPublic=o(function(e,t,n){return t instanceof Zr?t:new Zr(e,{pub:t,pubEnc:n})},"fromPublic");Zr.fromPrivate=o(function(e,t,n){return t instanceof Zr?t:new Zr(e,{priv:t,privEnc:n})},"fromPrivate");Zr.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");Zr.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");Zr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Zr.prototype._importPrivate=o(function(e,t){this.priv=new QN(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Zr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?j1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&j1(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");Zr.prototype.derive=o(function(e){return e.validate()||j1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Zr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");Zr.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");Zr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var b6=Re((wG,m6)=>{"use strict";var Sd=mo(),K1=zn(),tP=K1.assert;function Md(r,e){if(r instanceof Md)return r;this._importDER(r,e)||(tP(r.r&&r.s,"Signature without r or s"),this.r=new Sd(r.r,16),this.s=new Sd(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(Md,"Signature");m6.exports=Md;function rP(){this.place=0}o(rP,"Position");function H1(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4||r[e.place]===0)return!1;for(var i=0,s=0,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(H1,"getLength");function p6(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(p6,"rmPadding");Md.prototype._importDER=o(function(e,t){e=K1.toArray(e,t);var n=new rP;if(e[n.place++]!==48)return!1;var i=H1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=H1(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=H1(e,n);if(u===!1||e.length!==u+n.place||(e[n.place]&128)!==0)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new Sd(f),this.s=new Sd(d),this.recoveryParam=null,!0},"_importDER");function z1(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(z1,"constructLength");Md.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=p6(t),n=p6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];z1(i,t.length),i=i.concat(t),i.push(2),z1(i,n.length);var s=i.concat(n),f=[48];return z1(f,s.length),f=f.concat(s),K1.encode(f,e)},"toDER")});var y6=Re((_G,v6)=>{"use strict";var Gi=mo(),g6=l6(),nP=zn(),V1=Ad(),iP=T1(),za=nP.assert,G1=d6(),Td=b6();function Ei(r){if(!(this instanceof Ei))return new Ei(r);typeof r=="string"&&(za(Object.prototype.hasOwnProperty.call(V1,r),"Unknown curve "+r),r=V1[r]),r instanceof V1.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(Ei,"EC");v6.exports=Ei;Ei.prototype.keyPair=o(function(e){return new G1(this,e)},"keyPair");Ei.prototype.keyFromPrivate=o(function(e,t){return G1.fromPrivate(this,e,t)},"keyFromPrivate");Ei.prototype.keyFromPublic=o(function(e,t){return G1.fromPublic(this,e,t)},"keyFromPublic");Ei.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new g6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||iP(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Gi(2));;){var s=new Gi(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");Ei.prototype._truncateToN=o(function(e,t,n){var i;if(Gi.isBN(e)||typeof e=="number")e=new Gi(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new Gi(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new Gi(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");Ei.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!Gi.isBN(e)){za(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),za(e.length>>>0===e.length);for(var s=0;s<e.length;s++)za((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),za(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);za(new Gi(d).eq(e),"Can not sign message");for(var y=new g6({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),w=this.n.sub(new Gi(1)),A=0;;A++){var O=i.k?i.k(A):new Gi(y.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(w)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new Td({r:B,s:Y,recoveryParam:P})}}}}}},"sign");Ei.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new Td(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),y=d.mul(e).umod(this.n),w=d.mul(f).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.eqXToP(f)):(A=this.g.mulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.getX().umod(this.n).cmp(f)===0)},"verify");Ei.prototype.recoverPubKey=function(r,e,t,n){za((3&t)===t,"The recovery param is more than two bits"),e=new Td(e,n);var i=this.n,s=new Gi(r),f=e.r,u=e.s,d=t&1,y=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var w=e.r.invm(i),A=i.sub(s).mul(w).umod(i),O=u.mul(w).umod(i);return this.g.mulAdd(A,f,O)};Ei.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Td(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var E6=Re((EG,_6)=>{"use strict";var Gu=zn(),w6=Gu.assert,x6=Gu.parseBytes,pc=Gu.cachedProperty;function Rr(r,e){this.eddsa=r,this._secret=x6(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=x6(e.pub)}o(Rr,"KeyPair");Rr.fromPublic=o(function(e,t){return t instanceof Rr?t:new Rr(e,{pub:t})},"fromPublic");Rr.fromSecret=o(function(e,t){return t instanceof Rr?t:new Rr(e,{secret:t})},"fromSecret");Rr.prototype.secret=o(function(){return this._secret},"secret");pc(Rr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));pc(Rr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));pc(Rr,"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"));pc(Rr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));pc(Rr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));pc(Rr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Rr.prototype.sign=o(function(e){return w6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Rr.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Rr.prototype.getSecret=o(function(e){return w6(this._secret,"KeyPair is public only"),Gu.encode(this.secret(),e)},"getSecret");Rr.prototype.getPublic=o(function(e){return Gu.encode(this.pubBytes(),e)},"getPublic");_6.exports=Rr});var M6=Re((AG,S6)=>{"use strict";var oP=mo(),Cd=zn(),A6=Cd.assert,kd=Cd.cachedProperty,sP=Cd.parseBytes;function Ka(r,e){this.eddsa=r,typeof e!="object"&&(e=sP(e)),Array.isArray(e)&&(A6(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),A6(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof oP&&(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(Ka,"Signature");kd(Ka,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));kd(Ka,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));kd(Ka,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));kd(Ka,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Ka.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Ka.prototype.toHex=o(function(){return Cd.encode(this.toBytes(),"hex").toUpperCase()},"toHex");S6.exports=Ka});var D6=Re((SG,I6)=>{"use strict";var aP=Vu(),fP=Ad(),mc=zn(),cP=mc.assert,C6=mc.parseBytes,k6=E6(),T6=M6();function Sn(r){if(cP(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sn))return new Sn(r);r=fP[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=aP.sha512}o(Sn,"EDDSA");I6.exports=Sn;Sn.prototype.sign=o(function(e,t){e=C6(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),f=this.encodePoint(s),u=this.hashInt(f,n.pubBytes(),e).mul(n.priv()),d=i.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:d,Rencoded:f})},"sign");Sn.prototype.verify=o(function(e,t,n){if(e=C6(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),f=this.g.mul(t.S()),u=t.R().add(i.pub().mul(s));return u.eq(f)},"verify");Sn.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return mc.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");Sn.prototype.keyFromPublic=o(function(e){return k6.fromPublic(this,e)},"keyFromPublic");Sn.prototype.keyFromSecret=o(function(e){return k6.fromSecret(this,e)},"keyFromSecret");Sn.prototype.makeSignature=o(function(e){return e instanceof T6?e:new T6(this,e)},"makeSignature");Sn.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");Sn.prototype.decodePoint=o(function(e){e=mc.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=mc.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");Sn.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");Sn.prototype.decodeInt=o(function(e){return mc.intFromLE(e)},"decodeInt");Sn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var O6=Re(R6=>{"use strict";var Va=R6;Va.version=ax().version;Va.utils=zn();Va.rand=T1();Va.curve=I1();Va.curves=Ad();Va.ec=y6();Va.eddsa=D6()});var P6=Re(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.BrowserRandomSource=void 0;var N6=65536,Id=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=N6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,N6)));return t}};o(Id,"BrowserRandomSource");Dd.BrowserRandomSource=Id});var B6=Re(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.NodeRandomSource=void 0;var uP=xi(),Rd=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=t[i];return(0,uP.wipe)(t),n}};o(Rd,"NodeRandomSource");Od.NodeRandomSource=Rd});var L6=Re(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.SystemRandomSource=void 0;var lP=P6(),hP=B6(),Nd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new lP.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new hP.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};o(Nd,"SystemRandomSource");Pd.SystemRandomSource=Nd});var Ga=Re(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.randomStringForEntropy=Xr.randomString=Xr.randomUint32=Xr.randomBytes=Xr.defaultRandomSource=void 0;var dP=L6(),pP=$a(),U6=xi();Xr.defaultRandomSource=new dP.SystemRandomSource;function W1(r,e=Xr.defaultRandomSource){return e.randomBytes(r)}o(W1,"randomBytes");Xr.randomBytes=W1;function mP(r=Xr.defaultRandomSource){let e=W1(4,r),t=(0,pP.readUint32LE)(e);return(0,U6.wipe)(e),t}o(mP,"randomUint32");Xr.randomUint32=mP;var F6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function $6(r,e=F6,t=Xr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",i=e.length,s=256-256%i;for(;r>0;){let f=W1(Math.ceil(r*256/s),t);for(let u=0;u<f.length&&r>0;u++){let d=f[u];d<s&&(n+=e.charAt(d%i),r--)}(0,U6.wipe)(f)}return n}o($6,"randomString");Xr.randomString=$6;function bP(r,e=F6,t=Xr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return $6(n,e,t)}o(bP,"randomStringForEntropy");Xr.randomStringForEntropy=bP});var H6=Re(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var gc=$a(),bc=xi();ss.DIGEST_LENGTH=64;ss.BLOCK_SIZE=128;var j6=function(){function r(){this.digestLength=ss.DIGEST_LENGTH,this.blockSize=ss.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(){bc.wipe(this._buffer),bc.wipe(this._tempHi),bc.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<ss.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(J1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=J1(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,f=t%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;gc.writeUint32BE(i,this._buffer,f-8),gc.writeUint32BE(s,this._buffer,f-4),J1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)gc.writeUint32BE(this._stateHi[u],e,u*8),gc.writeUint32BE(this._stateLo[u],e,u*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){bc.wipe(e.stateHi),bc.wipe(e.stateLo),e.buffer&&bc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();ss.SHA512=j6;var q6=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 J1(r,e,t,n,i,s,f){for(var u=t[0],d=t[1],y=t[2],w=t[3],A=t[4],O=t[5],R=t[6],I=t[7],B=n[0],Y=n[1],P=n[2],J=n[3],ee=n[4],Z=n[5],ne=n[6],V=n[7],j,H,he,L,h,v,g,l;f>=128;){for(var b=0;b<16;b++){var E=8*b+s;r[b]=gc.readUint32BE(i,E),e[b]=gc.readUint32BE(i,E+4)}for(var b=0;b<80;b++){var M=u,S=d,x=y,C=w,N=A,_=O,k=R,fe=I,D=B,Q=Y,se=P,q=J,z=ee,G=Z,te=ne,ae=V;if(j=I,H=V,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=(A>>>14|ee<<32-14)^(A>>>18|ee<<32-18)^(ee>>>41-32|A<<32-(41-32)),H=(ee>>>14|A<<32-14)^(ee>>>18|A<<32-18)^(A>>>41-32|ee<<32-(41-32)),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=A&O^~A&R,H=ee&Z^~ee&ne,h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=q6[b*2],H=q6[b*2+1],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=r[b%16],H=e[b%16],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,he=g&65535|l<<16,L=h&65535|v<<16,j=he,H=L,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=(u>>>28|B<<32-28)^(B>>>34-32|u<<32-(34-32))^(B>>>39-32|u<<32-(39-32)),H=(B>>>28|u<<32-28)^(u>>>34-32|B<<32-(34-32))^(u>>>39-32|B<<32-(39-32)),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=u&d^u&y^d&y,H=B&Y^B&P^Y&P,h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,fe=g&65535|l<<16,ae=h&65535|v<<16,j=C,H=q,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=he,H=L,h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,C=g&65535|l<<16,q=h&65535|v<<16,d=M,y=S,w=x,A=C,O=N,R=_,I=k,u=fe,Y=D,P=Q,J=se,ee=q,Z=z,ne=G,V=te,B=ae,b%16===15)for(var E=0;E<16;E++)j=r[E],H=e[E],h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=r[(E+9)%16],H=e[(E+9)%16],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,he=r[(E+1)%16],L=e[(E+1)%16],j=(he>>>1|L<<32-1)^(he>>>8|L<<32-8)^he>>>7,H=(L>>>1|he<<32-1)^(L>>>8|he<<32-8)^(L>>>7|he<<32-7),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,he=r[(E+14)%16],L=e[(E+14)%16],j=(he>>>19|L<<32-19)^(L>>>61-32|he<<32-(61-32))^he>>>6,H=(L>>>19|he<<32-19)^(he>>>61-32|L<<32-(61-32))^(L>>>6|he<<32-6),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,r[E]=g&65535|l<<16,e[E]=h&65535|v<<16}j=u,H=B,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[0],H=n[0],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[0]=u=g&65535|l<<16,n[0]=B=h&65535|v<<16,j=d,H=Y,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[1],H=n[1],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[1]=d=g&65535|l<<16,n[1]=Y=h&65535|v<<16,j=y,H=P,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[2],H=n[2],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[2]=y=g&65535|l<<16,n[2]=P=h&65535|v<<16,j=w,H=J,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[3],H=n[3],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[3]=w=g&65535|l<<16,n[3]=J=h&65535|v<<16,j=A,H=ee,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[4],H=n[4],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[4]=A=g&65535|l<<16,n[4]=ee=h&65535|v<<16,j=O,H=Z,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[5],H=n[5],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[5]=O=g&65535|l<<16,n[5]=Z=h&65535|v<<16,j=R,H=ne,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[6],H=n[6],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[6]=R=g&65535|l<<16,n[6]=ne=h&65535|v<<16,j=I,H=V,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[7],H=n[7],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[7]=I=g&65535|l<<16,n[7]=V=h&65535|v<<16,s+=128,f-=128}return s}o(J1,"hashBlocks");function gP(r){var e=new j6;e.update(r);var t=e.digest();return e.clean(),t}o(gP,"hash");ss.hash=gP});var Bd=Re(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.convertSecretKeyToX25519=Wt.convertPublicKeyToX25519=Wt.verify=Wt.sign=Wt.extractPublicKeyFromSecretKey=Wt.generateKeyPair=Wt.generateKeyPairFromSeed=Wt.SEED_LENGTH=Wt.SECRET_KEY_LENGTH=Wt.PUBLIC_KEY_LENGTH=Wt.SIGNATURE_LENGTH=void 0;var vP=Ga(),Wu=H6(),W6=xi();Wt.SIGNATURE_LENGTH=64;Wt.PUBLIC_KEY_LENGTH=32;Wt.SECRET_KEY_LENGTH=64;Wt.SEED_LENGTH=32;function We(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(We,"gf");var yP=new Uint8Array(32);yP[0]=9;var X1=We(),vc=We([1]),xP=We([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),wP=We([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),z6=We([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),K6=We([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_P=We([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ws(r,e){for(let t=0;t<16;t++)r[t]=e[t]|0}o(Ws,"set25519");function Y1(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Y1,"car25519");function J6(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(J6,"sel25519");function Ju(r,e){let t=We(),n=We();for(let i=0;i<16;i++)n[i]=e[i];Y1(n),Y1(n),Y1(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,J6(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(Ju,"pack25519");function Y6(r,e){let t=0;for(let n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(Y6,"verify32");function V6(r,e){let t=new Uint8Array(32),n=new Uint8Array(32);return Ju(t,r),Ju(n,e),Y6(t,n)}o(V6,"neq25519");function Z6(r){let e=new Uint8Array(32);return Ju(e,r),e[0]&1}o(Z6,"par25519");function EP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(EP,"unpack25519");function Wa(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Wa,"add");function Ya(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ya,"sub");function Xt(r,e,t){let n,i,s=0,f=0,u=0,d=0,y=0,w=0,A=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,Z=0,ne=0,V=0,j=0,H=0,he=0,L=0,h=0,v=0,g=0,l=0,b=0,E=0,M=0,S=0,x=0,C=t[0],N=t[1],_=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],z=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*_,d+=n*k,y+=n*fe,w+=n*D,A+=n*Q,O+=n*se,R+=n*q,I+=n*z,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,Z+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*_,y+=n*k,w+=n*fe,A+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*z,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,Z+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,y+=n*_,w+=n*k,A+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*z,P+=n*G,J+=n*te,ee+=n*ae,Z+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,y+=n*N,w+=n*_,A+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*z,J+=n*G,ee+=n*te,Z+=n*ae,ne+=n*Ae,V+=n*ge,j+=n*ie,n=e[4],y+=n*C,w+=n*N,A+=n*_,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*z,ee+=n*G,Z+=n*te,ne+=n*ae,V+=n*Ae,j+=n*ge,H+=n*ie,n=e[5],w+=n*C,A+=n*N,O+=n*_,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*z,Z+=n*G,ne+=n*te,V+=n*ae,j+=n*Ae,H+=n*ge,he+=n*ie,n=e[6],A+=n*C,O+=n*N,R+=n*_,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,Z+=n*z,ne+=n*G,V+=n*te,j+=n*ae,H+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*_,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,Z+=n*q,ne+=n*z,V+=n*G,j+=n*te,H+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*_,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,Z+=n*se,ne+=n*q,V+=n*z,j+=n*G,H+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,v+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*_,P+=n*k,J+=n*fe,ee+=n*D,Z+=n*Q,ne+=n*se,V+=n*q,j+=n*z,H+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,v+=n*ge,g+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*_,J+=n*k,ee+=n*fe,Z+=n*D,ne+=n*Q,V+=n*se,j+=n*q,H+=n*z,he+=n*G,L+=n*te,h+=n*ae,v+=n*Ae,g+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*_,ee+=n*k,Z+=n*fe,ne+=n*D,V+=n*Q,j+=n*se,H+=n*q,he+=n*z,L+=n*G,h+=n*te,v+=n*ae,g+=n*Ae,l+=n*ge,b+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*_,Z+=n*k,ne+=n*fe,V+=n*D,j+=n*Q,H+=n*se,he+=n*q,L+=n*z,h+=n*G,v+=n*te,g+=n*ae,l+=n*Ae,b+=n*ge,E+=n*ie,n=e[13],J+=n*C,ee+=n*N,Z+=n*_,ne+=n*k,V+=n*fe,j+=n*D,H+=n*Q,he+=n*se,L+=n*q,h+=n*z,v+=n*G,g+=n*te,l+=n*ae,b+=n*Ae,E+=n*ge,M+=n*ie,n=e[14],ee+=n*C,Z+=n*N,ne+=n*_,V+=n*k,j+=n*fe,H+=n*D,he+=n*Q,L+=n*se,h+=n*q,v+=n*z,g+=n*G,l+=n*te,b+=n*ae,E+=n*Ae,M+=n*ge,S+=n*ie,n=e[15],Z+=n*C,ne+=n*N,V+=n*_,j+=n*k,H+=n*fe,he+=n*D,L+=n*Q,h+=n*se,v+=n*q,g+=n*z,l+=n*G,b+=n*te,E+=n*ae,M+=n*Ae,S+=n*ge,x+=n*ie,s+=38*ne,f+=38*V,u+=38*j,d+=38*H,y+=38*he,w+=38*L,A+=38*h,O+=38*v,R+=38*g,I+=38*l,B+=38*b,Y+=38*E,P+=38*M,J+=38*S,ee+=38*x,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=y,r[5]=w,r[6]=A,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=Z}o(Xt,"mul");function Ja(r,e){Xt(r,e,e)}o(Ja,"square");function X6(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Ja(t,t),n!==2&&n!==4&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(X6,"inv25519");function AP(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Ja(t,t),n!==1&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(AP,"pow2523");function Q1(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We(),y=We(),w=We();Ya(t,r[1],r[0]),Ya(w,e[1],e[0]),Xt(t,t,w),Wa(n,r[0],r[1]),Wa(w,e[0],e[1]),Xt(n,n,w),Xt(i,r[3],e[3]),Xt(i,i,wP),Xt(s,r[2],e[2]),Wa(s,s,s),Ya(f,n,t),Ya(u,s,i),Wa(d,s,i),Wa(y,n,t),Xt(r[0],f,u),Xt(r[1],y,d),Xt(r[2],d,u),Xt(r[3],f,y)}o(Q1,"edadd");function G6(r,e,t){for(let n=0;n<4;n++)J6(r[n],e[n],t)}o(G6,"cswap");function tb(r,e){let t=We(),n=We(),i=We();X6(i,e[2]),Xt(t,e[0],i),Xt(n,e[1],i),Ju(r,n),r[31]^=Z6(t)<<7}o(tb,"pack");function Q6(r,e,t){Ws(r[0],X1),Ws(r[1],vc),Ws(r[2],vc),Ws(r[3],X1);for(let n=255;n>=0;--n){let i=t[n/8|0]>>(n&7)&1;G6(r,e,i),Q1(e,r),Q1(r,r),G6(r,e,i)}}o(Q6,"scalarmult");function rb(r,e){let t=[We(),We(),We(),We()];Ws(t[0],z6),Ws(t[1],K6),Ws(t[2],vc),Xt(t[3],z6,K6),Q6(r,t,e)}o(rb,"scalarbase");function ew(r){if(r.length!==Wt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Wt.SEED_LENGTH} bytes`);let e=(0,Wu.hash)(r);e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(32),n=[We(),We(),We(),We()];rb(n,e),tb(t,n);let i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(ew,"generateKeyPairFromSeed");Wt.generateKeyPairFromSeed=ew;function SP(r){let e=(0,vP.randomBytes)(32,r),t=ew(e);return(0,W6.wipe)(e),t}o(SP,"generateKeyPair");Wt.generateKeyPair=SP;function MP(r){if(r.length!==Wt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Wt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(r.subarray(32))}o(MP,"extractPublicKeyFromSecretKey");Wt.extractPublicKeyFromSecretKey=MP;var Z1=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 tw(r,e){let 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]*Z1[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)*Z1[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Z1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(tw,"modL");function eb(r){let e=new Float64Array(64);for(let t=0;t<64;t++)e[t]=r[t];for(let t=0;t<64;t++)r[t]=0;tw(r,e)}o(eb,"reduce");function TP(r,e){let t=new Float64Array(64),n=[We(),We(),We(),We()],i=(0,Wu.hash)(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let s=new Uint8Array(64);s.set(i.subarray(32),32);let f=new Wu.SHA512;f.update(s.subarray(32)),f.update(e);let u=f.digest();f.clean(),eb(u),rb(n,u),tb(s,n),f.reset(),f.update(s.subarray(0,32)),f.update(r.subarray(32)),f.update(e);let d=f.digest();eb(d);for(let y=0;y<32;y++)t[y]=u[y];for(let y=0;y<32;y++)for(let w=0;w<32;w++)t[y+w]+=d[y]*i[w];return tw(s.subarray(32),t),s}o(TP,"sign");Wt.sign=TP;function rw(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We();return Ws(r[2],vc),EP(r[1],e),Ja(i,r[1]),Xt(s,i,xP),Ya(i,i,r[2]),Wa(s,r[2],s),Ja(f,s),Ja(u,f),Xt(d,u,f),Xt(t,d,i),Xt(t,t,s),AP(t,t),Xt(t,t,i),Xt(t,t,s),Xt(t,t,s),Xt(r[0],t,s),Ja(n,r[0]),Xt(n,n,s),V6(n,i)&&Xt(r[0],r[0],_P),Ja(n,r[0]),Xt(n,n,s),V6(n,i)?-1:(Z6(r[0])===e[31]>>7&&Ya(r[0],X1,r[0]),Xt(r[3],r[0],r[1]),0)}o(rw,"unpackneg");function CP(r,e,t){let n=new Uint8Array(32),i=[We(),We(),We(),We()],s=[We(),We(),We(),We()];if(t.length!==Wt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Wt.SIGNATURE_LENGTH} bytes`);if(rw(s,r))return!1;let f=new Wu.SHA512;f.update(t.subarray(0,32)),f.update(r),f.update(e);let u=f.digest();return eb(u),Q6(i,s,u),rb(s,t.subarray(32)),Q1(i,s),tb(n,i),!Y6(t,n)}o(CP,"verify");Wt.verify=CP;function kP(r){let e=[We(),We(),We(),We()];if(rw(e,r))throw new Error("Ed25519: invalid public key");let t=We(),n=We(),i=e[1];Wa(t,vc,i),Ya(n,vc,i),X6(n,n),Xt(t,t,n);let s=new Uint8Array(32);return Ju(s,t),s}o(kP,"convertPublicKeyToX25519");Wt.convertPublicKeyToX25519=kP;function IP(r){let e=(0,Wu.hash)(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(e.subarray(0,32));return(0,W6.wipe)(e),t}o(IP,"convertSecretKeyToX25519");Wt.convertSecretKeyToX25519=IP});var iw=Re((OG,nw)=>{"use strict";nw.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?"":",",f=n===void 0||typeof n=="symbol"?null:n;return t+s+r(f)},"")+"]":"{"+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 fw=Re(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.sharedKey=pr.generateKeyPair=pr.generateKeyPairFromSeed=pr.scalarMultBase=pr.scalarMult=pr.SHARED_KEY_LENGTH=pr.SECRET_KEY_LENGTH=pr.PUBLIC_KEY_LENGTH=void 0;var DP=Ga(),RP=xi();pr.PUBLIC_KEY_LENGTH=32;pr.SECRET_KEY_LENGTH=32;pr.SHARED_KEY_LENGTH=32;function Eo(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(Eo,"gf");var ow=new Uint8Array(32);ow[0]=9;var OP=Eo([56129,1]);function nb(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(nb,"car25519");function Yu(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(Yu,"sel25519");function NP(r,e){let t=Eo(),n=Eo();for(let i=0;i<16;i++)n[i]=e[i];nb(n),nb(n),nb(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,Yu(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(NP,"pack25519");function PP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(PP,"unpack25519");function Ld(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Ld,"add");function Ud(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ud,"sub");function as(r,e,t){let n,i,s=0,f=0,u=0,d=0,y=0,w=0,A=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,Z=0,ne=0,V=0,j=0,H=0,he=0,L=0,h=0,v=0,g=0,l=0,b=0,E=0,M=0,S=0,x=0,C=t[0],N=t[1],_=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],z=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*_,d+=n*k,y+=n*fe,w+=n*D,A+=n*Q,O+=n*se,R+=n*q,I+=n*z,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,Z+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*_,y+=n*k,w+=n*fe,A+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*z,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,Z+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,y+=n*_,w+=n*k,A+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*z,P+=n*G,J+=n*te,ee+=n*ae,Z+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,y+=n*N,w+=n*_,A+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*z,J+=n*G,ee+=n*te,Z+=n*ae,ne+=n*Ae,V+=n*ge,j+=n*ie,n=e[4],y+=n*C,w+=n*N,A+=n*_,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*z,ee+=n*G,Z+=n*te,ne+=n*ae,V+=n*Ae,j+=n*ge,H+=n*ie,n=e[5],w+=n*C,A+=n*N,O+=n*_,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*z,Z+=n*G,ne+=n*te,V+=n*ae,j+=n*Ae,H+=n*ge,he+=n*ie,n=e[6],A+=n*C,O+=n*N,R+=n*_,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,Z+=n*z,ne+=n*G,V+=n*te,j+=n*ae,H+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*_,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,Z+=n*q,ne+=n*z,V+=n*G,j+=n*te,H+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*_,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,Z+=n*se,ne+=n*q,V+=n*z,j+=n*G,H+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,v+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*_,P+=n*k,J+=n*fe,ee+=n*D,Z+=n*Q,ne+=n*se,V+=n*q,j+=n*z,H+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,v+=n*ge,g+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*_,J+=n*k,ee+=n*fe,Z+=n*D,ne+=n*Q,V+=n*se,j+=n*q,H+=n*z,he+=n*G,L+=n*te,h+=n*ae,v+=n*Ae,g+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*_,ee+=n*k,Z+=n*fe,ne+=n*D,V+=n*Q,j+=n*se,H+=n*q,he+=n*z,L+=n*G,h+=n*te,v+=n*ae,g+=n*Ae,l+=n*ge,b+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*_,Z+=n*k,ne+=n*fe,V+=n*D,j+=n*Q,H+=n*se,he+=n*q,L+=n*z,h+=n*G,v+=n*te,g+=n*ae,l+=n*Ae,b+=n*ge,E+=n*ie,n=e[13],J+=n*C,ee+=n*N,Z+=n*_,ne+=n*k,V+=n*fe,j+=n*D,H+=n*Q,he+=n*se,L+=n*q,h+=n*z,v+=n*G,g+=n*te,l+=n*ae,b+=n*Ae,E+=n*ge,M+=n*ie,n=e[14],ee+=n*C,Z+=n*N,ne+=n*_,V+=n*k,j+=n*fe,H+=n*D,he+=n*Q,L+=n*se,h+=n*q,v+=n*z,g+=n*G,l+=n*te,b+=n*ae,E+=n*Ae,M+=n*ge,S+=n*ie,n=e[15],Z+=n*C,ne+=n*N,V+=n*_,j+=n*k,H+=n*fe,he+=n*D,L+=n*Q,h+=n*se,v+=n*q,g+=n*z,l+=n*G,b+=n*te,E+=n*ae,M+=n*Ae,S+=n*ge,x+=n*ie,s+=38*ne,f+=38*V,u+=38*j,d+=38*H,y+=38*he,w+=38*L,A+=38*h,O+=38*v,R+=38*g,I+=38*l,B+=38*b,Y+=38*E,P+=38*M,J+=38*S,ee+=38*x,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=y,r[5]=w,r[6]=A,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=Z}o(as,"mul");function Zu(r,e){as(r,e,e)}o(Zu,"square");function BP(r,e){let t=Eo();for(let n=0;n<16;n++)t[n]=e[n];for(let n=253;n>=0;n--)Zu(t,t),n!==2&&n!==4&&as(t,t,e);for(let n=0;n<16;n++)r[n]=t[n]}o(BP,"inv25519");function ib(r,e){let t=new Uint8Array(32),n=new Float64Array(80),i=Eo(),s=Eo(),f=Eo(),u=Eo(),d=Eo(),y=Eo();for(let R=0;R<31;R++)t[R]=r[R];t[31]=r[31]&127|64,t[0]&=248,PP(n,e);for(let R=0;R<16;R++)s[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let I=t[R>>>3]>>>(R&7)&1;Yu(i,s,I),Yu(f,u,I),Ld(d,i,f),Ud(i,i,f),Ld(f,s,u),Ud(s,s,u),Zu(u,d),Zu(y,i),as(i,f,i),as(f,s,d),Ld(d,i,f),Ud(i,i,f),Zu(s,i),Ud(f,u,y),as(i,f,OP),Ld(i,i,u),as(f,f,i),as(i,u,y),as(u,s,n),Zu(s,d),Yu(i,s,I),Yu(f,u,I)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=f[R],n[R+48]=s[R],n[R+64]=u[R];let w=n.subarray(32),A=n.subarray(16);BP(w,w),as(A,A,w);let O=new Uint8Array(32);return NP(O,A),O}o(ib,"scalarMult");pr.scalarMult=ib;function sw(r){return ib(r,ow)}o(sw,"scalarMultBase");pr.scalarMultBase=sw;function aw(r){if(r.length!==pr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${pr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(r);return{publicKey:sw(e),secretKey:e}}o(aw,"generateKeyPairFromSeed");pr.generateKeyPairFromSeed=aw;function LP(r){let e=(0,DP.randomBytes)(32,r),t=aw(e);return(0,RP.wipe)(e),t}o(LP,"generateKeyPair");pr.generateKeyPair=LP;function UP(r,e,t=!1){if(r.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=ib(r,e);if(t){let i=0;for(let s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(UP,"sharedKey");pr.sharedKey=UP});var sb=Re(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var Qr=$a(),ob=xi(),FP=20;function $P(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],y=t[11]<<24|t[10]<<16|t[9]<<8|t[8],w=t[15]<<24|t[14]<<16|t[13]<<8|t[12],A=t[19]<<24|t[18]<<16|t[17]<<8|t[16],O=t[23]<<24|t[22]<<16|t[21]<<8|t[20],R=t[27]<<24|t[26]<<16|t[25]<<8|t[24],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Z=i,ne=s,V=f,j=u,H=d,he=y,L=w,h=A,v=O,g=R,l=I,b=B,E=Y,M=P,S=J,x=0;x<FP;x+=2)ee=ee+j|0,b^=ee,b=b>>>32-16|b<<16,h=h+b|0,j^=h,j=j>>>32-12|j<<12,Z=Z+H|0,E^=Z,E=E>>>32-16|E<<16,v=v+E|0,H^=v,H=H>>>32-12|H<<12,ne=ne+he|0,M^=ne,M=M>>>32-16|M<<16,g=g+M|0,he^=g,he=he>>>32-12|he<<12,V=V+L|0,S^=V,S=S>>>32-16|S<<16,l=l+S|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,M^=ne,M=M>>>32-8|M<<8,g=g+M|0,he^=g,he=he>>>32-7|he<<7,V=V+L|0,S^=V,S=S>>>32-8|S<<8,l=l+S|0,L^=l,L=L>>>32-7|L<<7,Z=Z+H|0,E^=Z,E=E>>>32-8|E<<8,v=v+E|0,H^=v,H=H>>>32-7|H<<7,ee=ee+j|0,b^=ee,b=b>>>32-8|b<<8,h=h+b|0,j^=h,j=j>>>32-7|j<<7,ee=ee+H|0,S^=ee,S=S>>>32-16|S<<16,g=g+S|0,H^=g,H=H>>>32-12|H<<12,Z=Z+he|0,b^=Z,b=b>>>32-16|b<<16,l=l+b|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,E^=ne,E=E>>>32-16|E<<16,h=h+E|0,L^=h,L=L>>>32-12|L<<12,V=V+j|0,M^=V,M=M>>>32-16|M<<16,v=v+M|0,j^=v,j=j>>>32-12|j<<12,ne=ne+L|0,E^=ne,E=E>>>32-8|E<<8,h=h+E|0,L^=h,L=L>>>32-7|L<<7,V=V+j|0,M^=V,M=M>>>32-8|M<<8,v=v+M|0,j^=v,j=j>>>32-7|j<<7,Z=Z+he|0,b^=Z,b=b>>>32-8|b<<8,l=l+b|0,he^=l,he=he>>>32-7|he<<7,ee=ee+H|0,S^=ee,S=S>>>32-8|S<<8,g=g+S|0,H^=g,H=H>>>32-7|H<<7;Qr.writeUint32LE(ee+n|0,r,0),Qr.writeUint32LE(Z+i|0,r,4),Qr.writeUint32LE(ne+s|0,r,8),Qr.writeUint32LE(V+f|0,r,12),Qr.writeUint32LE(j+u|0,r,16),Qr.writeUint32LE(H+d|0,r,20),Qr.writeUint32LE(he+y|0,r,24),Qr.writeUint32LE(L+w|0,r,28),Qr.writeUint32LE(h+A|0,r,32),Qr.writeUint32LE(v+O|0,r,36),Qr.writeUint32LE(g+R|0,r,40),Qr.writeUint32LE(l+I|0,r,44),Qr.writeUint32LE(b+B|0,r,48),Qr.writeUint32LE(E+Y|0,r,52),Qr.writeUint32LE(M+P|0,r,56),Qr.writeUint32LE(S+J|0,r,60)}o($P,"core");function cw(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,f;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),f=s.length-e.length,s.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,f=i}for(var u=new Uint8Array(64),d=0;d<t.length;d+=64){$P(u,s,r);for(var y=d;y<d+64&&y<t.length;y++)n[y]=t[y]^u[y-d];jP(s,0,f)}return ob.wipe(u),i===0&&ob.wipe(s),n}o(cw,"streamXOR");Fd.streamXOR=cw;function qP(r,e,t,n){return n===void 0&&(n=0),ob.wipe(t),cw(r,e,t,t,n)}o(qP,"stream");Fd.stream=qP;function jP(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(jP,"incrementCounter")});var dw=Re(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});var Js=$a(),uw=xi(),HP=sb(),zP=20;function lw(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=hw(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var f=HP.streamXOR(i,s,t,n);return uw.wipe(i),f}o(lw,"streamXOR");Xu.streamXOR=lw;function KP(r,e,t){return uw.wipe(t),lw(r,e,t,t)}o(KP,"stream");Xu.stream=KP;function hw(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],d=r[7]<<24|r[6]<<16|r[5]<<8|r[4],y=r[11]<<24|r[10]<<16|r[9]<<8|r[8],w=r[15]<<24|r[14]<<16|r[13]<<8|r[12],A=r[19]<<24|r[18]<<16|r[17]<<8|r[16],O=r[23]<<24|r[22]<<16|r[21]<<8|r[20],R=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Z=i,ne=s,V=f,j=u,H=d,he=y,L=w,h=A,v=O,g=R,l=I,b=B,E=Y,M=P,S=J,x=0;x<zP;x+=2)ee=ee+j|0,b^=ee,b=b>>>32-16|b<<16,h=h+b|0,j^=h,j=j>>>32-12|j<<12,Z=Z+H|0,E^=Z,E=E>>>32-16|E<<16,v=v+E|0,H^=v,H=H>>>32-12|H<<12,ne=ne+he|0,M^=ne,M=M>>>32-16|M<<16,g=g+M|0,he^=g,he=he>>>32-12|he<<12,V=V+L|0,S^=V,S=S>>>32-16|S<<16,l=l+S|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,M^=ne,M=M>>>32-8|M<<8,g=g+M|0,he^=g,he=he>>>32-7|he<<7,V=V+L|0,S^=V,S=S>>>32-8|S<<8,l=l+S|0,L^=l,L=L>>>32-7|L<<7,Z=Z+H|0,E^=Z,E=E>>>32-8|E<<8,v=v+E|0,H^=v,H=H>>>32-7|H<<7,ee=ee+j|0,b^=ee,b=b>>>32-8|b<<8,h=h+b|0,j^=h,j=j>>>32-7|j<<7,ee=ee+H|0,S^=ee,S=S>>>32-16|S<<16,g=g+S|0,H^=g,H=H>>>32-12|H<<12,Z=Z+he|0,b^=Z,b=b>>>32-16|b<<16,l=l+b|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,E^=ne,E=E>>>32-16|E<<16,h=h+E|0,L^=h,L=L>>>32-12|L<<12,V=V+j|0,M^=V,M=M>>>32-16|M<<16,v=v+M|0,j^=v,j=j>>>32-12|j<<12,ne=ne+L|0,E^=ne,E=E>>>32-8|E<<8,h=h+E|0,L^=h,L=L>>>32-7|L<<7,V=V+j|0,M^=V,M=M>>>32-8|M<<8,v=v+M|0,j^=v,j=j>>>32-7|j<<7,Z=Z+he|0,b^=Z,b=b>>>32-8|b<<8,l=l+b|0,he^=l,he=he>>>32-7|he<<7,ee=ee+H|0,S^=ee,S=S>>>32-8|S<<8,g=g+S|0,H^=g,H=H>>>32-7|H<<7;return Js.writeUint32LE(ee,t,0),Js.writeUint32LE(Z,t,4),Js.writeUint32LE(ne,t,8),Js.writeUint32LE(V,t,12),Js.writeUint32LE(b,t,16),Js.writeUint32LE(E,t,20),Js.writeUint32LE(M,t,24),Js.writeUint32LE(S,t,28),t}o(hw,"hchacha");Xu.hchacha=hw});var ab=Re(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});function VP(r,e,t){return~(r-1)&e|r-1&t}o(VP,"select");yc.select=VP;function GP(r,e){return(r|0)-(e|0)-1>>>31&1}o(GP,"lessOrEqual");yc.lessOrEqual=GP;function pw(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(pw,"compare");yc.compare=pw;function WP(r,e){return r.length===0||e.length===0?!1:pw(r,e)!==0}o(WP,"equal");yc.equal=WP});var bw=Re(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var JP=ab(),$d=xi();fs.DIGEST_LENGTH=16;var mw=function(){function r(e){this.digestLength=fs.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 f=e[8]|e[9]<<8;this._r[4]=(s>>>4|f<<12)&255,this._r[5]=f>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(f>>>14|u<<2)&8191;var d=e[12]|e[13]<<8;this._r[7]=(u>>>11|d<<5)&8065;var y=e[14]|e[15]<<8;this._r[8]=(d>>>8|y<<8)&8191,this._r[9]=y>>>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],f=this._h[1],u=this._h[2],d=this._h[3],y=this._h[4],w=this._h[5],A=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],B=this._r[0],Y=this._r[1],P=this._r[2],J=this._r[3],ee=this._r[4],Z=this._r[5],ne=this._r[6],V=this._r[7],j=this._r[8],H=this._r[9];n>=16;){var he=e[t+0]|e[t+1]<<8;s+=he&8191;var L=e[t+2]|e[t+3]<<8;f+=(he>>>13|L<<3)&8191;var h=e[t+4]|e[t+5]<<8;u+=(L>>>10|h<<6)&8191;var v=e[t+6]|e[t+7]<<8;d+=(h>>>7|v<<9)&8191;var g=e[t+8]|e[t+9]<<8;y+=(v>>>4|g<<12)&8191,w+=g>>>1&8191;var l=e[t+10]|e[t+11]<<8;A+=(g>>>14|l<<2)&8191;var b=e[t+12]|e[t+13]<<8;O+=(l>>>11|b<<5)&8191;var E=e[t+14]|e[t+15]<<8;R+=(b>>>8|E<<8)&8191,I+=E>>>5|i;var M=0,S=M;S+=s*B,S+=f*(5*H),S+=u*(5*j),S+=d*(5*V),S+=y*(5*ne),M=S>>>13,S&=8191,S+=w*(5*Z),S+=A*(5*ee),S+=O*(5*J),S+=R*(5*P),S+=I*(5*Y),M+=S>>>13,S&=8191;var x=M;x+=s*Y,x+=f*B,x+=u*(5*H),x+=d*(5*j),x+=y*(5*V),M=x>>>13,x&=8191,x+=w*(5*ne),x+=A*(5*Z),x+=O*(5*ee),x+=R*(5*J),x+=I*(5*P),M+=x>>>13,x&=8191;var C=M;C+=s*P,C+=f*Y,C+=u*B,C+=d*(5*H),C+=y*(5*j),M=C>>>13,C&=8191,C+=w*(5*V),C+=A*(5*ne),C+=O*(5*Z),C+=R*(5*ee),C+=I*(5*J),M+=C>>>13,C&=8191;var N=M;N+=s*J,N+=f*P,N+=u*Y,N+=d*B,N+=y*(5*H),M=N>>>13,N&=8191,N+=w*(5*j),N+=A*(5*V),N+=O*(5*ne),N+=R*(5*Z),N+=I*(5*ee),M+=N>>>13,N&=8191;var _=M;_+=s*ee,_+=f*J,_+=u*P,_+=d*Y,_+=y*B,M=_>>>13,_&=8191,_+=w*(5*H),_+=A*(5*j),_+=O*(5*V),_+=R*(5*ne),_+=I*(5*Z),M+=_>>>13,_&=8191;var k=M;k+=s*Z,k+=f*ee,k+=u*J,k+=d*P,k+=y*Y,M=k>>>13,k&=8191,k+=w*B,k+=A*(5*H),k+=O*(5*j),k+=R*(5*V),k+=I*(5*ne),M+=k>>>13,k&=8191;var fe=M;fe+=s*ne,fe+=f*Z,fe+=u*ee,fe+=d*J,fe+=y*P,M=fe>>>13,fe&=8191,fe+=w*Y,fe+=A*B,fe+=O*(5*H),fe+=R*(5*j),fe+=I*(5*V),M+=fe>>>13,fe&=8191;var D=M;D+=s*V,D+=f*ne,D+=u*Z,D+=d*ee,D+=y*J,M=D>>>13,D&=8191,D+=w*P,D+=A*Y,D+=O*B,D+=R*(5*H),D+=I*(5*j),M+=D>>>13,D&=8191;var Q=M;Q+=s*j,Q+=f*V,Q+=u*ne,Q+=d*Z,Q+=y*ee,M=Q>>>13,Q&=8191,Q+=w*J,Q+=A*P,Q+=O*Y,Q+=R*B,Q+=I*(5*H),M+=Q>>>13,Q&=8191;var se=M;se+=s*H,se+=f*j,se+=u*V,se+=d*ne,se+=y*Z,M=se>>>13,se&=8191,se+=w*ee,se+=A*J,se+=O*P,se+=R*Y,se+=I*B,M+=se>>>13,se&=8191,M=(M<<2)+M|0,M=M+S|0,S=M&8191,M=M>>>13,x+=M,s=S,f=x,u=C,d=N,y=_,w=k,A=fe,O=D,R=Q,I=se,t+=16,n-=16}this._h[0]=s,this._h[1]=f,this._h[2]=u,this._h[3]=d,this._h[4]=y,this._h[5]=w,this._h[6]=A,this._h[7]=O,this._h[8]=R,this._h[9]=I},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,f,u;if(this._leftover){for(u=this._leftover,this._buffer[u++]=1;u<16;u++)this._buffer[u]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,u=2;u<10;u++)this._h[u]+=i,i=this._h[u]>>>13,this._h[u]&=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,u=1;u<10;u++)n[u]=this._h[u]+i,i=n[u]>>>13,n[u]&=8191;for(n[9]-=1<<13,s=(i^1)-1,u=0;u<10;u++)n[u]&=s;for(s=~s,u=0;u<10;u++)this._h[u]=this._h[u]&s|n[u];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,f=this._h[0]+this._pad[0],this._h[0]=f&65535,u=1;u<8;u++)f=(this._h[u]+this._pad[u]|0)+(f>>>16)|0,this._h[u]=f&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 $d.wipe(this._buffer),$d.wipe(this._r),$d.wipe(this._h),$d.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();fs.Poly1305=mw;function YP(r,e){var t=new mw(r);t.update(e);var n=t.digest();return t.clean(),n}o(YP,"oneTimeAuth");fs.oneTimeAuth=YP;function ZP(r,e){return r.length!==fs.DIGEST_LENGTH||e.length!==fs.DIGEST_LENGTH?!1:JP.equal(r,e)}o(ZP,"equal");fs.equal=ZP});var yw=Re(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var qd=sb(),XP=bw(),Qu=xi(),gw=$a(),QP=ab();cs.KEY_LENGTH=32;cs.NONCE_LENGTH=12;cs.TAG_LENGTH=16;var vw=new Uint8Array(16),eB=function(){function r(e){if(this.nonceLength=cs.NONCE_LENGTH,this.tagLength=cs.TAG_LENGTH,e.length!==cs.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 f=new Uint8Array(32);qd.stream(this._key,s,f,4);var u=t.length+this.tagLength,d;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");d=i}else d=new Uint8Array(u);return qd.streamXOR(this._key,s,t,d,4),this._authenticate(d.subarray(d.length-this.tagLength,d.length),f,d.subarray(0,d.length-this.tagLength),n),Qu.wipe(s),d},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 f=new Uint8Array(32);qd.stream(this._key,s,f,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,f,t.subarray(0,t.length-this.tagLength),n),!QP.equal(u,t.subarray(t.length-this.tagLength,t.length)))return null;var d=t.length-this.tagLength,y;if(i){if(i.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");y=i}else y=new Uint8Array(d);return qd.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),y,4),Qu.wipe(s),y},r.prototype.clean=function(){return Qu.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new XP.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(vw.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(vw.subarray(n.length%16));var f=new Uint8Array(8);i&&gw.writeUint64LE(i.length,f),s.update(f),gw.writeUint64LE(n.length,f),s.update(f);for(var u=s.digest(),d=0;d<u.length;d++)e[d]=u[d];s.clean(),Qu.wipe(u),Qu.wipe(f)},r}();cs.ChaCha20Poly1305=eB});var _w=Re(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var xw=dw(),ww=yw(),el=xi();us.KEY_LENGTH=32;us.NONCE_LENGTH=24;us.TAG_LENGTH=16;var tB=function(){function r(e){if(this.nonceLength=us.NONCE_LENGTH,this.tagLength=us.TAG_LENGTH,e.length!==us.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=xw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new ww.ChaCha20Poly1305(s),d=u.seal(f,t,n,i);return el.wipe(s),el.wipe(f),u.clean(),d},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=xw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new ww.ChaCha20Poly1305(s),d=u.open(f,t,n,i);return el.wipe(s),el.wipe(f),u.clean(),d},r.prototype.clean=function(){return el.wipe(this._key),this},r}();us.XChaCha20Poly1305=tB});var d5=Re(o0=>{"use strict";o0.byteLength=_L;o0.toByteArray=AL;o0.fromByteArray=TL;var So=[],Ti=[],wL=typeof Uint8Array<"u"?Uint8Array:Array,Ob="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(nf=0,l5=Ob.length;nf<l5;++nf)So[nf]=Ob[nf],Ti[Ob.charCodeAt(nf)]=nf;var nf,l5;Ti["-".charCodeAt(0)]=62;Ti["_".charCodeAt(0)]=63;function h5(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}o(h5,"getLens");function _L(r){var e=h5(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(_L,"byteLength");function EL(r,e,t){return(e+t)*3/4-t}o(EL,"_byteLength");function AL(r){var e,t=h5(r),n=t[0],i=t[1],s=new wL(EL(r,n,i)),f=0,u=i>0?n-4:n,d;for(d=0;d<u;d+=4)e=Ti[r.charCodeAt(d)]<<18|Ti[r.charCodeAt(d+1)]<<12|Ti[r.charCodeAt(d+2)]<<6|Ti[r.charCodeAt(d+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return i===2&&(e=Ti[r.charCodeAt(d)]<<2|Ti[r.charCodeAt(d+1)]>>4,s[f++]=e&255),i===1&&(e=Ti[r.charCodeAt(d)]<<10|Ti[r.charCodeAt(d+1)]<<4|Ti[r.charCodeAt(d+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}o(AL,"toByteArray");function SL(r){return So[r>>18&63]+So[r>>12&63]+So[r>>6&63]+So[r&63]}o(SL,"tripletToBase64");function ML(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push(SL(n));return i.join("")}o(ML,"encodeChunk");function TL(r){for(var e,t=r.length,n=t%3,i=[],s=16383,f=0,u=t-n;f<u;f+=s)i.push(ML(r,f,f+s>u?u:f+s));return n===1?(e=r[t-1],i.push(So[e>>2]+So[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(So[e>>10]+So[e>>4&63]+So[e<<2&63]+"=")),i.join("")}o(TL,"fromByteArray")});var p5=Re(Nb=>{Nb.read=function(r,e,t,n,i){var s,f,u=i*8-n-1,d=(1<<u)-1,y=d>>1,w=-7,A=t?i-1:0,O=t?-1:1,R=r[e+A];for(A+=O,s=R&(1<<-w)-1,R>>=-w,w+=u;w>0;s=s*256+r[e+A],A+=O,w-=8);for(f=s&(1<<-w)-1,s>>=-w,w+=n;w>0;f=f*256+r[e+A],A+=O,w-=8);if(s===0)s=1-y;else{if(s===d)return f?NaN:(R?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-y}return(R?-1:1)*f*Math.pow(2,s-n)};Nb.write=function(r,e,t,n,i,s){var f,u,d,y=s*8-i-1,w=(1<<y)-1,A=w>>1,O=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:s-1,I=n?1:-1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,f=w):(f=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-f))<1&&(f--,d*=2),f+A>=1?e+=O/d:e+=O*Math.pow(2,1-A),e*d>=2&&(f++,d/=2),f+A>=w?(u=0,f=w):f+A>=1?(u=(e*d-1)*Math.pow(2,i),f=f+A):(u=e*Math.pow(2,A-1)*Math.pow(2,i),f=0));i>=8;r[t+R]=u&255,R+=I,u/=256,i-=8);for(f=f<<i|u,y+=i;y>0;r[t+R]=f&255,R+=I,f/=256,y-=8);r[t+R-I]|=B*128}});var f0=Re(kc=>{"use strict";var Pb=d5(),Cc=p5(),m5=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;kc.Buffer=Se;kc.SlowBuffer=OL;kc.INSPECT_MAX_BYTES=50;var s0=2147483647;kc.kMaxLength=s0;Se.TYPED_ARRAY_SUPPORT=CL();!Se.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function CL(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}o(CL,"typedArraySupport");Object.defineProperty(Se.prototype,"parent",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.buffer}});Object.defineProperty(Se.prototype,"offset",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.byteOffset}});function hs(r){if(r>s0)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Se.prototype),e}o(hs,"createBuffer");function Se(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Fb(r)}return v5(r,e,t)}o(Se,"Buffer");Se.poolSize=8192;function v5(r,e,t){if(typeof r=="string")return IL(r,e);if(ArrayBuffer.isView(r))return DL(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Mo(r,ArrayBuffer)||r&&Mo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mo(r,SharedArrayBuffer)||r&&Mo(r.buffer,SharedArrayBuffer)))return Lb(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return Se.from(n,e,t);var i=RL(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Se.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o(v5,"from");Se.from=function(r,e,t){return v5(r,e,t)};Object.setPrototypeOf(Se.prototype,Uint8Array.prototype);Object.setPrototypeOf(Se,Uint8Array);function y5(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}o(y5,"assertSize");function kL(r,e,t){return y5(r),r<=0?hs(r):e!==void 0?typeof t=="string"?hs(r).fill(e,t):hs(r).fill(e):hs(r)}o(kL,"alloc");Se.alloc=function(r,e,t){return kL(r,e,t)};function Fb(r){return y5(r),hs(r<0?0:$b(r)|0)}o(Fb,"allocUnsafe");Se.allocUnsafe=function(r){return Fb(r)};Se.allocUnsafeSlow=function(r){return Fb(r)};function IL(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Se.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=x5(r,e)|0,n=hs(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(IL,"fromString");function Bb(r){for(var e=r.length<0?0:$b(r.length)|0,t=hs(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}o(Bb,"fromArrayLike");function DL(r){if(Mo(r,Uint8Array)){var e=new Uint8Array(r);return Lb(e.buffer,e.byteOffset,e.byteLength)}return Bb(r)}o(DL,"fromArrayView");function Lb(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,Se.prototype),n}o(Lb,"fromArrayBuffer");function RL(r){if(Se.isBuffer(r)){var e=$b(r.length)|0,t=hs(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||qb(r.length)?hs(0):Bb(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Bb(r.data)}o(RL,"fromObject");function $b(r){if(r>=s0)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s0.toString(16)+" bytes");return r|0}o($b,"checked");function OL(r){return+r!=r&&(r=0),Se.alloc(+r)}o(OL,"SlowBuffer");Se.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==Se.prototype},"isBuffer");Se.compare=o(function(e,t){if(Mo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),Mo(t,Uint8Array)&&(t=Se.from(t,t.offset,t.byteLength)),!Se.isBuffer(e)||!Se.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,s=0,f=Math.min(n,i);s<f;++s)if(e[s]!==t[s]){n=e[s],i=t[s];break}return n<i?-1:i<n?1:0},"compare");Se.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");Se.concat=o(function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Se.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=Se.allocUnsafe(t),s=0;for(n=0;n<e.length;++n){var f=e[n];if(Mo(f,Uint8Array))s+f.length>i.length?Se.from(f).copy(i,s):Uint8Array.prototype.set.call(i,f,s);else if(Se.isBuffer(f))f.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=f.length}return i},"concat");function x5(r,e){if(Se.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Mo(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Ub(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return M5(r).length;default:if(i)return n?-1:Ub(r).length;e=(""+e).toLowerCase(),i=!0}}o(x5,"byteLength");Se.byteLength=x5;function NL(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return zL(this,e,t);case"utf8":case"utf-8":return _5(this,e,t);case"ascii":return jL(this,e,t);case"latin1":case"binary":return HL(this,e,t);case"base64":return $L(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KL(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o(NL,"slowToString");Se.prototype._isBuffer=!0;function of(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}o(of,"swap");Se.prototype.swap16=o(function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)of(this,t,t+1);return this},"swap16");Se.prototype.swap32=o(function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)of(this,t,t+3),of(this,t+1,t+2);return this},"swap32");Se.prototype.swap64=o(function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)of(this,t,t+7),of(this,t+1,t+6),of(this,t+2,t+5),of(this,t+3,t+4);return this},"swap64");Se.prototype.toString=o(function(){var e=this.length;return e===0?"":arguments.length===0?_5(this,0,e):NL.apply(this,arguments)},"toString");Se.prototype.toLocaleString=Se.prototype.toString;Se.prototype.equals=o(function(e){if(!Se.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Se.compare(this,e)===0},"equals");Se.prototype.inspect=o(function(){var e="",t=kc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");m5&&(Se.prototype[m5]=Se.prototype.inspect);Se.prototype.compare=o(function(e,t,n,i,s){if(Mo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),!Se.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var f=s-i,u=n-t,d=Math.min(f,u),y=this.slice(i,s),w=e.slice(t,n),A=0;A<d;++A)if(y[A]!==w[A]){f=y[A],u=w[A];break}return f<u?-1:u<f?1:0},"compare");function w5(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,qb(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=Se.from(e,n)),Se.isBuffer(e))return e.length===0?-1:b5(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):b5(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(w5,"bidirectionalIndexOf");function b5(r,e,t,n,i){var s=1,f=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,f/=2,u/=2,t/=2}function d(R,I){return s===1?R[I]:R.readUInt16BE(I*s)}o(d,"read");var y;if(i){var w=-1;for(y=t;y<f;y++)if(d(r,y)===d(e,w===-1?0:y-w)){if(w===-1&&(w=y),y-w+1===u)return w*s}else w!==-1&&(y-=y-w),w=-1}else for(t+u>f&&(t=f-u),y=t;y>=0;y--){for(var A=!0,O=0;O<u;O++)if(d(r,y+O)!==d(e,O)){A=!1;break}if(A)return y}return-1}o(b5,"arrayIndexOf");Se.prototype.includes=o(function(e,t,n){return this.indexOf(e,t,n)!==-1},"includes");Se.prototype.indexOf=o(function(e,t,n){return w5(this,e,t,n,!0)},"indexOf");Se.prototype.lastIndexOf=o(function(e,t,n){return w5(this,e,t,n,!1)},"lastIndexOf");function PL(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var s=e.length;n>s/2&&(n=s/2);for(var f=0;f<n;++f){var u=parseInt(e.substr(f*2,2),16);if(qb(u))return f;r[t+f]=u}return f}o(PL,"hexWrite");function BL(r,e,t,n){return a0(Ub(e,r.length-t),r,t,n)}o(BL,"utf8Write");function LL(r,e,t,n){return a0(WL(e),r,t,n)}o(LL,"asciiWrite");function UL(r,e,t,n){return a0(M5(e),r,t,n)}o(UL,"base64Write");function FL(r,e,t,n){return a0(JL(e,r.length-t),r,t,n)}o(FL,"ucs2Write");Se.prototype.write=o(function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return PL(this,e,t,n);case"utf8":case"utf-8":return BL(this,e,t,n);case"ascii":case"latin1":case"binary":return LL(this,e,t,n);case"base64":return UL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return FL(this,e,t,n);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},"write");Se.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function $L(r,e,t){return e===0&&t===r.length?Pb.fromByteArray(r):Pb.fromByteArray(r.slice(e,t))}o($L,"base64Slice");function _5(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var s=r[i],f=null,u=s>239?4:s>223?3:s>191?2:1;if(i+u<=t){var d,y,w,A;switch(u){case 1:s<128&&(f=s);break;case 2:d=r[i+1],(d&192)===128&&(A=(s&31)<<6|d&63,A>127&&(f=A));break;case 3:d=r[i+1],y=r[i+2],(d&192)===128&&(y&192)===128&&(A=(s&15)<<12|(d&63)<<6|y&63,A>2047&&(A<55296||A>57343)&&(f=A));break;case 4:d=r[i+1],y=r[i+2],w=r[i+3],(d&192)===128&&(y&192)===128&&(w&192)===128&&(A=(s&15)<<18|(d&63)<<12|(y&63)<<6|w&63,A>65535&&A<1114112&&(f=A))}}f===null?(f=65533,u=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),i+=u}return qL(n)}o(_5,"utf8Slice");var g5=4096;function qL(r){var e=r.length;if(e<=g5)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=g5));return t}o(qL,"decodeCodePointsArray");function jL(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}o(jL,"asciiSlice");function HL(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}o(HL,"latin1Slice");function zL(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",s=e;s<t;++s)i+=YL[r[s]];return i}o(zL,"hexSlice");function KL(r,e,t){for(var n=r.slice(e,t),i="",s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}o(KL,"utf16leSlice");Se.prototype.slice=o(function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,Se.prototype),i},"slice");function Nr(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o(Nr,"checkOffset");Se.prototype.readUintLE=Se.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return i},"readUIntLE");Se.prototype.readUintBE=Se.prototype.readUIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=this[e+--t],s=1;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");Se.prototype.readUint8=Se.prototype.readUInt8=o(function(e,t){return e=e>>>0,t||Nr(e,1,this.length),this[e]},"readUInt8");Se.prototype.readUint16LE=Se.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||Nr(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");Se.prototype.readUint16BE=Se.prototype.readUInt16BE=o(function(e,t){return e=e>>>0,t||Nr(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");Se.prototype.readUint32LE=Se.prototype.readUInt32LE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");Se.prototype.readUint32BE=Se.prototype.readUInt32BE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");Se.prototype.readIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");Se.prototype.readIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=t,s=1,f=this[e+--i];i>0&&(s*=256);)f+=this[e+--i]*s;return s*=128,f>=s&&(f-=Math.pow(2,8*t)),f},"readIntBE");Se.prototype.readInt8=o(function(e,t){return e=e>>>0,t||Nr(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");Se.prototype.readInt16LE=o(function(e,t){e=e>>>0,t||Nr(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");Se.prototype.readInt16BE=o(function(e,t){e=e>>>0,t||Nr(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");Se.prototype.readInt32LE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");Se.prototype.readInt32BE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");Se.prototype.readFloatLE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),Cc.read(this,e,!0,23,4)},"readFloatLE");Se.prototype.readFloatBE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),Cc.read(this,e,!1,23,4)},"readFloatBE");Se.prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Cc.read(this,e,!0,52,8)},"readDoubleLE");Se.prototype.readDoubleBE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Cc.read(this,e,!1,52,8)},"readDoubleBE");function Cn(r,e,t,n,i,s){if(!Se.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}o(Cn,"checkInt");Se.prototype.writeUintLE=Se.prototype.writeUIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Cn(this,e,t,n,s,0)}var f=1,u=0;for(this[t]=e&255;++u<n&&(f*=256);)this[t+u]=e/f&255;return t+n},"writeUIntLE");Se.prototype.writeUintBE=Se.prototype.writeUIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Cn(this,e,t,n,s,0)}var f=n-1,u=1;for(this[t+f]=e&255;--f>=0&&(u*=256);)this[t+f]=e/u&255;return t+n},"writeUIntBE");Se.prototype.writeUint8=Se.prototype.writeUInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");Se.prototype.writeUint16LE=Se.prototype.writeUInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");Se.prototype.writeUint16BE=Se.prototype.writeUInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");Se.prototype.writeUint32LE=Se.prototype.writeUInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},"writeUInt32LE");Se.prototype.writeUint32BE=Se.prototype.writeUInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");Se.prototype.writeIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Cn(this,e,t,n,s-1,-s)}var f=0,u=1,d=0;for(this[t]=e&255;++f<n&&(u*=256);)e<0&&d===0&&this[t+f-1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntLE");Se.prototype.writeIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Cn(this,e,t,n,s-1,-s)}var f=n-1,u=1,d=0;for(this[t+f]=e&255;--f>=0&&(u*=256);)e<0&&d===0&&this[t+f+1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntBE");Se.prototype.writeInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");Se.prototype.writeInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");Se.prototype.writeInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");Se.prototype.writeInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");Se.prototype.writeInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");function E5(r,e,t,n,i,s){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}o(E5,"checkIEEE754");function A5(r,e,t,n,i){return e=+e,t=t>>>0,i||E5(r,e,t,4,34028234663852886e22,-34028234663852886e22),Cc.write(r,e,t,n,23,4),t+4}o(A5,"writeFloat");Se.prototype.writeFloatLE=o(function(e,t,n){return A5(this,e,t,!0,n)},"writeFloatLE");Se.prototype.writeFloatBE=o(function(e,t,n){return A5(this,e,t,!1,n)},"writeFloatBE");function S5(r,e,t,n,i){return e=+e,t=t>>>0,i||E5(r,e,t,8,17976931348623157e292,-17976931348623157e292),Cc.write(r,e,t,n,52,8),t+8}o(S5,"writeDouble");Se.prototype.writeDoubleLE=o(function(e,t,n){return S5(this,e,t,!0,n)},"writeDoubleLE");Se.prototype.writeDoubleBE=o(function(e,t,n){return S5(this,e,t,!1,n)},"writeDoubleBE");Se.prototype.copy=o(function(e,t,n,i){if(!Se.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var s=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),s},"copy");Se.prototype.fill=o(function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Se.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var f;if(typeof e=="number")for(f=t;f<n;++f)this[f]=e;else{var u=Se.isBuffer(e)?e:Se.from(e,i),d=u.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(f=0;f<n-t;++f)this[f+t]=u[f%d]}return this},"fill");var VL=/[^+/0-9A-Za-z-_]/g;function GL(r){if(r=r.split("=")[0],r=r.trim().replace(VL,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}o(GL,"base64clean");function Ub(r,e){e=e||1/0;for(var t,n=r.length,i=null,s=[],f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(Ub,"utf8ToBytes");function WL(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}o(WL,"asciiToBytes");function JL(r,e){for(var t,n,i,s=[],f=0;f<r.length&&!((e-=2)<0);++f)t=r.charCodeAt(f),n=t>>8,i=t%256,s.push(i),s.push(n);return s}o(JL,"utf16leToBytes");function M5(r){return Pb.toByteArray(GL(r))}o(M5,"base64ToBytes");function a0(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}o(a0,"blitBuffer");function Mo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}o(Mo,"isInstance");function qb(r){return r!==r}o(qb,"numberIsNaN");var YL=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)e[n+i]=r[t]+r[i];return e}()});var Zi=Re((gJ,T5)=>{T5.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 ul=Re((vJ,C5)=>{C5.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 I5=Re(Pr=>{var{Buffer:Mr}=f0(),c0=4294967292,u0=4294967293,jb=4294967294,k5=4294967295,Ue=[0,1,3,7,15,31,63,127,255,511,1023],Qs=["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"],ZL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Jn=[];ZL.forEach(r=>{Jn.push(r.charCodeAt(0))});Pr.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&Ue[5])),e.push(128+(t&Ue[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]));else if(t>=65536&&t<=1114111){let n=t>>16&Ue[5];e.push(240+(n>>2)),e.push(128+((n&Ue[2])<<4)+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Mr.from(e)},decode(r,e){function t(I,B){if((B&192)!==128)return u0;let Y=((I&Ue[5])<<6)+(B&Ue[6]);return Y<128?c0:Y}o(t,"bytes2");function n(I,B,Y){if((Y&192)!==128||(B&192)!==128)return u0;let P=((I&Ue[4])<<12)+((B&Ue[6])<<6)+(Y&Ue[6]);return P<2048?c0:P>=55296&&P<=57343?jb:P}o(n,"bytes3");function i(I,B,Y,P){if((P&192)!==128||(Y&192)!==128||(B&192)!==128)return u0;let J=(((I&Ue[3])<<2)+(B>>4&Ue[2])<<16)+((B&Ue[4])<<12)+((Y&Ue[6])<<6)+(P&Ue[6]);return J<65536?c0:J>1114111?jb:J}o(i,"bytes4");let s,f,u,d,y,w,A=r.length,O=e?3:0,R=[];for(;O<A;){f=r[O],s=k5;let I=!0;for(;I;){if(f>=0&&f<=127){s=f,w=1;break}if(u=O+1,u<A&&f>=194&&f<=223){s=t(f,r[u]),w=2;break}if(d=O+2,d<A&&f>=224&&f<=239){s=n(f,r[u],r[d]),w=3;break}if(y=O+3,y<A&&f>=240&&f<=244){s=i(f,r[u],r[d],r[y]),w=4;break}break}if(s>1114111){let B=`byte[${O}]`;throw s===k5?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${B}`):s===u0?new RangeError(`utf8.decode: illegal trailing byte found at: ${B}`):s===jb?new RangeError(`utf8.decode: code point out of range found at: ${B}`):s===c0?new RangeError(`utf8.decode: non-shortest form found at: ${B}`):new RangeError(`utf8.decode: unrecognized error found at: ${B}`)}R.push(s),O+=w}return R}};Pr.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&Ue[8]),e.push(t&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n>>8&Ue[8]),e.push(n&Ue[8]),e.push(i>>8&Ue[8]),e.push(i&Ue[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Mr.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,f,u,d,y,w,A;for(;i<n;){for(;;){if(d=i+1,d<n){if(w=(r[i]<<8)+r[d],w<55296||w>57343){f=w,u=2;break}if(y=i+3,y<n&&(A=(r[i+2]<<8)+r[y],w<=56319&&A>=56320&&A<=57343)){f=65536+(w-55296<<10)+(A-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Pr.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&Ue[8]),e.push(t>>8&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n&Ue[8]),e.push(n>>8&Ue[8]),e.push(i&Ue[8]),e.push(i>>8&Ue[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Mr.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,f,u,d,y,w,A;for(;i<n;){for(;;){if(d=i+1,d<n){if(w=(r[d]<<8)+r[i],w<55296||w>57343){f=w,u=2;break}if(y=i+3,y<n&&(A=(r[y]<<8)+r[i+2],w<=56319&&A>=56320&&A<=57343)){f=65536+(w-55296<<10)+(A-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Pr.utf32be={encode(r){let e=Mr.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&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Pr.utf32le={encode(r){let e=Mr.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&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Pr.uint7={encode(r){let e=Mr.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}};Pr.uint8={encode(r){let e=Mr.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}};Pr.uint16be={encode(r){let e=Mr.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&Ue[8],e[t++]=n&Ue[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}};Pr.uint16le={encode(r){let e=Mr.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&Ue[8],e[t++]=n>>8&Ue[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}};Pr.uint32be={encode(r){let e=Mr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Pr.uint32le={encode(r){let e=Mr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Pr.string={encode(r){return Pr.utf16le.encode(r).toString("utf16le")},decode(r){return Pr.utf16le.decode(Mr.from(r,"utf16le"),0)}};Pr.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${Qs[n]}`;else if(n>=127&&n<=255)i+=`\`x${Qs[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Qs[n>>8&Ue[8]]}${Qs[n&Ue[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let f=n>>24&Ue[8];f>0&&(i+=Qs[f]),i+=`${Qs[n>>16&Ue[8]]+Qs[n>>8&Ue[8]]+Qs[n&Ue[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Mr.from(i).forEach(f=>{e.push(f)})}}return Mr.from(e)},decode(r){function e(A){return A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102}o(e,"isHex");function t(A,O,R){let I={char:null,nexti:A+2,error:!0};if(A+1<O&&e(R[A])&&e(R[A+1])){let B=String.fromCodePoint(R[A],R[A+1]);I.char=parseInt(B,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(t,"getx");function n(A,O,R){let I={char:null,nexti:A+4,error:!0};if(A+3<O&&e(R[A])&&e(R[A+1])&&e(R[A+2])&&e(R[A+3])){let B=String.fromCodePoint(R[A],R[A+1],R[A+2],R[A+3]);I.char=parseInt(B,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(n,"getu");function i(A,O,R){let I={char:null,nexti:A+4,error:!0},B="";for(;A<O&&e(R[A]);)B+=String.fromCodePoint(R[A]),A+=1;return I.char=parseInt(B,16),R[A]===125&&!Number.isNaN(I.char)&&(I.error=!1),I.nexti=A+1,I}o(i,"getU");let s=[],f=r.length,u,d,y,w=0;for(;w<f;){for(;;){if(y=!0,r[w]!==96){s.push(r[w]),w+=1,y=!1;break}if(u=w+1,u>=f)break;if(r[u]===96){s.push(96),w+=2,y=!1;break}if(r[u]===120){if(d=t(u+1,f,r),d.error)break;s.push(d.char),w=d.nexti,y=!1;break}if(r[u]===117){if(r[u+1]===123){if(d=i(u+2,f,r),d.error)break;s.push(d.char),w=d.nexti,y=!1;break}if(d=n(u+1,f,r),d.error)break;s.push(d.char),w=d.nexti,y=!1;break}break}if(y)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${w}]`)}return s}};var ll=13,Ci=10;Pr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case ll:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(ll),e.push(Ci);break;case Ci:e.push(ll),e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&(e.push(ll),e.push(Ci)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case ll:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(Ci);break;case Ci:e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&e.push(Ci),e}};Pr.base64={encode(r){if(r.length===0)return Mr.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,f=Mr.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let u=0;u<s;u+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],f[t++]=Jn[n>>18&Ue[6]],f[t++]=Jn[n>>12&Ue[6]],f[t++]=Jn[n>>6&Ue[6]],f[t++]=Jn[n&Ue[6]];if(i===0)return f;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,f[t++]=Jn[n>>18&Ue[6]],f[t++]=Jn[n>>12&Ue[6]],f[t++]=Jn[n>>6&Ue[6]],f[t]=Jn[64],f;if(i===2)return n=r[e]<<16,f[t++]=Jn[n>>18&Ue[6]],f[t++]=Jn[n>>12&Ue[6]],f[t++]=Jn[64],f[t]=Jn[64],f},decode(r){function e(w){let A=[],O=0;for(let R=0;R<w.length;R+=1){let I=w[R],B=!0;for(;B&&!(I===32||I===9||I===10||I===13);){if(I>=65&&I<=90){A.push(I-65);break}if(I>=97&&I<=122){A.push(I-71);break}if(I>=48&&I<=57){A.push(I+4);break}if(I===43){A.push(62);break}if(I===47){A.push(63);break}if(I===61){A.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${I}`)}}if(A.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${A.length}`);switch(O){case 0:break;case 1:if(A[A.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(A[A.length-1]!==64||A[A.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: ${O}`)}return{tail:O,buf:Mr.from(A)}}if(o(e,"validate"),r.length===0)return Mr.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,f,u,d=i.length/4,y=Mr.alloc(d*3-n);n>0&&(d-=1),f=0,s=0;for(let w=0;w<d;w+=1)u=i[s++]<<18,u+=i[s++]<<12,u+=i[s++]<<6,u+=i[s++],y[f++]=u>>16&Ue[8],y[f++]=u>>8&Ue[8],y[f++]=u&Ue[8];return n===1&&(u=i[s++]<<18,u+=i[s++]<<12,u+=i[s]<<6,y[f++]=u>>16&Ue[8],y[f]=u>>8&Ue[8]),n===2&&(u=i[s++]<<18,u+=i[s++]<<12,y[f]=u>>16&Ue[8]),y},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,f,u,d){switch(t){case 76:e+=`\r
34
+ `});var u1=Gt(()=>{ji();rd();Ls();s1();Fa()});var $u,xV,l1=Gt(()=>{k3();I3();D3();R3();O3();Qm();tc();Qh();ed();P3();Uu();c1();K3();V3();u1();$u={...Gm,...Wm,...Jm,...Ym,...Zm,...Xm,...e1,...t1,...r1,...n1},xV={...a1,...f1}});function Y3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var J3,h1,UR,fd,d1=Gt(()=>{l1();Wh();o(Y3,"createCodec");J3=Y3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),h1=Y3("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=Nu(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),UR={utf8:J3,"utf-8":J3,hex:$u.base16,latin1:h1,ascii:h1,binary:h1,...$u},fd=UR});var Z3={};Zt(Z3,{fromString:()=>$t});function $t(r,e="utf8"){let t=fd[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ba(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var cd=Gt(()=>{d1();Ou();o($t,"fromString")});var X3={};Zt(X3,{toString:()=>Rt});function Rt(r,e="utf8"){let t=fd[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var ic=Gt(()=>{d1();o(Rt,"toString")});var Q3=Re(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});function FR(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(FR,"imulShim");Hn.mul=Math.imul||FR;function $R(r,e){return r+e|0}o($R,"add");Hn.add=$R;function qR(r,e){return r-e|0}o(qR,"sub");Hn.sub=qR;function jR(r,e){return r<<e|r>>>32-e}o(jR,"rotl");Hn.rotl=jR;function HR(r,e){return r<<32-e|r>>>e}o(HR,"rotr");Hn.rotr=HR;function zR(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(zR,"isIntegerShim");Hn.isInteger=Number.isInteger||zR;Hn.MAX_SAFE_INTEGER=9007199254740991;Hn.isSafeInteger=function(r){return Hn.isInteger(r)&&r>=-Hn.MAX_SAFE_INTEGER&&r<=Hn.MAX_SAFE_INTEGER}});var $a=Re(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});var ex=Q3();function KR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(KR,"readInt16BE");It.readInt16BE=KR;function VR(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(VR,"readUint16BE");It.readUint16BE=VR;function GR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(GR,"readInt16LE");It.readInt16LE=GR;function WR(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(WR,"readUint16LE");It.readUint16LE=WR;function tx(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(tx,"writeUint16BE");It.writeUint16BE=tx;It.writeInt16BE=tx;function rx(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(rx,"writeUint16LE");It.writeUint16LE=rx;It.writeInt16LE=rx;function p1(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(p1,"readInt32BE");It.readInt32BE=p1;function m1(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(m1,"readUint32BE");It.readUint32BE=m1;function b1(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(b1,"readInt32LE");It.readInt32LE=b1;function g1(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(g1,"readUint32LE");It.readUint32LE=g1;function ud(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(ud,"writeUint32BE");It.writeUint32BE=ud;It.writeInt32BE=ud;function ld(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(ld,"writeUint32LE");It.writeUint32LE=ld;It.writeInt32LE=ld;function JR(r,e){e===void 0&&(e=0);var t=p1(r,e),n=p1(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(JR,"readInt64BE");It.readInt64BE=JR;function YR(r,e){e===void 0&&(e=0);var t=m1(r,e),n=m1(r,e+4);return t*4294967296+n}o(YR,"readUint64BE");It.readUint64BE=YR;function ZR(r,e){e===void 0&&(e=0);var t=b1(r,e),n=b1(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(ZR,"readInt64LE");It.readInt64LE=ZR;function XR(r,e){e===void 0&&(e=0);var t=g1(r,e),n=g1(r,e+4);return n*4294967296+t}o(XR,"readUint64LE");It.readUint64LE=XR;function nx(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ud(r/4294967296>>>0,e,t),ud(r>>>0,e,t+4),e}o(nx,"writeUint64BE");It.writeUint64BE=nx;It.writeInt64BE=nx;function ix(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ld(r>>>0,e,t),ld(r/4294967296>>>0,e,t+4),e}o(ix,"writeUint64LE");It.writeUint64LE=ix;It.writeInt64LE=ix;function QR(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(QR,"readUintBE");It.readUintBE=QR;function eO(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(eO,"readUintLE");It.readUintLE=eO;function tO(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(!ex.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(tO,"writeUintBE");It.writeUintBE=tO;function rO(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(!ex.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(rO,"writeUintLE");It.writeUintLE=rO;function nO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(nO,"readFloat32BE");It.readFloat32BE=nO;function iO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(iO,"readFloat32LE");It.readFloat32LE=iO;function oO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(oO,"readFloat64BE");It.readFloat64BE=oO;function sO(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(sO,"readFloat64LE");It.readFloat64LE=sO;function aO(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(aO,"writeFloat32BE");It.writeFloat32BE=aO;function fO(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(fO,"writeFloat32LE");It.writeFloat32LE=fO;function cO(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(cO,"writeFloat64BE");It.writeFloat64BE=cO;function uO(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(uO,"writeFloat64LE");It.writeFloat64LE=uO});var xi=Re(v1=>{"use strict";Object.defineProperty(v1,"__esModule",{value:!0});function lO(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(lO,"wipe");v1.wipe=lO});var sx=Re($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var dd=$a(),hd=xi();$s.DIGEST_LENGTH=32;$s.BLOCK_SIZE=64;var ox=function(){function r(){this.digestLength=$s.DIGEST_LENGTH,this.blockSize=$s.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(){hd.wipe(this._buffer),hd.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&&(y1(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=y1(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,f=t%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;dd.writeUint32BE(i,this._buffer,f-8),dd.writeUint32BE(s,this._buffer,f-4),y1(this._temp,this._state,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)dd.writeUint32BE(this._state[u],e,u*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){hd.wipe(e.state),e.buffer&&hd.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();$s.SHA256=ox;var hO=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 y1(r,e,t,n,i){for(;i>=64;){for(var s=e[0],f=e[1],u=e[2],d=e[3],y=e[4],w=e[5],A=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;r[R]=dd.readUint32BE(t,I)}for(var R=16;R<64;R++){var B=r[R-2],Y=(B>>>17|B<<32-17)^(B>>>19|B<<32-19)^B>>>10;B=r[R-15];var P=(B>>>7|B<<32-7)^(B>>>18|B<<32-18)^B>>>3;r[R]=(Y+r[R-7]|0)+(P+r[R-16]|0)}for(var R=0;R<64;R++){var Y=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&w^~y&A)|0)+(O+(hO[R]+r[R]|0)|0)|0,P=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&f^s&u^f&u)|0;O=A,A=w,w=y,y=d+Y|0,d=u,u=f,f=s,s=Y+P|0}e[0]+=s,e[1]+=f,e[2]+=u,e[3]+=d,e[4]+=y,e[5]+=w,e[6]+=A,e[7]+=O,n+=64,i-=64}return n}o(y1,"hashBlocks");function dO(r){var e=new ox;e.update(r);var t=e.digest();return e.clean(),t}o(dO,"hash");$s.hash=dO});var x1=Re((zV,pd)=>{(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 f=!n.JS_SHA3_NO_COMMON_JS&&typeof pd=="object"&&pd.exports,u=typeof define=="function"&&define.amd,d=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",y="0123456789abcdef".split(""),w=[31,7936,2031616,520093696],A=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],B=[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],Y=[224,256,384,512],P=[128,256],J=["hex","buffer","arrayBuffer","array","digest"],ee={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),d&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var Z=o(function(D,Q,se){return function(q){return new _(D,Q,D).update(q)[se]()}},"createOutputMethod"),ne=o(function(D,Q,se){return function(q,z){return new _(D,Q,z).update(q)[se]()}},"createShakeOutputMethod"),V=o(function(D,Q,se){return function(q,z,G,te){return l["cshake"+D].update(q,z,G,te)[se]()}},"createCshakeOutputMethod"),j=o(function(D,Q,se){return function(q,z,G,te){return l["kmac"+D].update(q,z,G,te)[se]()}},"createKmacOutputMethod"),H=o(function(D,Q,se,q){for(var z=0;z<J.length;++z){var G=J[z];D[G]=Q(se,q,G)}return D},"createOutputMethods"),he=o(function(D,Q){var se=Z(D,Q,"hex");return se.create=function(){return new _(D,Q,D)},se.update=function(q){return se.create().update(q)},H(se,Z,D,Q)},"createMethod"),L=o(function(D,Q){var se=ne(D,Q,"hex");return se.create=function(q){return new _(D,Q,q)},se.update=function(q,z){return se.create(z).update(q)},H(se,ne,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=ee[D],q=V(D,Q,"hex");return q.create=function(z,G,te){return!G&&!te?l["shake"+D].create(z):new _(D,Q,z).bytepad([G,te],se)},q.update=function(z,G,te,ae){return q.create(G,te,ae).update(z)},H(q,V,D,Q)},"createCshakeMethod"),v=o(function(D,Q){var se=ee[D],q=j(D,Q,"hex");return q.create=function(z,G,te){return new k(D,Q,G).bytepad(["KMAC",te],se).bytepad([z],se)},q.update=function(z,G,te,ae){return q.create(z,te,ae).update(G)},H(q,j,D,Q)},"createKmacMethod"),g=[{name:"keccak",padding:O,bits:Y,createMethod:he},{name:"sha3",padding:R,bits:Y,createMethod:he},{name:"shake",padding:w,bits:P,createMethod:L},{name:"cshake",padding:A,bits:P,createMethod:h},{name:"kmac",padding:A,bits:P,createMethod:v}],l={},b=[],E=0;E<g.length;++E)for(var M=g[E],S=M.bits,x=0;x<S.length;++x){var C=M.name+"_"+S[x];if(b.push(C),l[C]=M.createMethod(S[x],M.padding),M.name!=="sha3"){var N=M.name+S[x];b.push(N),l[N]=l[C]}}function _(D,Q,se){this.blocks=[],this.s=[],this.padding=Q,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=se>>5,this.extraBytes=(se&31)>>3;for(var q=0;q<50;++q)this.s[q]=0}o(_,"Keccak"),_.prototype.update=function(D){if(this.finalized)throw new Error(e);var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}for(var q=this.blocks,z=this.byteCount,G=D.length,te=this.blockCount,ae=0,Ae=this.s,ge,ie;ae<G;){if(this.reset)for(this.reset=!1,q[0]=this.block,ge=1;ge<te+1;++ge)q[ge]=0;if(Q)for(ge=this.start;ae<G&&ge<z;++ae)q[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<G&&ge<z;++ae)ie=D.charCodeAt(ae),ie<128?q[ge>>2]|=ie<<I[ge++&3]:ie<2048?(q[ge>>2]|=(192|ie>>6)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):ie<55296||ie>=57344?(q[ge>>2]|=(224|ie>>12)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]):(ie=65536+((ie&1023)<<10|D.charCodeAt(++ae)&1023),q[ge>>2]|=(240|ie>>18)<<I[ge++&3],q[ge>>2]|=(128|ie>>12&63)<<I[ge++&3],q[ge>>2]|=(128|ie>>6&63)<<I[ge++&3],q[ge>>2]|=(128|ie&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=z){for(this.start=ge-z,this.block=q[te],ge=0;ge<te;++ge)Ae[ge]^=q[ge];fe(Ae),this.reset=!0}else this.start=ge}return this},_.prototype.encode=function(D,Q){var se=D&255,q=1,z=[se];for(D=D>>8,se=D&255;se>0;)z.unshift(se),D=D>>8,se=D&255,++q;return Q?z.push(q):z.unshift(q),this.update(z),z.length},_.prototype.encodeString=function(D){var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(r);if(d&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!d||!ArrayBuffer.isView(D)))throw new Error(r)}else throw new Error(r);Q=!0}var q=0,z=D.length;if(Q)q=z;else for(var G=0;G<D.length;++G){var te=D.charCodeAt(G);te<128?q+=1:te<2048?q+=2:te<55296||te>=57344?q+=3:(te=65536+((te&1023)<<10|D.charCodeAt(++G)&1023),q+=4)}return q+=this.encode(q*8),this.update(D),q},_.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),q=0;q<D.length;++q)se+=this.encodeString(D[q]);var z=Q-se%Q,G=[];return G.length=z,this.update(G),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,q=this.s;if(D[Q>>2]|=this.padding[Q&3],this.lastByteIndex===this.byteCount)for(D[0]=D[se],Q=1;Q<se+1;++Q)D[Q]=0;for(D[se-1]|=2147483648,Q=0;Q<se;++Q)q[Q]^=D[Q];fe(q)}},_.prototype.toString=_.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,z=0,G=0,te="",ae;G<se;){for(z=0;z<D&&G<se;++z,++G)ae=Q[z],te+=y[ae>>4&15]+y[ae&15]+y[ae>>12&15]+y[ae>>8&15]+y[ae>>20&15]+y[ae>>16&15]+y[ae>>28&15]+y[ae>>24&15];G%D===0&&(fe(Q),z=0)}return q&&(ae=Q[z],te+=y[ae>>4&15]+y[ae&15],q>1&&(te+=y[ae>>12&15]+y[ae>>8&15]),q>2&&(te+=y[ae>>20&15]+y[ae>>16&15])),te},_.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,z=0,G=0,te=this.outputBits>>3,ae;q?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(te);for(var Ae=new Uint32Array(ae);G<se;){for(z=0;z<D&&G<se;++z,++G)Ae[G]=Q[z];G%D===0&&fe(Q)}return q&&(Ae[z]=Q[z],ae=ae.slice(0,te)),ae},_.prototype.buffer=_.prototype.arrayBuffer,_.prototype.digest=_.prototype.array=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,q=this.extraBytes,z=0,G=0,te=[],ae,Ae;G<se;){for(z=0;z<D&&G<se;++z,++G)ae=G<<2,Ae=Q[z],te[ae]=Ae&255,te[ae+1]=Ae>>8&255,te[ae+2]=Ae>>16&255,te[ae+3]=Ae>>24&255;G%D===0&&fe(Q)}return q&&(ae=G<<2,Ae=Q[z],te[ae]=Ae&255,q>1&&(te[ae+1]=Ae>>8&255),q>2&&(te[ae+2]=Ae>>16&255)),te};function k(D,Q,se){_.call(this,D,Q,se)}o(k,"Kmac"),k.prototype=new _,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),_.prototype.finalize.call(this)};var fe=o(function(D){var Q,se,q,z,G,te,ae,Ae,ge,ie,Me,ue,ve,W,pe,ke,ze,Pe,Je,gr,le,oe,F,X,me,ye,we,Ie,Ot,Fe,Ne,Ut,Ve,Ze,Pn,st,at,ii,ft,rt,oi,ct,ut,mn,lt,Qe,si,ht,dt,ai,pt,mt,fi,bt,nt,Bn,jt,Ht,bn,gn,vn,Fr,yn;for(q=0;q<48;q+=2)z=D[0]^D[10]^D[20]^D[30]^D[40],G=D[1]^D[11]^D[21]^D[31]^D[41],te=D[2]^D[12]^D[22]^D[32]^D[42],ae=D[3]^D[13]^D[23]^D[33]^D[43],Ae=D[4]^D[14]^D[24]^D[34]^D[44],ge=D[5]^D[15]^D[25]^D[35]^D[45],ie=D[6]^D[16]^D[26]^D[36]^D[46],Me=D[7]^D[17]^D[27]^D[37]^D[47],ue=D[8]^D[18]^D[28]^D[38]^D[48],ve=D[9]^D[19]^D[29]^D[39]^D[49],Q=ue^(te<<1|ae>>>31),se=ve^(ae<<1|te>>>31),D[0]^=Q,D[1]^=se,D[10]^=Q,D[11]^=se,D[20]^=Q,D[21]^=se,D[30]^=Q,D[31]^=se,D[40]^=Q,D[41]^=se,Q=z^(Ae<<1|ge>>>31),se=G^(ge<<1|Ae>>>31),D[2]^=Q,D[3]^=se,D[12]^=Q,D[13]^=se,D[22]^=Q,D[23]^=se,D[32]^=Q,D[33]^=se,D[42]^=Q,D[43]^=se,Q=te^(ie<<1|Me>>>31),se=ae^(Me<<1|ie>>>31),D[4]^=Q,D[5]^=se,D[14]^=Q,D[15]^=se,D[24]^=Q,D[25]^=se,D[34]^=Q,D[35]^=se,D[44]^=Q,D[45]^=se,Q=Ae^(ue<<1|ve>>>31),se=ge^(ve<<1|ue>>>31),D[6]^=Q,D[7]^=se,D[16]^=Q,D[17]^=se,D[26]^=Q,D[27]^=se,D[36]^=Q,D[37]^=se,D[46]^=Q,D[47]^=se,Q=ie^(z<<1|G>>>31),se=Me^(G<<1|z>>>31),D[8]^=Q,D[9]^=se,D[18]^=Q,D[19]^=se,D[28]^=Q,D[29]^=se,D[38]^=Q,D[39]^=se,D[48]^=Q,D[49]^=se,W=D[0],pe=D[1],Qe=D[11]<<4|D[10]>>>28,si=D[10]<<4|D[11]>>>28,Ie=D[20]<<3|D[21]>>>29,Ot=D[21]<<3|D[20]>>>29,gn=D[31]<<9|D[30]>>>23,vn=D[30]<<9|D[31]>>>23,ct=D[40]<<18|D[41]>>>14,ut=D[41]<<18|D[40]>>>14,Ze=D[2]<<1|D[3]>>>31,Pn=D[3]<<1|D[2]>>>31,ke=D[13]<<12|D[12]>>>20,ze=D[12]<<12|D[13]>>>20,ht=D[22]<<10|D[23]>>>22,dt=D[23]<<10|D[22]>>>22,Fe=D[33]<<13|D[32]>>>19,Ne=D[32]<<13|D[33]>>>19,Fr=D[42]<<2|D[43]>>>30,yn=D[43]<<2|D[42]>>>30,bt=D[5]<<30|D[4]>>>2,nt=D[4]<<30|D[5]>>>2,st=D[14]<<6|D[15]>>>26,at=D[15]<<6|D[14]>>>26,Pe=D[25]<<11|D[24]>>>21,Je=D[24]<<11|D[25]>>>21,ai=D[34]<<15|D[35]>>>17,pt=D[35]<<15|D[34]>>>17,Ut=D[45]<<29|D[44]>>>3,Ve=D[44]<<29|D[45]>>>3,X=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Bn=D[17]<<23|D[16]>>>9,jt=D[16]<<23|D[17]>>>9,ii=D[26]<<25|D[27]>>>7,ft=D[27]<<25|D[26]>>>7,gr=D[36]<<21|D[37]>>>11,le=D[37]<<21|D[36]>>>11,mt=D[47]<<24|D[46]>>>8,fi=D[46]<<24|D[47]>>>8,mn=D[8]<<27|D[9]>>>5,lt=D[9]<<27|D[8]>>>5,ye=D[18]<<20|D[19]>>>12,we=D[19]<<20|D[18]>>>12,Ht=D[29]<<7|D[28]>>>25,bn=D[28]<<7|D[29]>>>25,rt=D[38]<<8|D[39]>>>24,oi=D[39]<<8|D[38]>>>24,oe=D[48]<<14|D[49]>>>18,F=D[49]<<14|D[48]>>>18,D[0]=W^~ke&Pe,D[1]=pe^~ze&Je,D[10]=X^~ye&Ie,D[11]=me^~we&Ot,D[20]=Ze^~st&ii,D[21]=Pn^~at&ft,D[30]=mn^~Qe&ht,D[31]=lt^~si&dt,D[40]=bt^~Bn&Ht,D[41]=nt^~jt&bn,D[2]=ke^~Pe&gr,D[3]=ze^~Je&le,D[12]=ye^~Ie&Fe,D[13]=we^~Ot&Ne,D[22]=st^~ii&rt,D[23]=at^~ft&oi,D[32]=Qe^~ht&ai,D[33]=si^~dt&pt,D[42]=Bn^~Ht&gn,D[43]=jt^~bn&vn,D[4]=Pe^~gr&oe,D[5]=Je^~le&F,D[14]=Ie^~Fe&Ut,D[15]=Ot^~Ne&Ve,D[24]=ii^~rt&ct,D[25]=ft^~oi&ut,D[34]=ht^~ai&mt,D[35]=dt^~pt&fi,D[44]=Ht^~gn&Fr,D[45]=bn^~vn&yn,D[6]=gr^~oe&W,D[7]=le^~F&pe,D[16]=Fe^~Ut&X,D[17]=Ne^~Ve&me,D[26]=rt^~ct&Ze,D[27]=oi^~ut&Pn,D[36]=ai^~mt&mn,D[37]=pt^~fi&lt,D[46]=gn^~Fr&bt,D[47]=vn^~yn&nt,D[8]=oe^~W&ke,D[9]=F^~pe&ze,D[18]=Ut^~X&ye,D[19]=Ve^~me&we,D[28]=ct^~Ze&st,D[29]=ut^~Pn&at,D[38]=mt^~mn&Qe,D[39]=fi^~lt&si,D[48]=Fr^~bt&Bn,D[49]=yn^~nt&jt,D[0]^=B[q],D[1]^=B[q+1]},"f");if(f)pd.exports=l;else{for(E=0;E<b.length;++E)n[b[E]]=l[b[E]];u&&define(function(){return l})}})()});var ax=Re((KV,pO)=>{pO.exports={name:"elliptic",version:"6.6.1",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 w1=Re(()=>{});var mo=Re((fx,_1)=>{(function(r,e){"use strict";function t(L,h){if(!L)throw new Error(h||"Assertion failed")}o(t,"assert");function n(L,h){L.super_=h;var v=o(function(){},"TempCtor");v.prototype=h.prototype,L.prototype=new v,L.prototype.constructor=L}o(n,"inherits");function i(L,h,v){if(i.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(L||0,h||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<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=w1().Buffer}catch{}i.isBN=o(function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},"isBN"),i.max=o(function(h,v){return h.cmp(v)>0?h:v},"max"),i.min=o(function(h,v){return h.cmp(v)<0?h:v},"min"),i.prototype._init=o(function(h,v,g){if(typeof h=="number")return this._initNumber(h,v,g);if(typeof h=="object")return this._initArray(h,v,g);v==="hex"&&(v=16),t(v===(v|0)&&v>=2&&v<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(v===16?this._parseHex(h,l,g):(this._parseBase(h,v,l),g==="le"&&this._initArray(this.toArray(),v,g)))},"init"),i.prototype._initNumber=o(function(h,v,g){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(t(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),v,g)},"_initNumber"),i.prototype._initArray=o(function(h,v,g){if(t(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var b,E,M=0;if(g==="be")for(l=h.length-1,b=0;l>=0;l-=3)E=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[b]|=E<<M&67108863,this.words[b+1]=E>>>26-M&67108863,M+=24,M>=26&&(M-=26,b++);else if(g==="le")for(l=0,b=0;l<h.length;l+=3)E=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[b]|=E<<M&67108863,this.words[b+1]=E>>>26-M&67108863,M+=24,M>=26&&(M-=26,b++);return this.strip()},"_initArray");function f(L,h){var v=L.charCodeAt(h);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}o(f,"parseHex4Bits");function u(L,h,v){var g=f(L,v);return v-1>=h&&(g|=f(L,v-1)<<4),g}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,v,g){this.length=Math.ceil((h.length-v)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var b=0,E=0,M;if(g==="be")for(l=h.length-1;l>=v;l-=2)M=u(h,v,l)<<b,this.words[E]|=M&67108863,b>=18?(b-=18,E+=1,this.words[E]|=M>>>26):b+=8;else{var S=h.length-v;for(l=S%2===0?v+1:v;l<h.length;l+=2)M=u(h,v,l)<<b,this.words[E]|=M&67108863,b>=18?(b-=18,E+=1,this.words[E]|=M>>>26):b+=8}this.strip()},"_parseHex");function d(L,h,v,g){for(var l=0,b=Math.min(L.length,v),E=h;E<b;E++){var M=L.charCodeAt(E)-48;l*=g,M>=49?l+=M-49+10:M>=17?l+=M-17+10:l+=M}return l}o(d,"parseBase"),i.prototype._parseBase=o(function(h,v,g){this.words=[0],this.length=1;for(var l=0,b=1;b<=67108863;b*=v)l++;l--,b=b/v|0;for(var E=h.length-g,M=E%l,S=Math.min(E,E-M)+g,x=0,C=g;C<S;C+=l)x=d(h,C,C+l,v),this.imuln(b),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(M!==0){var N=1;for(x=d(h,C,h.length,v),C=0;C<M;C++)N*=v;this.imuln(N),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var v=0;v<this.length;v++)h.words[v]=this.words[v];h.length=this.length,h.negative=this.negative,h.red=this.red},"copy"),i.prototype.clone=o(function(){var h=new i(null);return this.copy(h),h},"clone"),i.prototype._expand=o(function(h){for(;this.length<h;)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 y=["","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"],w=[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],A=[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(h,v){h=h||10,v=v|0||1;var g;if(h===16||h==="hex"){g="";for(var l=0,b=0,E=0;E<this.length;E++){var M=this.words[E],S=((M<<l|b)&16777215).toString(16);b=M>>>24-l&16777215,l+=2,l>=26&&(l-=26,E--),b!==0||E!==this.length-1?g=y[6-S.length]+S+g:g=S+g}for(b!==0&&(g=b.toString(16)+g);g.length%v!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(h===(h|0)&&h>=2&&h<=36){var x=w[h],C=A[h];g="";var N=this.clone();for(N.negative=0;!N.isZero();){var _=N.modn(C).toString(h);N=N.idivn(C),N.isZero()?g=_+g:g=y[x-_.length]+_+g}for(this.isZero()&&(g="0"+g);g.length%v!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(h,v){return t(typeof s<"u"),this.toArrayLike(s,h,v)},"toBuffer"),i.prototype.toArray=o(function(h,v){return this.toArrayLike(Array,h,v)},"toArray"),i.prototype.toArrayLike=o(function(h,v,g){var l=this.byteLength(),b=g||Math.max(1,l);t(l<=b,"byte array longer than desired length"),t(b>0,"Requested array length <= 0"),this.strip();var E=v==="le",M=new h(b),S,x,C=this.clone();if(E){for(x=0;!C.isZero();x++)S=C.andln(255),C.iushrn(8),M[x]=S;for(;x<b;x++)M[x]=0}else{for(x=0;x<b-l;x++)M[x]=0;for(x=0;!C.isZero();x++)S=C.andln(255),C.iushrn(8),M[b-x-1]=S}return M},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var v=h,g=0;return v>=4096&&(g+=13,v>>>=13),v>=64&&(g+=7,v>>>=7),v>=8&&(g+=4,v>>>=4),v>=2&&(g+=2,v>>>=2),g+v},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var v=h,g=0;return(v&8191)===0&&(g+=13,v>>>=13),(v&127)===0&&(g+=7,v>>>=7),(v&15)===0&&(g+=4,v>>>=4),(v&3)===0&&(g+=2,v>>>=2),(v&1)===0&&g++,g},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],v=this._countBits(h);return(this.length-1)*26+v},"bitLength");function O(L){for(var h=new Array(L.bitLength()),v=0;v<h.length;v++){var g=v/26|0,l=v%26;h[v]=(L.words[g]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,v=0;v<this.length;v++){var g=this._zeroBits(this.words[v]);if(h+=g,g!==26)break}return h},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]|h.words[v];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return t((this.negative|h.negative)===0),this.iuor(h)},"ior"),i.prototype.or=o(function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},"or"),i.prototype.uor=o(function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(h){var v;this.length>h.length?v=h:v=this;for(var g=0;g<v.length;g++)this.words[g]=this.words[g]&h.words[g];return this.length=v.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return t((this.negative|h.negative)===0),this.iuand(h)},"iand"),i.prototype.and=o(function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},"and"),i.prototype.uand=o(function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(h){var v,g;this.length>h.length?(v=this,g=h):(v=h,g=this);for(var l=0;l<g.length;l++)this.words[l]=v.words[l]^g.words[l];if(this!==v)for(;l<v.length;l++)this.words[l]=v.words[l];return this.length=v.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return t((this.negative|h.negative)===0),this.iuxor(h)},"ixor"),i.prototype.xor=o(function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(h){t(typeof h=="number"&&h>=0);var v=Math.ceil(h/26)|0,g=h%26;this._expand(v),g>0&&v--;for(var l=0;l<v;l++)this.words[l]=~this.words[l]&67108863;return g>0&&(this.words[l]=~this.words[l]&67108863>>26-g),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,v){t(typeof h=="number"&&h>=0);var g=h/26|0,l=h%26;return this._expand(g+1),v?this.words[g]=this.words[g]|1<<l:this.words[g]=this.words[g]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var v;if(this.negative!==0&&h.negative===0)return this.negative=0,v=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,v=this.isub(h),h.negative=1,v._normSign();var g,l;this.length>h.length?(g=this,l=h):(g=h,l=this);for(var b=0,E=0;E<l.length;E++)v=(g.words[E]|0)+(l.words[E]|0)+b,this.words[E]=v&67108863,b=v>>>26;for(;b!==0&&E<g.length;E++)v=(g.words[E]|0)+b,this.words[E]=v&67108863,b=v>>>26;if(this.length=g.length,b!==0)this.words[this.length]=b,this.length++;else if(g!==this)for(;E<g.length;E++)this.words[E]=g.words[E];return this},"iadd"),i.prototype.add=o(function(h){var v;return h.negative!==0&&this.negative===0?(h.negative=0,v=this.sub(h),h.negative^=1,v):h.negative===0&&this.negative!==0?(this.negative=0,v=h.sub(this),this.negative=1,v):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},"add"),i.prototype.isub=o(function(h){if(h.negative!==0){h.negative=0;var v=this.iadd(h);return h.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var g=this.cmp(h);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,b;g>0?(l=this,b=h):(l=h,b=this);for(var E=0,M=0;M<b.length;M++)v=(l.words[M]|0)-(b.words[M]|0)+E,E=v>>26,this.words[M]=v&67108863;for(;E!==0&&M<l.length;M++)v=(l.words[M]|0)+E,E=v>>26,this.words[M]=v&67108863;if(E===0&&M<l.length&&l!==this)for(;M<l.length;M++)this.words[M]=l.words[M];return this.length=Math.max(this.length,M),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(L,h,v){v.negative=h.negative^L.negative;var g=L.length+h.length|0;v.length=g,g=g-1|0;var l=L.words[0]|0,b=h.words[0]|0,E=l*b,M=E&67108863,S=E/67108864|0;v.words[0]=M;for(var x=1;x<g;x++){for(var C=S>>>26,N=S&67108863,_=Math.min(x,h.length-1),k=Math.max(0,x-L.length+1);k<=_;k++){var fe=x-k|0;l=L.words[fe]|0,b=h.words[k]|0,E=l*b+N,C+=E/67108864|0,N=E&67108863}v.words[x]=N|0,S=C|0}return S!==0?v.words[x]=S|0:v.length--,v.strip()}o(R,"smallMulTo");var I=o(function(h,v,g){var l=h.words,b=v.words,E=g.words,M=0,S,x,C,N=l[0]|0,_=N&8191,k=N>>>13,fe=l[1]|0,D=fe&8191,Q=fe>>>13,se=l[2]|0,q=se&8191,z=se>>>13,G=l[3]|0,te=G&8191,ae=G>>>13,Ae=l[4]|0,ge=Ae&8191,ie=Ae>>>13,Me=l[5]|0,ue=Me&8191,ve=Me>>>13,W=l[6]|0,pe=W&8191,ke=W>>>13,ze=l[7]|0,Pe=ze&8191,Je=ze>>>13,gr=l[8]|0,le=gr&8191,oe=gr>>>13,F=l[9]|0,X=F&8191,me=F>>>13,ye=b[0]|0,we=ye&8191,Ie=ye>>>13,Ot=b[1]|0,Fe=Ot&8191,Ne=Ot>>>13,Ut=b[2]|0,Ve=Ut&8191,Ze=Ut>>>13,Pn=b[3]|0,st=Pn&8191,at=Pn>>>13,ii=b[4]|0,ft=ii&8191,rt=ii>>>13,oi=b[5]|0,ct=oi&8191,ut=oi>>>13,mn=b[6]|0,lt=mn&8191,Qe=mn>>>13,si=b[7]|0,ht=si&8191,dt=si>>>13,ai=b[8]|0,pt=ai&8191,mt=ai>>>13,fi=b[9]|0,bt=fi&8191,nt=fi>>>13;g.negative=h.negative^v.negative,g.length=19,S=Math.imul(_,we),x=Math.imul(_,Ie),x=x+Math.imul(k,we)|0,C=Math.imul(k,Ie);var Bn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,S=Math.imul(D,we),x=Math.imul(D,Ie),x=x+Math.imul(Q,we)|0,C=Math.imul(Q,Ie),S=S+Math.imul(_,Fe)|0,x=x+Math.imul(_,Ne)|0,x=x+Math.imul(k,Fe)|0,C=C+Math.imul(k,Ne)|0;var jt=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(jt>>>26)|0,jt&=67108863,S=Math.imul(q,we),x=Math.imul(q,Ie),x=x+Math.imul(z,we)|0,C=Math.imul(z,Ie),S=S+Math.imul(D,Fe)|0,x=x+Math.imul(D,Ne)|0,x=x+Math.imul(Q,Fe)|0,C=C+Math.imul(Q,Ne)|0,S=S+Math.imul(_,Ve)|0,x=x+Math.imul(_,Ze)|0,x=x+Math.imul(k,Ve)|0,C=C+Math.imul(k,Ze)|0;var Ht=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,S=Math.imul(te,we),x=Math.imul(te,Ie),x=x+Math.imul(ae,we)|0,C=Math.imul(ae,Ie),S=S+Math.imul(q,Fe)|0,x=x+Math.imul(q,Ne)|0,x=x+Math.imul(z,Fe)|0,C=C+Math.imul(z,Ne)|0,S=S+Math.imul(D,Ve)|0,x=x+Math.imul(D,Ze)|0,x=x+Math.imul(Q,Ve)|0,C=C+Math.imul(Q,Ze)|0,S=S+Math.imul(_,st)|0,x=x+Math.imul(_,at)|0,x=x+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var bn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(bn>>>26)|0,bn&=67108863,S=Math.imul(ge,we),x=Math.imul(ge,Ie),x=x+Math.imul(ie,we)|0,C=Math.imul(ie,Ie),S=S+Math.imul(te,Fe)|0,x=x+Math.imul(te,Ne)|0,x=x+Math.imul(ae,Fe)|0,C=C+Math.imul(ae,Ne)|0,S=S+Math.imul(q,Ve)|0,x=x+Math.imul(q,Ze)|0,x=x+Math.imul(z,Ve)|0,C=C+Math.imul(z,Ze)|0,S=S+Math.imul(D,st)|0,x=x+Math.imul(D,at)|0,x=x+Math.imul(Q,st)|0,C=C+Math.imul(Q,at)|0,S=S+Math.imul(_,ft)|0,x=x+Math.imul(_,rt)|0,x=x+Math.imul(k,ft)|0,C=C+Math.imul(k,rt)|0;var gn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(gn>>>26)|0,gn&=67108863,S=Math.imul(ue,we),x=Math.imul(ue,Ie),x=x+Math.imul(ve,we)|0,C=Math.imul(ve,Ie),S=S+Math.imul(ge,Fe)|0,x=x+Math.imul(ge,Ne)|0,x=x+Math.imul(ie,Fe)|0,C=C+Math.imul(ie,Ne)|0,S=S+Math.imul(te,Ve)|0,x=x+Math.imul(te,Ze)|0,x=x+Math.imul(ae,Ve)|0,C=C+Math.imul(ae,Ze)|0,S=S+Math.imul(q,st)|0,x=x+Math.imul(q,at)|0,x=x+Math.imul(z,st)|0,C=C+Math.imul(z,at)|0,S=S+Math.imul(D,ft)|0,x=x+Math.imul(D,rt)|0,x=x+Math.imul(Q,ft)|0,C=C+Math.imul(Q,rt)|0,S=S+Math.imul(_,ct)|0,x=x+Math.imul(_,ut)|0,x=x+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var vn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(vn>>>26)|0,vn&=67108863,S=Math.imul(pe,we),x=Math.imul(pe,Ie),x=x+Math.imul(ke,we)|0,C=Math.imul(ke,Ie),S=S+Math.imul(ue,Fe)|0,x=x+Math.imul(ue,Ne)|0,x=x+Math.imul(ve,Fe)|0,C=C+Math.imul(ve,Ne)|0,S=S+Math.imul(ge,Ve)|0,x=x+Math.imul(ge,Ze)|0,x=x+Math.imul(ie,Ve)|0,C=C+Math.imul(ie,Ze)|0,S=S+Math.imul(te,st)|0,x=x+Math.imul(te,at)|0,x=x+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,S=S+Math.imul(q,ft)|0,x=x+Math.imul(q,rt)|0,x=x+Math.imul(z,ft)|0,C=C+Math.imul(z,rt)|0,S=S+Math.imul(D,ct)|0,x=x+Math.imul(D,ut)|0,x=x+Math.imul(Q,ct)|0,C=C+Math.imul(Q,ut)|0,S=S+Math.imul(_,lt)|0,x=x+Math.imul(_,Qe)|0,x=x+Math.imul(k,lt)|0,C=C+Math.imul(k,Qe)|0;var Fr=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,S=Math.imul(Pe,we),x=Math.imul(Pe,Ie),x=x+Math.imul(Je,we)|0,C=Math.imul(Je,Ie),S=S+Math.imul(pe,Fe)|0,x=x+Math.imul(pe,Ne)|0,x=x+Math.imul(ke,Fe)|0,C=C+Math.imul(ke,Ne)|0,S=S+Math.imul(ue,Ve)|0,x=x+Math.imul(ue,Ze)|0,x=x+Math.imul(ve,Ve)|0,C=C+Math.imul(ve,Ze)|0,S=S+Math.imul(ge,st)|0,x=x+Math.imul(ge,at)|0,x=x+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,S=S+Math.imul(te,ft)|0,x=x+Math.imul(te,rt)|0,x=x+Math.imul(ae,ft)|0,C=C+Math.imul(ae,rt)|0,S=S+Math.imul(q,ct)|0,x=x+Math.imul(q,ut)|0,x=x+Math.imul(z,ct)|0,C=C+Math.imul(z,ut)|0,S=S+Math.imul(D,lt)|0,x=x+Math.imul(D,Qe)|0,x=x+Math.imul(Q,lt)|0,C=C+Math.imul(Q,Qe)|0,S=S+Math.imul(_,ht)|0,x=x+Math.imul(_,dt)|0,x=x+Math.imul(k,ht)|0,C=C+Math.imul(k,dt)|0;var yn=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(yn>>>26)|0,yn&=67108863,S=Math.imul(le,we),x=Math.imul(le,Ie),x=x+Math.imul(oe,we)|0,C=Math.imul(oe,Ie),S=S+Math.imul(Pe,Fe)|0,x=x+Math.imul(Pe,Ne)|0,x=x+Math.imul(Je,Fe)|0,C=C+Math.imul(Je,Ne)|0,S=S+Math.imul(pe,Ve)|0,x=x+Math.imul(pe,Ze)|0,x=x+Math.imul(ke,Ve)|0,C=C+Math.imul(ke,Ze)|0,S=S+Math.imul(ue,st)|0,x=x+Math.imul(ue,at)|0,x=x+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,S=S+Math.imul(ge,ft)|0,x=x+Math.imul(ge,rt)|0,x=x+Math.imul(ie,ft)|0,C=C+Math.imul(ie,rt)|0,S=S+Math.imul(te,ct)|0,x=x+Math.imul(te,ut)|0,x=x+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,S=S+Math.imul(q,lt)|0,x=x+Math.imul(q,Qe)|0,x=x+Math.imul(z,lt)|0,C=C+Math.imul(z,Qe)|0,S=S+Math.imul(D,ht)|0,x=x+Math.imul(D,dt)|0,x=x+Math.imul(Q,ht)|0,C=C+Math.imul(Q,dt)|0,S=S+Math.imul(_,pt)|0,x=x+Math.imul(_,mt)|0,x=x+Math.imul(k,pt)|0,C=C+Math.imul(k,mt)|0;var ci=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(ci>>>26)|0,ci&=67108863,S=Math.imul(X,we),x=Math.imul(X,Ie),x=x+Math.imul(me,we)|0,C=Math.imul(me,Ie),S=S+Math.imul(le,Fe)|0,x=x+Math.imul(le,Ne)|0,x=x+Math.imul(oe,Fe)|0,C=C+Math.imul(oe,Ne)|0,S=S+Math.imul(Pe,Ve)|0,x=x+Math.imul(Pe,Ze)|0,x=x+Math.imul(Je,Ve)|0,C=C+Math.imul(Je,Ze)|0,S=S+Math.imul(pe,st)|0,x=x+Math.imul(pe,at)|0,x=x+Math.imul(ke,st)|0,C=C+Math.imul(ke,at)|0,S=S+Math.imul(ue,ft)|0,x=x+Math.imul(ue,rt)|0,x=x+Math.imul(ve,ft)|0,C=C+Math.imul(ve,rt)|0,S=S+Math.imul(ge,ct)|0,x=x+Math.imul(ge,ut)|0,x=x+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,S=S+Math.imul(te,lt)|0,x=x+Math.imul(te,Qe)|0,x=x+Math.imul(ae,lt)|0,C=C+Math.imul(ae,Qe)|0,S=S+Math.imul(q,ht)|0,x=x+Math.imul(q,dt)|0,x=x+Math.imul(z,ht)|0,C=C+Math.imul(z,dt)|0,S=S+Math.imul(D,pt)|0,x=x+Math.imul(D,mt)|0,x=x+Math.imul(Q,pt)|0,C=C+Math.imul(Q,mt)|0,S=S+Math.imul(_,bt)|0,x=x+Math.imul(_,nt)|0,x=x+Math.imul(k,bt)|0,C=C+Math.imul(k,nt)|0;var Uo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,S=Math.imul(X,Fe),x=Math.imul(X,Ne),x=x+Math.imul(me,Fe)|0,C=Math.imul(me,Ne),S=S+Math.imul(le,Ve)|0,x=x+Math.imul(le,Ze)|0,x=x+Math.imul(oe,Ve)|0,C=C+Math.imul(oe,Ze)|0,S=S+Math.imul(Pe,st)|0,x=x+Math.imul(Pe,at)|0,x=x+Math.imul(Je,st)|0,C=C+Math.imul(Je,at)|0,S=S+Math.imul(pe,ft)|0,x=x+Math.imul(pe,rt)|0,x=x+Math.imul(ke,ft)|0,C=C+Math.imul(ke,rt)|0,S=S+Math.imul(ue,ct)|0,x=x+Math.imul(ue,ut)|0,x=x+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,S=S+Math.imul(ge,lt)|0,x=x+Math.imul(ge,Qe)|0,x=x+Math.imul(ie,lt)|0,C=C+Math.imul(ie,Qe)|0,S=S+Math.imul(te,ht)|0,x=x+Math.imul(te,dt)|0,x=x+Math.imul(ae,ht)|0,C=C+Math.imul(ae,dt)|0,S=S+Math.imul(q,pt)|0,x=x+Math.imul(q,mt)|0,x=x+Math.imul(z,pt)|0,C=C+Math.imul(z,mt)|0,S=S+Math.imul(D,bt)|0,x=x+Math.imul(D,nt)|0,x=x+Math.imul(Q,bt)|0,C=C+Math.imul(Q,nt)|0;var Fo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,S=Math.imul(X,Ve),x=Math.imul(X,Ze),x=x+Math.imul(me,Ve)|0,C=Math.imul(me,Ze),S=S+Math.imul(le,st)|0,x=x+Math.imul(le,at)|0,x=x+Math.imul(oe,st)|0,C=C+Math.imul(oe,at)|0,S=S+Math.imul(Pe,ft)|0,x=x+Math.imul(Pe,rt)|0,x=x+Math.imul(Je,ft)|0,C=C+Math.imul(Je,rt)|0,S=S+Math.imul(pe,ct)|0,x=x+Math.imul(pe,ut)|0,x=x+Math.imul(ke,ct)|0,C=C+Math.imul(ke,ut)|0,S=S+Math.imul(ue,lt)|0,x=x+Math.imul(ue,Qe)|0,x=x+Math.imul(ve,lt)|0,C=C+Math.imul(ve,Qe)|0,S=S+Math.imul(ge,ht)|0,x=x+Math.imul(ge,dt)|0,x=x+Math.imul(ie,ht)|0,C=C+Math.imul(ie,dt)|0,S=S+Math.imul(te,pt)|0,x=x+Math.imul(te,mt)|0,x=x+Math.imul(ae,pt)|0,C=C+Math.imul(ae,mt)|0,S=S+Math.imul(q,bt)|0,x=x+Math.imul(q,nt)|0,x=x+Math.imul(z,bt)|0,C=C+Math.imul(z,nt)|0;var $o=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+($o>>>26)|0,$o&=67108863,S=Math.imul(X,st),x=Math.imul(X,at),x=x+Math.imul(me,st)|0,C=Math.imul(me,at),S=S+Math.imul(le,ft)|0,x=x+Math.imul(le,rt)|0,x=x+Math.imul(oe,ft)|0,C=C+Math.imul(oe,rt)|0,S=S+Math.imul(Pe,ct)|0,x=x+Math.imul(Pe,ut)|0,x=x+Math.imul(Je,ct)|0,C=C+Math.imul(Je,ut)|0,S=S+Math.imul(pe,lt)|0,x=x+Math.imul(pe,Qe)|0,x=x+Math.imul(ke,lt)|0,C=C+Math.imul(ke,Qe)|0,S=S+Math.imul(ue,ht)|0,x=x+Math.imul(ue,dt)|0,x=x+Math.imul(ve,ht)|0,C=C+Math.imul(ve,dt)|0,S=S+Math.imul(ge,pt)|0,x=x+Math.imul(ge,mt)|0,x=x+Math.imul(ie,pt)|0,C=C+Math.imul(ie,mt)|0,S=S+Math.imul(te,bt)|0,x=x+Math.imul(te,nt)|0,x=x+Math.imul(ae,bt)|0,C=C+Math.imul(ae,nt)|0;var fo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(fo>>>26)|0,fo&=67108863,S=Math.imul(X,ft),x=Math.imul(X,rt),x=x+Math.imul(me,ft)|0,C=Math.imul(me,rt),S=S+Math.imul(le,ct)|0,x=x+Math.imul(le,ut)|0,x=x+Math.imul(oe,ct)|0,C=C+Math.imul(oe,ut)|0,S=S+Math.imul(Pe,lt)|0,x=x+Math.imul(Pe,Qe)|0,x=x+Math.imul(Je,lt)|0,C=C+Math.imul(Je,Qe)|0,S=S+Math.imul(pe,ht)|0,x=x+Math.imul(pe,dt)|0,x=x+Math.imul(ke,ht)|0,C=C+Math.imul(ke,dt)|0,S=S+Math.imul(ue,pt)|0,x=x+Math.imul(ue,mt)|0,x=x+Math.imul(ve,pt)|0,C=C+Math.imul(ve,mt)|0,S=S+Math.imul(ge,bt)|0,x=x+Math.imul(ge,nt)|0,x=x+Math.imul(ie,bt)|0,C=C+Math.imul(ie,nt)|0;var co=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(co>>>26)|0,co&=67108863,S=Math.imul(X,ct),x=Math.imul(X,ut),x=x+Math.imul(me,ct)|0,C=Math.imul(me,ut),S=S+Math.imul(le,lt)|0,x=x+Math.imul(le,Qe)|0,x=x+Math.imul(oe,lt)|0,C=C+Math.imul(oe,Qe)|0,S=S+Math.imul(Pe,ht)|0,x=x+Math.imul(Pe,dt)|0,x=x+Math.imul(Je,ht)|0,C=C+Math.imul(Je,dt)|0,S=S+Math.imul(pe,pt)|0,x=x+Math.imul(pe,mt)|0,x=x+Math.imul(ke,pt)|0,C=C+Math.imul(ke,mt)|0,S=S+Math.imul(ue,bt)|0,x=x+Math.imul(ue,nt)|0,x=x+Math.imul(ve,bt)|0,C=C+Math.imul(ve,nt)|0;var uo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(uo>>>26)|0,uo&=67108863,S=Math.imul(X,lt),x=Math.imul(X,Qe),x=x+Math.imul(me,lt)|0,C=Math.imul(me,Qe),S=S+Math.imul(le,ht)|0,x=x+Math.imul(le,dt)|0,x=x+Math.imul(oe,ht)|0,C=C+Math.imul(oe,dt)|0,S=S+Math.imul(Pe,pt)|0,x=x+Math.imul(Pe,mt)|0,x=x+Math.imul(Je,pt)|0,C=C+Math.imul(Je,mt)|0,S=S+Math.imul(pe,bt)|0,x=x+Math.imul(pe,nt)|0,x=x+Math.imul(ke,bt)|0,C=C+Math.imul(ke,nt)|0;var qo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(qo>>>26)|0,qo&=67108863,S=Math.imul(X,ht),x=Math.imul(X,dt),x=x+Math.imul(me,ht)|0,C=Math.imul(me,dt),S=S+Math.imul(le,pt)|0,x=x+Math.imul(le,mt)|0,x=x+Math.imul(oe,pt)|0,C=C+Math.imul(oe,mt)|0,S=S+Math.imul(Pe,bt)|0,x=x+Math.imul(Pe,nt)|0,x=x+Math.imul(Je,bt)|0,C=C+Math.imul(Je,nt)|0;var jo=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(jo>>>26)|0,jo&=67108863,S=Math.imul(X,pt),x=Math.imul(X,mt),x=x+Math.imul(me,pt)|0,C=Math.imul(me,mt),S=S+Math.imul(le,bt)|0,x=x+Math.imul(le,nt)|0,x=x+Math.imul(oe,bt)|0,C=C+Math.imul(oe,nt)|0;var Ho=(M+S|0)+((x&8191)<<13)|0;M=(C+(x>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,S=Math.imul(X,bt),x=Math.imul(X,nt),x=x+Math.imul(me,bt)|0,C=Math.imul(me,nt);var zo=(M+S|0)+((x&8191)<<13)|0;return M=(C+(x>>>13)|0)+(zo>>>26)|0,zo&=67108863,E[0]=Bn,E[1]=jt,E[2]=Ht,E[3]=bn,E[4]=gn,E[5]=vn,E[6]=Fr,E[7]=yn,E[8]=ci,E[9]=Uo,E[10]=Fo,E[11]=$o,E[12]=fo,E[13]=co,E[14]=uo,E[15]=qo,E[16]=jo,E[17]=Ho,E[18]=zo,M!==0&&(E[19]=M,g.length++),g},"comb10MulTo");Math.imul||(I=R);function B(L,h,v){v.negative=h.negative^L.negative,v.length=L.length+h.length;for(var g=0,l=0,b=0;b<v.length-1;b++){var E=l;l=0;for(var M=g&67108863,S=Math.min(b,h.length-1),x=Math.max(0,b-L.length+1);x<=S;x++){var C=b-x,N=L.words[C]|0,_=h.words[x]|0,k=N*_,fe=k&67108863;E=E+(k/67108864|0)|0,fe=fe+M|0,M=fe&67108863,E=E+(fe>>>26)|0,l+=E>>>26,E&=67108863}v.words[b]=M,g=E,E=l}return g!==0?v.words[b]=g:v.length--,v.strip()}o(B,"bigMulTo");function Y(L,h,v){var g=new P;return g.mulp(L,h,v)}o(Y,"jumboMulTo"),i.prototype.mulTo=o(function(h,v){var g,l=this.length+h.length;return this.length===10&&h.length===10?g=I(this,h,v):l<63?g=R(this,h,v):l<1024?g=B(this,h,v):g=Y(this,h,v),g},"mulTo");function P(L,h){this.x=L,this.y=h}o(P,"FFTM"),P.prototype.makeRBT=o(function(h){for(var v=new Array(h),g=i.prototype._countBits(h)-1,l=0;l<h;l++)v[l]=this.revBin(l,g,h);return v},"makeRBT"),P.prototype.revBin=o(function(h,v,g){if(h===0||h===g-1)return h;for(var l=0,b=0;b<v;b++)l|=(h&1)<<v-b-1,h>>=1;return l},"revBin"),P.prototype.permute=o(function(h,v,g,l,b,E){for(var M=0;M<E;M++)l[M]=v[h[M]],b[M]=g[h[M]]},"permute"),P.prototype.transform=o(function(h,v,g,l,b,E){this.permute(E,h,v,g,l,b);for(var M=1;M<b;M<<=1)for(var S=M<<1,x=Math.cos(2*Math.PI/S),C=Math.sin(2*Math.PI/S),N=0;N<b;N+=S)for(var _=x,k=C,fe=0;fe<M;fe++){var D=g[N+fe],Q=l[N+fe],se=g[N+fe+M],q=l[N+fe+M],z=_*se-k*q;q=_*q+k*se,se=z,g[N+fe]=D+se,l[N+fe]=Q+q,g[N+fe+M]=D-se,l[N+fe+M]=Q-q,fe!==S&&(z=x*_-C*k,k=x*k+C*_,_=z)}},"transform"),P.prototype.guessLen13b=o(function(h,v){var g=Math.max(v,h)|1,l=g&1,b=0;for(g=g/2|0;g;g=g>>>1)b++;return 1<<b+1+l},"guessLen13b"),P.prototype.conjugate=o(function(h,v,g){if(!(g<=1))for(var l=0;l<g/2;l++){var b=h[l];h[l]=h[g-l-1],h[g-l-1]=b,b=v[l],v[l]=-v[g-l-1],v[g-l-1]=-b}},"conjugate"),P.prototype.normalize13b=o(function(h,v){for(var g=0,l=0;l<v/2;l++){var b=Math.round(h[2*l+1]/v)*8192+Math.round(h[2*l]/v)+g;h[l]=b&67108863,b<67108864?g=0:g=b/67108864|0}return h},"normalize13b"),P.prototype.convert13b=o(function(h,v,g,l){for(var b=0,E=0;E<v;E++)b=b+(h[E]|0),g[2*E]=b&8191,b=b>>>13,g[2*E+1]=b&8191,b=b>>>13;for(E=2*v;E<l;++E)g[E]=0;t(b===0),t((b&-8192)===0)},"convert13b"),P.prototype.stub=o(function(h){for(var v=new Array(h),g=0;g<h;g++)v[g]=0;return v},"stub"),P.prototype.mulp=o(function(h,v,g){var l=2*this.guessLen13b(h.length,v.length),b=this.makeRBT(l),E=this.stub(l),M=new Array(l),S=new Array(l),x=new Array(l),C=new Array(l),N=new Array(l),_=new Array(l),k=g.words;k.length=l,this.convert13b(h.words,h.length,M,l),this.convert13b(v.words,v.length,C,l),this.transform(M,E,S,x,l,b),this.transform(C,E,N,_,l,b);for(var fe=0;fe<l;fe++){var D=S[fe]*N[fe]-x[fe]*_[fe];x[fe]=S[fe]*_[fe]+x[fe]*N[fe],S[fe]=D}return this.conjugate(S,x,l),this.transform(S,x,k,E,l,b),this.conjugate(k,E,l),this.normalize13b(k,l),g.negative=h.negative^v.negative,g.length=h.length+v.length,g.strip()},"mulp"),i.prototype.mul=o(function(h){var v=new i(null);return v.words=new Array(this.length+h.length),this.mulTo(h,v)},"mul"),i.prototype.mulf=o(function(h){var v=new i(null);return v.words=new Array(this.length+h.length),Y(this,h,v)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){t(typeof h=="number"),t(h<67108864);for(var v=0,g=0;g<this.length;g++){var l=(this.words[g]|0)*h,b=(l&67108863)+(v&67108863);v>>=26,v+=l/67108864|0,v+=b>>>26,this.words[g]=b&67108863}return v!==0&&(this.words[g]=v,this.length++),this},"imuln"),i.prototype.muln=o(function(h){return this.clone().imuln(h)},"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(h){var v=O(h);if(v.length===0)return new i(1);for(var g=this,l=0;l<v.length&&v[l]===0;l++,g=g.sqr());if(++l<v.length)for(var b=g.sqr();l<v.length;l++,b=b.sqr())v[l]!==0&&(g=g.mul(b));return g},"pow"),i.prototype.iushln=o(function(h){t(typeof h=="number"&&h>=0);var v=h%26,g=(h-v)/26,l=67108863>>>26-v<<26-v,b;if(v!==0){var E=0;for(b=0;b<this.length;b++){var M=this.words[b]&l,S=(this.words[b]|0)-M<<v;this.words[b]=S|E,E=M>>>26-v}E&&(this.words[b]=E,this.length++)}if(g!==0){for(b=this.length-1;b>=0;b--)this.words[b+g]=this.words[b];for(b=0;b<g;b++)this.words[b]=0;this.length+=g}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return t(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,v,g){t(typeof h=="number"&&h>=0);var l;v?l=(v-v%26)/26:l=0;var b=h%26,E=Math.min((h-b)/26,this.length),M=67108863^67108863>>>b<<b,S=g;if(l-=E,l=Math.max(0,l),S){for(var x=0;x<E;x++)S.words[x]=this.words[x];S.length=E}if(E!==0)if(this.length>E)for(this.length-=E,x=0;x<this.length;x++)this.words[x]=this.words[x+E];else this.words[0]=0,this.length=1;var C=0;for(x=this.length-1;x>=0&&(C!==0||x>=l);x--){var N=this.words[x]|0;this.words[x]=C<<26-b|N>>>b,C=N&M}return S&&C!==0&&(S.words[S.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,v,g){return t(this.negative===0),this.iushrn(h,v,g)},"ishrn"),i.prototype.shln=o(function(h){return this.clone().ishln(h)},"shln"),i.prototype.ushln=o(function(h){return this.clone().iushln(h)},"ushln"),i.prototype.shrn=o(function(h){return this.clone().ishrn(h)},"shrn"),i.prototype.ushrn=o(function(h){return this.clone().iushrn(h)},"ushrn"),i.prototype.testn=o(function(h){t(typeof h=="number"&&h>=0);var v=h%26,g=(h-v)/26,l=1<<v;if(this.length<=g)return!1;var b=this.words[g];return!!(b&l)},"testn"),i.prototype.imaskn=o(function(h){t(typeof h=="number"&&h>=0);var v=h%26,g=(h-v)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(v!==0&&g++,this.length=Math.min(g,this.length),v!==0){var l=67108863^67108863>>>v<<v;this.words[this.length-1]&=l}return this.strip()},"imaskn"),i.prototype.maskn=o(function(h){return this.clone().imaskn(h)},"maskn"),i.prototype.iaddn=o(function(h){return t(typeof h=="number"),t(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},"iaddn"),i.prototype._iaddn=o(function(h){this.words[0]+=h;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(h){if(t(typeof h=="number"),t(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var 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(h){return this.clone().iaddn(h)},"addn"),i.prototype.subn=o(function(h){return this.clone().isubn(h)},"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(h,v,g){var l=h.length+g,b;this._expand(l);var E,M=0;for(b=0;b<h.length;b++){E=(this.words[b+g]|0)+M;var S=(h.words[b]|0)*v;E-=S&67108863,M=(E>>26)-(S/67108864|0),this.words[b+g]=E&67108863}for(;b<this.length-g;b++)E=(this.words[b+g]|0)+M,M=E>>26,this.words[b+g]=E&67108863;if(M===0)return this.strip();for(t(M===-1),M=0,b=0;b<this.length;b++)E=-(this.words[b]|0)+M,M=E>>26,this.words[b]=E&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,v){var g=this.length-h.length,l=this.clone(),b=h,E=b.words[b.length-1]|0,M=this._countBits(E);g=26-M,g!==0&&(b=b.ushln(g),l.iushln(g),E=b.words[b.length-1]|0);var S=l.length-b.length,x;if(v!=="mod"){x=new i(null),x.length=S+1,x.words=new Array(x.length);for(var C=0;C<x.length;C++)x.words[C]=0}var N=l.clone()._ishlnsubmul(b,1,S);N.negative===0&&(l=N,x&&(x.words[S]=1));for(var _=S-1;_>=0;_--){var k=(l.words[b.length+_]|0)*67108864+(l.words[b.length+_-1]|0);for(k=Math.min(k/E|0,67108863),l._ishlnsubmul(b,k,_);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(b,1,_),l.isZero()||(l.negative^=1);x&&(x.words[_]=k)}return x&&x.strip(),l.strip(),v!=="div"&&g!==0&&l.iushrn(g),{div:x||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,v,g){if(t(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,b,E;return this.negative!==0&&h.negative===0?(E=this.neg().divmod(h,v),v!=="mod"&&(l=E.div.neg()),v!=="div"&&(b=E.mod.neg(),g&&b.negative!==0&&b.iadd(h)),{div:l,mod:b}):this.negative===0&&h.negative!==0?(E=this.divmod(h.neg(),v),v!=="mod"&&(l=E.div.neg()),{div:l,mod:E.mod}):(this.negative&h.negative)!==0?(E=this.neg().divmod(h.neg(),v),v!=="div"&&(b=E.mod.neg(),g&&b.negative!==0&&b.isub(h)),{div:E.div,mod:b}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?v==="div"?{div:this.divn(h.words[0]),mod:null}:v==="mod"?{div:null,mod:new i(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modn(h.words[0]))}:this._wordDiv(h,v)},"divmod"),i.prototype.div=o(function(h){return this.divmod(h,"div",!1).div},"div"),i.prototype.mod=o(function(h){return this.divmod(h,"mod",!1).mod},"mod"),i.prototype.umod=o(function(h){return this.divmod(h,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(h){var v=this.divmod(h);if(v.mod.isZero())return v.div;var g=v.div.negative!==0?v.mod.isub(h):v.mod,l=h.ushrn(1),b=h.andln(1),E=g.cmp(l);return E<0||b===1&&E===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){t(h<=67108863);for(var v=(1<<26)%h,g=0,l=this.length-1;l>=0;l--)g=(v*g+(this.words[l]|0))%h;return g},"modn"),i.prototype.idivn=o(function(h){t(h<=67108863);for(var v=0,g=this.length-1;g>=0;g--){var l=(this.words[g]|0)+v*67108864;this.words[g]=l/h|0,v=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){t(h.negative===0),t(!h.isZero());var v=this,g=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var l=new i(1),b=new i(0),E=new i(0),M=new i(1),S=0;v.isEven()&&g.isEven();)v.iushrn(1),g.iushrn(1),++S;for(var x=g.clone(),C=v.clone();!v.isZero();){for(var N=0,_=1;(v.words[0]&_)===0&&N<26;++N,_<<=1);if(N>0)for(v.iushrn(N);N-- >0;)(l.isOdd()||b.isOdd())&&(l.iadd(x),b.isub(C)),l.iushrn(1),b.iushrn(1);for(var k=0,fe=1;(g.words[0]&fe)===0&&k<26;++k,fe<<=1);if(k>0)for(g.iushrn(k);k-- >0;)(E.isOdd()||M.isOdd())&&(E.iadd(x),M.isub(C)),E.iushrn(1),M.iushrn(1);v.cmp(g)>=0?(v.isub(g),l.isub(E),b.isub(M)):(g.isub(v),E.isub(l),M.isub(b))}return{a:E,b:M,gcd:g.iushln(S)}},"egcd"),i.prototype._invmp=o(function(h){t(h.negative===0),t(!h.isZero());var v=this,g=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var l=new i(1),b=new i(0),E=g.clone();v.cmpn(1)>0&&g.cmpn(1)>0;){for(var M=0,S=1;(v.words[0]&S)===0&&M<26;++M,S<<=1);if(M>0)for(v.iushrn(M);M-- >0;)l.isOdd()&&l.iadd(E),l.iushrn(1);for(var x=0,C=1;(g.words[0]&C)===0&&x<26;++x,C<<=1);if(x>0)for(g.iushrn(x);x-- >0;)b.isOdd()&&b.iadd(E),b.iushrn(1);v.cmp(g)>=0?(v.isub(g),l.isub(b)):(g.isub(v),b.isub(l))}var N;return v.cmpn(1)===0?N=l:N=b,N.cmpn(0)<0&&N.iadd(h),N},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var v=this.clone(),g=h.clone();v.negative=0,g.negative=0;for(var l=0;v.isEven()&&g.isEven();l++)v.iushrn(1),g.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;g.isEven();)g.iushrn(1);var b=v.cmp(g);if(b<0){var E=v;v=g,g=E}else if(b===0||g.cmpn(1)===0)break;v.isub(g)}while(!0);return g.iushln(l)},"gcd"),i.prototype.invm=o(function(h){return this.egcd(h).a.umod(h)},"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(h){return this.words[0]&h},"andln"),i.prototype.bincn=o(function(h){t(typeof h=="number");var v=h%26,g=(h-v)/26,l=1<<v;if(this.length<=g)return this._expand(g+1),this.words[g]|=l,this;for(var b=l,E=g;b!==0&&E<this.length;E++){var M=this.words[E]|0;M+=b,b=M>>>26,M&=67108863,this.words[E]=M}return b!==0&&(this.words[E]=b,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(h){var v=h<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var g;if(this.length>1)g=1;else{v&&(h=-h),t(h<=67108863,"Number is too big");var l=this.words[0]|0;g=l===h?0:l<h?-1:1}return this.negative!==0?-g|0:g},"cmpn"),i.prototype.cmp=o(function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var v=this.ucmp(h);return this.negative!==0?-v|0:v},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var v=0,g=this.length-1;g>=0;g--){var l=this.words[g]|0,b=h.words[g]|0;if(l!==b){l<b?v=-1:l>b&&(v=1);break}}return v},"ucmp"),i.prototype.gtn=o(function(h){return this.cmpn(h)===1},"gtn"),i.prototype.gt=o(function(h){return this.cmp(h)===1},"gt"),i.prototype.gten=o(function(h){return this.cmpn(h)>=0},"gten"),i.prototype.gte=o(function(h){return this.cmp(h)>=0},"gte"),i.prototype.ltn=o(function(h){return this.cmpn(h)===-1},"ltn"),i.prototype.lt=o(function(h){return this.cmp(h)===-1},"lt"),i.prototype.lten=o(function(h){return this.cmpn(h)<=0},"lten"),i.prototype.lte=o(function(h){return this.cmp(h)<=0},"lte"),i.prototype.eqn=o(function(h){return this.cmpn(h)===0},"eqn"),i.prototype.eq=o(function(h){return this.cmp(h)===0},"eq"),i.red=o(function(h){return new H(h)},"red"),i.prototype.toRed=o(function(h){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"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(h){return this.red=h,this},"_forceRed"),i.prototype.forceRed=o(function(h){return t(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},"redMul"),i.prototype.redIMul=o(function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},"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(h){return t(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var J={k256:null,p224:null,p192:null,p25519:null};function ee(L,h){this.name=L,this.p=new i(h,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(ee,"MPrime"),ee.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),ee.prototype.ireduce=o(function(h){var v=h,g;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),g=v.bitLength();while(g>this.n);var l=g<this.n?-1:v.ucmp(this.p);return l===0?(v.words[0]=0,v.length=1):l>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},"ireduce"),ee.prototype.split=o(function(h,v){h.iushrn(this.n,0,v)},"split"),ee.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Z(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Z,"K256"),n(Z,ee),Z.prototype.split=o(function(h,v){for(var g=4194303,l=Math.min(h.length,9),b=0;b<l;b++)v.words[b]=h.words[b];if(v.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var E=h.words[9];for(v.words[v.length++]=E&g,b=10;b<h.length;b++){var M=h.words[b]|0;h.words[b-10]=(M&g)<<4|E>>>22,E=M}E>>>=22,h.words[b-10]=E,E===0&&h.length>10?h.length-=10:h.length-=9},"split"),Z.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var v=0,g=0;g<h.length;g++){var l=h.words[g]|0;v+=l*977,h.words[g]=v&67108863,v=l*64+(v/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function ne(){ee.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ne,"P224"),n(ne,ee);function V(){ee.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(V,"P192"),n(V,ee);function j(){ee.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(j,"P25519"),n(j,ee),j.prototype.imulK=o(function(h){for(var v=0,g=0;g<h.length;g++){var l=(h.words[g]|0)*19+v,b=l&67108863;l>>>=26,h.words[g]=b,v=l}return v!==0&&(h.words[h.length++]=v),h},"imulK"),i._prime=o(function(h){if(J[h])return J[h];var v;if(h==="k256")v=new Z;else if(h==="p224")v=new ne;else if(h==="p192")v=new V;else if(h==="p25519")v=new j;else throw new Error("Unknown prime "+h);return J[h]=v,v},"prime");function H(L){if(typeof L=="string"){var h=i._prime(L);this.m=h.p,this.prime=h}else t(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}o(H,"Red"),H.prototype._verify1=o(function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},"_verify1"),H.prototype._verify2=o(function(h,v){t((h.negative|v.negative)===0,"red works only with positives"),t(h.red&&h.red===v.red,"red works only with red numbers")},"_verify2"),H.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),H.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),H.prototype.add=o(function(h,v){this._verify2(h,v);var g=h.add(v);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},"add"),H.prototype.iadd=o(function(h,v){this._verify2(h,v);var g=h.iadd(v);return g.cmp(this.m)>=0&&g.isub(this.m),g},"iadd"),H.prototype.sub=o(function(h,v){this._verify2(h,v);var g=h.sub(v);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},"sub"),H.prototype.isub=o(function(h,v){this._verify2(h,v);var g=h.isub(v);return g.cmpn(0)<0&&g.iadd(this.m),g},"isub"),H.prototype.shl=o(function(h,v){return this._verify1(h),this.imod(h.ushln(v))},"shl"),H.prototype.imul=o(function(h,v){return this._verify2(h,v),this.imod(h.imul(v))},"imul"),H.prototype.mul=o(function(h,v){return this._verify2(h,v),this.imod(h.mul(v))},"mul"),H.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),H.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),H.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var v=this.m.andln(3);if(t(v%2===1),v===3){var g=this.m.add(new i(1)).iushrn(2);return this.pow(h,g)}for(var l=this.m.subn(1),b=0;!l.isZero()&&l.andln(1)===0;)b++,l.iushrn(1);t(!l.isZero());var E=new i(1).toRed(this),M=E.redNeg(),S=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new i(2*x*x).toRed(this);this.pow(x,S).cmp(M)!==0;)x.redIAdd(M);for(var C=this.pow(x,l),N=this.pow(h,l.addn(1).iushrn(1)),_=this.pow(h,l),k=b;_.cmp(E)!==0;){for(var fe=_,D=0;fe.cmp(E)!==0;D++)fe=fe.redSqr();t(D<k);var Q=this.pow(C,new i(1).iushln(k-D-1));N=N.redMul(Q),C=Q.redSqr(),_=_.redMul(C),k=D}return N},"sqrt"),H.prototype.invm=o(function(h){var v=h._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},"invm"),H.prototype.pow=o(function(h,v){if(v.isZero())return new i(1).toRed(this);if(v.cmpn(1)===0)return h.clone();var g=4,l=new Array(1<<g);l[0]=new i(1).toRed(this),l[1]=h;for(var b=2;b<l.length;b++)l[b]=this.mul(l[b-1],h);var E=l[0],M=0,S=0,x=v.bitLength()%26;for(x===0&&(x=26),b=v.length-1;b>=0;b--){for(var C=v.words[b],N=x-1;N>=0;N--){var _=C>>N&1;if(E!==l[0]&&(E=this.sqr(E)),_===0&&M===0){S=0;continue}M<<=1,M|=_,S++,!(S!==g&&(b!==0||N!==0))&&(E=this.mul(E,l[M]),S=0,M=0)}x=26}return E},"pow"),H.prototype.convertTo=o(function(h){var v=h.umod(this.m);return v===h?v.clone():v},"convertTo"),H.prototype.convertFrom=o(function(h){var v=h.clone();return v.red=null,v},"convertFrom"),i.mont=o(function(h){return new he(h)},"mont");function he(L){H.call(this,L),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(he,"Mont"),n(he,H),he.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),he.prototype.convertFrom=o(function(h){var v=this.imod(h.mul(this.rinv));return v.red=null,v},"convertFrom"),he.prototype.imul=o(function(h,v){if(h.isZero()||v.isZero())return h.words[0]=0,h.length=1,h;var g=h.imul(v),l=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=g.isub(l).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},"imul"),he.prototype.mul=o(function(h,v){if(h.isZero()||v.isZero())return new i(0)._forceRed(this);var g=h.mul(v),l=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=g.isub(l).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},"mul"),he.prototype.invm=o(function(h){var v=this.imod(h._invmp(this.m).mul(this.r2));return v._forceRed(this)},"invm")})(typeof _1>"u"||_1,fx)});var qs=Re((WV,ux)=>{ux.exports=cx;function cx(r,e){if(!r)throw new Error(e||"Assertion failed")}o(cx,"assert");cx.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var E1=Re(dx=>{"use strict";var md=dx;function mO(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,f=i&255;s?t.push(s,f):t.push(f)}return t}o(mO,"toArray");md.toArray=mO;function lx(r){return r.length===1?"0"+r:r}o(lx,"zero2");md.zero2=lx;function hx(r){for(var e="",t=0;t<r.length;t++)e+=lx(r[t].toString(16));return e}o(hx,"toHex");md.toHex=hx;md.encode=o(function(e,t){return t==="hex"?hx(e):e},"encode")});var zn=Re(px=>{"use strict";var Hi=px,bO=mo(),gO=qs(),bd=E1();Hi.assert=gO;Hi.toArray=bd.toArray;Hi.zero2=bd.zero2;Hi.toHex=bd.toHex;Hi.encode=bd.encode;function vO(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1),i;for(i=0;i<n.length;i+=1)n[i]=0;var s=1<<e+1,f=r.clone();for(i=0;i<n.length;i++){var u,d=f.andln(s-1);f.isOdd()?(d>(s>>1)-1?u=(s>>1)-d:u=d,f.isubn(u)):u=0,n[i]=u,f.iushrn(1)}return n}o(vO,"getNAF");Hi.getNAF=vO;function yO(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 f=r.andln(3)+n&3,u=e.andln(3)+i&3;f===3&&(f=-1),u===3&&(u=-1);var d;(f&1)===0?d=0:(s=r.andln(7)+n&7,(s===3||s===5)&&u===2?d=-f:d=f),t[0].push(d);var y;(u&1)===0?y=0:(s=e.andln(7)+i&7,(s===3||s===5)&&f===2?y=-u:y=u),t[1].push(y),2*n===d+1&&(n=1-n),2*i===y+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(yO,"getJSF");Hi.getJSF=yO;function xO(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(xO,"cachedProperty");Hi.cachedProperty=xO;function wO(r){return typeof r=="string"?Hi.toArray(r,"hex"):r}o(wO,"parseBytes");Hi.parseBytes=wO;function _O(r){return new bO(r,"hex","le")}o(_O,"intFromLE");Hi.intFromLE=_O});var T1=Re((ZV,M1)=>{var A1;M1.exports=o(function(e){return A1||(A1=new js(null)),A1.generate(e)},"rand");function js(r){this.rand=r}o(js,"Rand");M1.exports.Rand=js;js.prototype.generate=o(function(e){return this._rand(e)},"generate");js.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?js.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?js.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(js.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(S1=require("crypto"),typeof S1.randomBytes!="function")throw new Error("Not supported");js.prototype._rand=o(function(e){return S1.randomBytes(e)},"_rand")}catch{}var S1});var ju=Re((XV,mx)=>{"use strict";var qa=mo(),qu=zn(),gd=qu.getNAF,EO=qu.getJSF,vd=qu.assert;function Hs(r,e){this.type=r,this.p=new qa(e.p,16),this.red=e.prime?qa.red(e.prime):qa.mont(this.p),this.zero=new qa(0).toRed(this.red),this.one=new qa(1).toRed(this.red),this.two=new qa(2).toRed(this.red),this.n=e.n&&new qa(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(Hs,"BaseCurve");mx.exports=Hs;Hs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Hs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Hs.prototype._fixedNafMul=o(function(e,t){vd(e.precomputed);var n=e._getDoubles(),i=gd(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var y=u+n.step-1;y>=u;y--)d=(d<<1)+i[y];f.push(d)}for(var w=this.jpoint(null,null,null),A=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?A=A.mixedAdd(n.points[u]):d===-O&&(A=A.mixedAdd(n.points[u].neg()));w=w.add(A)}return w.toP()},"_fixedNafMul");Hs.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=gd(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var y=0;d>=0&&f[d]===0;d--)y++;if(d>=0&&y++,u=u.dblp(y),d<0)break;var w=f[d];vd(w!==0),e.type==="affine"?w>0?u=u.mixedAdd(s[w-1>>1]):u=u.mixedAdd(s[-w-1>>1].neg()):w>0?u=u.add(s[w-1>>1]):u=u.add(s[-w-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Hs.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,y=0,w,A,O;for(w=0;w<i;w++){O=t[w];var R=O._getNAFPoints(e);f[w]=R.wnd,u[w]=R.points}for(w=i-1;w>=1;w-=2){var I=w-1,B=w;if(f[I]!==1||f[B]!==1){d[I]=gd(n[I],f[I],this._bitLength),d[B]=gd(n[B],f[B],this._bitLength),y=Math.max(d[I].length,y),y=Math.max(d[B].length,y);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=EO(n[I],n[B]);for(y=Math.max(J[0].length,y),d[I]=new Array(y),d[B]=new Array(y),A=0;A<y;A++){var ee=J[0][A]|0,Z=J[1][A]|0;d[I][A]=P[(ee+1)*3+(Z+1)],d[B][A]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(w=y;w>=0;w--){for(var j=0;w>=0;){var H=!0;for(A=0;A<i;A++)V[A]=d[A][w]|0,V[A]!==0&&(H=!1);if(!H)break;j++,w--}if(w>=0&&j++,ne=ne.dblp(j),w<0)break;for(A=0;A<i;A++){var he=V[A];he!==0&&(he>0?O=u[A][he-1>>1]:he<0&&(O=u[A][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(w=0;w<i;w++)u[w]=null;return s?ne:ne.toP()},"_wnafMulAdd");function wi(r,e){this.curve=r,this.type=e,this.precomputed=null}o(wi,"BasePoint");Hs.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Hs.prototype.decodePoint=o(function(e,t){e=qu.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?vd(e[e.length-1]%2===0):e[0]===7&&vd(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");wi.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");wi.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");wi.prototype.encode=o(function(e,t){return qu.encode(this._encode(t),e)},"encode");wi.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");wi.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");wi.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");wi.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");wi.prototype._getBeta=o(function(){return null},"_getBeta");wi.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var Hu=Re((QV,C1)=>{typeof Object.create=="function"?C1.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"):C1.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 gx=Re((eG,bx)=>{"use strict";var AO=zn(),dr=mo(),k1=Hu(),oc=ju(),SO=AO.assert;function _i(r){oc.call(this,"short",r),this.a=new dr(r.a,16).toRed(this.red),this.b=new dr(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(_i,"ShortCurve");k1(_i,oc);bx.exports=_i;_i.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 dr(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 dr(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],SO(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new dr(u.a,16),b:new dr(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");_i.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:dr.mont(e),n=new dr(2).toRed(t).redInvm(),i=n.redNeg(),s=new dr(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");_i.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 dr(1),f=new dr(0),u=new dr(0),d=new dr(1),y,w,A,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Z=d.sub(ee.mul(f));if(!A&&P.cmp(t)<0)y=B.neg(),w=s,A=P.neg(),O=J;else if(A&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=Z}R=P.neg(),I=J;var ne=A.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=y,I=w),A.negative&&(A=A.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:A,b:O},{a:R,b:I}]},"_getEndoBasis");_i.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),y=s.mul(n.b),w=f.mul(i.b),A=e.sub(u).sub(d),O=y.add(w).neg();return{k1:A,k2:O}},"_endoSplit");_i.prototype.pointFromX=o(function(e,t){e=new dr(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");_i.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");_i.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],y=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),y=y.neg(!0)),i[f*2]=d,i[f*2+1]=y,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var w=this._wnafMulAdd(1,i,s,f*2,n),A=0;A<f*2;A++)i[A]=null,s[A]=null;return w},"_endoWnafMulAdd");function Ir(r,e,t,n){oc.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new dr(e,16),this.y=new dr(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(Ir,"Point");k1(Ir,oc.BasePoint);_i.prototype.point=o(function(e,t,n){return new Ir(this,e,t,n)},"point");_i.prototype.pointFromJSON=o(function(e,t){return Ir.fromJSON(this,e,t)},"pointFromJSON");Ir.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");Ir.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");Ir.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Ir.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");Ir.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Ir.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");Ir.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Ir.prototype.getX=o(function(){return this.x.fromRed()},"getX");Ir.prototype.getY=o(function(){return this.y.fromRed()},"getY");Ir.prototype.mul=o(function(e){return e=new dr(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");Ir.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");Ir.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");Ir.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");Ir.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");Ir.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 qr(r,e,t,n){oc.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new dr(0)):(this.x=new dr(e,16),this.y=new dr(t,16),this.z=new dr(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(qr,"JPoint");k1(qr,oc.BasePoint);_i.prototype.jpoint=o(function(e,t,n){return new qr(this,e,t,n)},"jpoint");qr.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");qr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");qr.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),y=f.redSub(u);if(d.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=d.redSqr(),A=w.redMul(d),O=i.redMul(w),R=y.redSqr().redIAdd(A).redISub(O).redISub(O),I=y.redMul(O.redISub(R)).redISub(f.redMul(A)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");qr.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=u.redSqr(),w=y.redMul(u),A=n.redMul(y),O=d.redSqr().redIAdd(w).redISub(A).redISub(A),R=d.redMul(A.redISub(O)).redISub(s.redMul(w)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");qr.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,f=this.x,u=this.y,d=this.z,y=d.redSqr().redSqr(),w=u.redAdd(u);for(t=0;t<e;t++){var A=f.redSqr(),O=w.redSqr(),R=O.redSqr(),I=A.redAdd(A).redIAdd(A).redIAdd(i.redMul(y)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=w.redMul(d);t+1<e&&(y=y.redMul(R)),f=Y,d=ee,w=J}return this.curve.jpoint(f,w.redMul(s),d)},"dblp");qr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");qr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),y=d.redSqr().redISub(u).redISub(u),w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),e=y,t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(A).redISub(R);I=I.redIAdd(I);var B=A.redAdd(A).redIAdd(A),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");qr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),y=d.redSqr().redISub(u).redISub(u);e=y;var w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(A).redMul(this.x.redAdd(A));I=I.redAdd(I).redIAdd(I);var B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(A);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");qr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),y=t.redAdd(t);y=y.redIAdd(y);var w=y.redMul(u),A=d.redSqr().redISub(w.redAdd(w)),O=w.redISub(A),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(A,I,B)},"_dbl");qr.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),y=i.redIAdd(i);y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var w=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(y),A=t.redMul(w);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.x.redMul(d).redISub(A);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(w.redMul(y.redISub(w)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");qr.prototype.mul=o(function(e,t){return e=new dr(e,t),this.curve._wnafMul(this,e)},"mul");qr.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");qr.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");qr.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");qr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var xx=Re((tG,yx)=>{"use strict";var sc=mo(),vx=Hu(),yd=ju(),MO=zn();function ac(r){yd.call(this,"mont",r),this.a=new sc(r.a,16).toRed(this.red),this.b=new sc(r.b,16).toRed(this.red),this.i4=new sc(4).toRed(this.red).redInvm(),this.two=new sc(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(ac,"MontCurve");vx(ac,yd);yx.exports=ac;ac.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 Dr(r,e,t){yd.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new sc(e,16),this.z=new sc(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(Dr,"Point");vx(Dr,yd.BasePoint);ac.prototype.decodePoint=o(function(e,t){return this.point(MO.toArray(e,t),1)},"decodePoint");ac.prototype.point=o(function(e,t){return new Dr(this,e,t)},"point");ac.prototype.pointFromJSON=o(function(e){return Dr.fromJSON(this,e)},"pointFromJSON");Dr.prototype.precompute=o(function(){},"precompute");Dr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Dr.fromJSON=o(function(e,t){return new Dr(e,t[0],t[1]||e.one)},"fromJSON");Dr.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");Dr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Dr.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),f=t.redMul(i),u=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(f,u)},"dbl");Dr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Dr.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),f=e.x.redSub(e.z),u=f.redMul(n),d=s.redMul(i),y=t.z.redMul(u.redAdd(d).redSqr()),w=t.x.redMul(u.redISub(d).redSqr());return this.curve.point(y,w)},"diffAdd");Dr.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var u=f.length-1;u>=0;u--)f[u]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");Dr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Dr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Dr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Dr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Dr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var Ex=Re((rG,_x)=>{"use strict";var TO=zn(),rs=mo(),wx=Hu(),xd=ju(),CO=TO.assert;function bo(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,xd.call(this,"edwards",r),this.a=new rs(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new rs(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new rs(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),CO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(bo,"EdwardsCurve");wx(bo,xd);_x.exports=bo;bo.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");bo.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");bo.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");bo.prototype.pointFromX=o(function(e,t){e=new rs(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)),f=i.redMul(s.redInvm()),u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var d=u.fromRed().isOdd();return(t&&!d||!t&&d)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");bo.prototype.pointFromY=o(function(e,t){e=new rs(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),f=i.redMul(s.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)},"pointFromY");bo.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 nr(r,e,t,n,i){xd.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 rs(e,16),this.y=new rs(t,16),this.z=n?new rs(n,16):this.curve.one,this.t=i&&new rs(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(nr,"Point");wx(nr,xd.BasePoint);bo.prototype.pointFromJSON=o(function(e){return nr.fromJSON(this,e)},"pointFromJSON");bo.prototype.point=o(function(e,t,n,i){return new nr(this,e,t,n,i)},"point");nr.fromJSON=o(function(e,t){return new nr(e,t[0],t[1],t[2])},"fromJSON");nr.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");nr.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");nr.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),f=i.redAdd(t),u=f.redSub(n),d=i.redSub(t),y=s.redMul(u),w=f.redMul(d),A=s.redMul(d),O=u.redMul(f);return this.curve.point(y,w,O,A)},"_extDbl");nr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,f,u,d,y;if(this.curve.twisted){u=this.curve._mulA(t);var w=u.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(w.redSub(this.curve.two)),s=w.redMul(u.redSub(n)),f=w.redSqr().redSub(w).redSub(w)):(d=this.z.redSqr(),y=w.redSub(d).redISub(d),i=e.redSub(t).redISub(n).redMul(y),s=w.redMul(u.redSub(n)),f=w.redMul(y))}else u=t.redAdd(n),d=this.curve._mulC(this.z).redSqr(),y=u.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(u)).redMul(y),s=this.curve._mulC(u).redMul(t.redISub(n)),f=u.redMul(y);return this.curve.point(i,s,f)},"_projDbl");nr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");nr.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)),f=n.redSub(t),u=s.redSub(i),d=s.redAdd(i),y=n.redAdd(t),w=f.redMul(u),A=d.redMul(y),O=f.redMul(y),R=u.redMul(d);return this.curve.point(w,A,R,O)},"_extAdd");nr.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),f=this.curve.d.redMul(i).redMul(s),u=n.redSub(f),d=n.redAdd(f),y=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),w=t.redMul(u).redMul(y),A,O;return this.curve.twisted?(A=t.redMul(d).redMul(s.redSub(this.curve._mulA(i))),O=u.redMul(d)):(A=t.redMul(d).redMul(s.redSub(i)),O=this.curve._mulC(u).redMul(d)),this.curve.point(w,A,O)},"_projAdd");nr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");nr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");nr.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");nr.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");nr.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");nr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");nr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");nr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");nr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");nr.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");nr.prototype.toP=nr.prototype.normalize;nr.prototype.mixedAdd=nr.prototype.add});var I1=Re(Ax=>{"use strict";var wd=Ax;wd.base=ju();wd.short=gx();wd.mont=xx();wd.edwards=Ex()});var zi=Re(tr=>{"use strict";var kO=qs(),IO=Hu();tr.inherits=IO;function DO(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(DO,"isSurrogatePair");function RO(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):DO(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(RO,"toArray");tr.toArray=RO;function OO(r){for(var e="",t=0;t<r.length;t++)e+=Mx(r[t].toString(16));return e}o(OO,"toHex");tr.toHex=OO;function Sx(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(Sx,"htonl");tr.htonl=Sx;function NO(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=Sx(i)),t+=Tx(i.toString(16))}return t}o(NO,"toHex32");tr.toHex32=NO;function Mx(r){return r.length===1?"0"+r:r}o(Mx,"zero2");tr.zero2=Mx;function Tx(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(Tx,"zero8");tr.zero8=Tx;function PO(r,e,t,n){var i=t-e;kO(i%4===0);for(var s=new Array(i/4),f=0,u=e;f<s.length;f++,u+=4){var d;n==="big"?d=r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:d=r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],s[f]=d>>>0}return s}o(PO,"join32");tr.join32=PO;function BO(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(BO,"split32");tr.split32=BO;function LO(r,e){return r>>>e|r<<32-e}o(LO,"rotr32");tr.rotr32=LO;function UO(r,e){return r<<e|r>>>32-e}o(UO,"rotl32");tr.rotl32=UO;function FO(r,e){return r+e>>>0}o(FO,"sum32");tr.sum32=FO;function $O(r,e,t){return r+e+t>>>0}o($O,"sum32_3");tr.sum32_3=$O;function qO(r,e,t,n){return r+e+t+n>>>0}o(qO,"sum32_4");tr.sum32_4=qO;function jO(r,e,t,n,i){return r+e+t+n+i>>>0}o(jO,"sum32_5");tr.sum32_5=jO;function HO(r,e,t,n){var i=r[e],s=r[e+1],f=n+s>>>0,u=(f<n?1:0)+t+i;r[e]=u>>>0,r[e+1]=f}o(HO,"sum64");tr.sum64=HO;function zO(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(zO,"sum64_hi");tr.sum64_hi=zO;function KO(r,e,t,n){var i=e+n;return i>>>0}o(KO,"sum64_lo");tr.sum64_lo=KO;function VO(r,e,t,n,i,s,f,u){var d=0,y=e;y=y+n>>>0,d+=y<e?1:0,y=y+s>>>0,d+=y<s?1:0,y=y+u>>>0,d+=y<u?1:0;var w=r+t+i+f+d;return w>>>0}o(VO,"sum64_4_hi");tr.sum64_4_hi=VO;function GO(r,e,t,n,i,s,f,u){var d=e+n+s+u;return d>>>0}o(GO,"sum64_4_lo");tr.sum64_4_lo=GO;function WO(r,e,t,n,i,s,f,u,d,y){var w=0,A=e;A=A+n>>>0,w+=A<e?1:0,A=A+s>>>0,w+=A<s?1:0,A=A+u>>>0,w+=A<u?1:0,A=A+y>>>0,w+=A<y?1:0;var O=r+t+i+f+d+w;return O>>>0}o(WO,"sum64_5_hi");tr.sum64_5_hi=WO;function JO(r,e,t,n,i,s,f,u,d,y){var w=e+n+s+u+y;return w>>>0}o(JO,"sum64_5_lo");tr.sum64_5_lo=JO;function YO(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(YO,"rotr64_hi");tr.rotr64_hi=YO;function ZO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(ZO,"rotr64_lo");tr.rotr64_lo=ZO;function XO(r,e,t){return r>>>t}o(XO,"shr64_hi");tr.shr64_hi=XO;function QO(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(QO,"shr64_lo");tr.shr64_lo=QO});var fc=Re(kx=>{"use strict";var Cx=zi(),eN=qs();function _d(){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(_d,"BlockHash");kx.BlockHash=_d;_d.prototype.update=o(function(e,t){if(e=Cx.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=Cx.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");_d.prototype.digest=o(function(e){return this.update(this._pad()),eN(this.pending===null),this._digest(e)},"digest");_d.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 f=8;f<this.padLength;f++)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,f=8;f<this.padLength;f++)i[s++]=0;return i},"pad")});var D1=Re(ns=>{"use strict";var tN=zi(),go=tN.rotr32;function rN(r,e,t,n){if(r===0)return Ix(e,t,n);if(r===1||r===3)return Rx(e,t,n);if(r===2)return Dx(e,t,n)}o(rN,"ft_1");ns.ft_1=rN;function Ix(r,e,t){return r&e^~r&t}o(Ix,"ch32");ns.ch32=Ix;function Dx(r,e,t){return r&e^r&t^e&t}o(Dx,"maj32");ns.maj32=Dx;function Rx(r,e,t){return r^e^t}o(Rx,"p32");ns.p32=Rx;function nN(r){return go(r,2)^go(r,13)^go(r,22)}o(nN,"s0_256");ns.s0_256=nN;function iN(r){return go(r,6)^go(r,11)^go(r,25)}o(iN,"s1_256");ns.s1_256=iN;function oN(r){return go(r,7)^go(r,18)^r>>>3}o(oN,"g0_256");ns.g0_256=oN;function sN(r){return go(r,17)^go(r,19)^r>>>10}o(sN,"g1_256");ns.g1_256=sN});var Px=Re((aG,Nx)=>{"use strict";var cc=zi(),aN=fc(),fN=D1(),R1=cc.rotl32,zu=cc.sum32,cN=cc.sum32_5,uN=fN.ft_1,Ox=aN.BlockHash,lN=[1518500249,1859775393,2400959708,3395469782];function vo(){if(!(this instanceof vo))return new vo;Ox.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(vo,"SHA1");cc.inherits(vo,Ox);Nx.exports=vo;vo.blockSize=512;vo.outSize=160;vo.hmacStrength=80;vo.padLength=64;vo.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]=R1(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],y=this.h[4];for(i=0;i<n.length;i++){var w=~~(i/20),A=cN(R1(s,5),uN(w,f,u,d),y,n[i],lN[w]);y=d,d=u,u=R1(f,30),f=s,s=A}this.h[0]=zu(this.h[0],s),this.h[1]=zu(this.h[1],f),this.h[2]=zu(this.h[2],u),this.h[3]=zu(this.h[3],d),this.h[4]=zu(this.h[4],y)},"_update");vo.prototype._digest=o(function(e){return e==="hex"?cc.toHex32(this.h,"big"):cc.split32(this.h,"big")},"digest")});var O1=Re((fG,Lx)=>{"use strict";var uc=zi(),hN=fc(),lc=D1(),dN=qs(),Ki=uc.sum32,pN=uc.sum32_4,mN=uc.sum32_5,bN=lc.ch32,gN=lc.maj32,vN=lc.s0_256,yN=lc.s1_256,xN=lc.g0_256,wN=lc.g1_256,Bx=hN.BlockHash,_N=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function yo(){if(!(this instanceof yo))return new yo;Bx.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=_N,this.W=new Array(64)}o(yo,"SHA256");uc.inherits(yo,Bx);Lx.exports=yo;yo.blockSize=512;yo.outSize=256;yo.hmacStrength=192;yo.padLength=64;yo.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]=pN(wN(n[i-2]),n[i-7],xN(n[i-15]),n[i-16]);var s=this.h[0],f=this.h[1],u=this.h[2],d=this.h[3],y=this.h[4],w=this.h[5],A=this.h[6],O=this.h[7];for(dN(this.k.length===n.length),i=0;i<n.length;i++){var R=mN(O,yN(y),bN(y,w,A),this.k[i],n[i]),I=Ki(vN(s),gN(s,f,u));O=A,A=w,w=y,y=Ki(d,R),d=u,u=f,f=s,s=Ki(R,I)}this.h[0]=Ki(this.h[0],s),this.h[1]=Ki(this.h[1],f),this.h[2]=Ki(this.h[2],u),this.h[3]=Ki(this.h[3],d),this.h[4]=Ki(this.h[4],y),this.h[5]=Ki(this.h[5],w),this.h[6]=Ki(this.h[6],A),this.h[7]=Ki(this.h[7],O)},"_update");yo.prototype._digest=o(function(e){return e==="hex"?uc.toHex32(this.h,"big"):uc.split32(this.h,"big")},"digest")});var $x=Re((cG,Fx)=>{"use strict";var N1=zi(),Ux=O1();function is(){if(!(this instanceof is))return new is;Ux.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(is,"SHA224");N1.inherits(is,Ux);Fx.exports=is;is.blockSize=512;is.outSize=224;is.hmacStrength=192;is.padLength=64;is.prototype._digest=o(function(e){return e==="hex"?N1.toHex32(this.h.slice(0,7),"big"):N1.split32(this.h.slice(0,7),"big")},"digest")});var L1=Re((uG,zx)=>{"use strict";var An=zi(),EN=fc(),AN=qs(),xo=An.rotr64_hi,wo=An.rotr64_lo,qx=An.shr64_hi,jx=An.shr64_lo,zs=An.sum64,P1=An.sum64_hi,B1=An.sum64_lo,SN=An.sum64_4_hi,MN=An.sum64_4_lo,TN=An.sum64_5_hi,CN=An.sum64_5_lo,Hx=EN.BlockHash,kN=[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 Vi(){if(!(this instanceof Vi))return new Vi;Hx.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=kN,this.W=new Array(160)}o(Vi,"SHA512");An.inherits(Vi,Hx);zx.exports=Vi;Vi.blockSize=1024;Vi.outSize=512;Vi.hmacStrength=192;Vi.padLength=128;Vi.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=$N(n[i-4],n[i-3]),f=qN(n[i-4],n[i-3]),u=n[i-14],d=n[i-13],y=UN(n[i-30],n[i-29]),w=FN(n[i-30],n[i-29]),A=n[i-32],O=n[i-31];n[i]=SN(s,f,u,d,y,w,A,O),n[i+1]=MN(s,f,u,d,y,w,A,O)}},"_prepareBlock");Vi.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],f=this.h[2],u=this.h[3],d=this.h[4],y=this.h[5],w=this.h[6],A=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],B=this.h[11],Y=this.h[12],P=this.h[13],J=this.h[14],ee=this.h[15];AN(this.k.length===n.length);for(var Z=0;Z<n.length;Z+=2){var ne=J,V=ee,j=BN(O,R),H=LN(O,R),he=IN(O,R,I,B,Y,P),L=DN(O,R,I,B,Y,P),h=this.k[Z],v=this.k[Z+1],g=n[Z],l=n[Z+1],b=TN(ne,V,j,H,he,L,h,v,g,l),E=CN(ne,V,j,H,he,L,h,v,g,l);ne=NN(i,s),V=PN(i,s),j=RN(i,s,f,u,d,y),H=ON(i,s,f,u,d,y);var M=P1(ne,V,j,H),S=B1(ne,V,j,H);J=Y,ee=P,Y=I,P=B,I=O,B=R,O=P1(w,A,b,E),R=B1(A,A,b,E),w=d,A=y,d=f,y=u,f=i,u=s,i=P1(b,E,M,S),s=B1(b,E,M,S)}zs(this.h,0,i,s),zs(this.h,2,f,u),zs(this.h,4,d,y),zs(this.h,6,w,A),zs(this.h,8,O,R),zs(this.h,10,I,B),zs(this.h,12,Y,P),zs(this.h,14,J,ee)},"_update");Vi.prototype._digest=o(function(e){return e==="hex"?An.toHex32(this.h,"big"):An.split32(this.h,"big")},"digest");function IN(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(IN,"ch64_hi");function DN(r,e,t,n,i,s){var f=e&n^~e&s;return f<0&&(f+=4294967296),f}o(DN,"ch64_lo");function RN(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(RN,"maj64_hi");function ON(r,e,t,n,i,s){var f=e&n^e&s^n&s;return f<0&&(f+=4294967296),f}o(ON,"maj64_lo");function NN(r,e){var t=xo(r,e,28),n=xo(e,r,2),i=xo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(NN,"s0_512_hi");function PN(r,e){var t=wo(r,e,28),n=wo(e,r,2),i=wo(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(PN,"s0_512_lo");function BN(r,e){var t=xo(r,e,14),n=xo(r,e,18),i=xo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(BN,"s1_512_hi");function LN(r,e){var t=wo(r,e,14),n=wo(r,e,18),i=wo(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(LN,"s1_512_lo");function UN(r,e){var t=xo(r,e,1),n=xo(r,e,8),i=qx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(UN,"g0_512_hi");function FN(r,e){var t=wo(r,e,1),n=wo(r,e,8),i=jx(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(FN,"g0_512_lo");function $N(r,e){var t=xo(r,e,19),n=xo(e,r,29),i=qx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o($N,"g1_512_hi");function qN(r,e){var t=wo(r,e,19),n=wo(e,r,29),i=jx(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(qN,"g1_512_lo")});var Gx=Re((lG,Vx)=>{"use strict";var U1=zi(),Kx=L1();function os(){if(!(this instanceof os))return new os;Kx.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(os,"SHA384");U1.inherits(os,Kx);Vx.exports=os;os.blockSize=1024;os.outSize=384;os.hmacStrength=192;os.padLength=128;os.prototype._digest=o(function(e){return e==="hex"?U1.toHex32(this.h.slice(0,12),"big"):U1.split32(this.h.slice(0,12),"big")},"digest")});var Wx=Re(hc=>{"use strict";hc.sha1=Px();hc.sha224=$x();hc.sha256=O1();hc.sha384=Gx();hc.sha512=L1()});var e6=Re(Qx=>{"use strict";var ja=zi(),jN=fc(),Ed=ja.rotl32,Jx=ja.sum32,Ku=ja.sum32_3,Yx=ja.sum32_4,Xx=jN.BlockHash;function _o(){if(!(this instanceof _o))return new _o;Xx.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(_o,"RIPEMD160");ja.inherits(_o,Xx);Qx.ripemd160=_o;_o.blockSize=512;_o.outSize=160;_o.hmacStrength=192;_o.padLength=64;_o.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],f=this.h[3],u=this.h[4],d=n,y=i,w=s,A=f,O=u,R=0;R<80;R++){var I=Jx(Ed(Yx(n,Zx(R,i,s,f),e[KN[R]+t],HN(R)),GN[R]),u);n=u,u=f,f=Ed(s,10),s=i,i=I,I=Jx(Ed(Yx(d,Zx(79-R,y,w,A),e[VN[R]+t],zN(R)),WN[R]),O),d=O,O=A,A=Ed(w,10),w=y,y=I}I=Ku(this.h[1],s,A),this.h[1]=Ku(this.h[2],f,O),this.h[2]=Ku(this.h[3],u,d),this.h[3]=Ku(this.h[4],n,y),this.h[4]=Ku(this.h[0],i,w),this.h[0]=I},"update");_o.prototype._digest=o(function(e){return e==="hex"?ja.toHex32(this.h,"little"):ja.split32(this.h,"little")},"digest");function Zx(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(Zx,"f");function HN(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(HN,"K");function zN(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(zN,"Kh");var KN=[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],VN=[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],GN=[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],WN=[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 r6=Re((pG,t6)=>{"use strict";var JN=zi(),YN=qs();function dc(r,e,t){if(!(this instanceof dc))return new dc(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(JN.toArray(e,t))}o(dc,"Hmac");t6.exports=dc;dc.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),YN(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");dc.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");dc.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var Vu=Re(n6=>{var jr=n6;jr.utils=zi();jr.common=fc();jr.sha=Wx();jr.ripemd=e6();jr.hmac=r6();jr.sha1=jr.sha.sha1;jr.sha256=jr.sha.sha256;jr.sha224=jr.sha.sha224;jr.sha384=jr.sha.sha384;jr.sha512=jr.sha.sha512;jr.ripemd160=jr.ripemd.ripemd160});var o6=Re((bG,i6)=>{i6.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 Ad=Re(f6=>{"use strict";var $1=f6,Ks=Vu(),F1=I1(),ZN=zn(),s6=ZN.assert;function a6(r){r.type==="short"?this.curve=new F1.short(r):r.type==="edwards"?this.curve=new F1.edwards(r):this.curve=new F1.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,s6(this.g.validate(),"Invalid curve"),s6(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(a6,"PresetCurve");$1.PresetCurve=a6;function Vs(r,e){Object.defineProperty($1,r,{configurable:!0,enumerable:!0,get:function(){var t=new a6(e);return Object.defineProperty($1,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(Vs,"defineCurve");Vs("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:Ks.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Vs("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:Ks.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Vs("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:Ks.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Vs("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:Ks.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"]});Vs("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:Ks.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"]});Vs("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ks.sha256,gRed:!1,g:["9"]});Vs("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:Ks.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var q1;try{q1=o6()}catch{q1=void 0}Vs("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:Ks.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",q1]})});var l6=Re((vG,u6)=>{"use strict";var XN=Vu(),Ha=E1(),c6=qs();function Gs(r){if(!(this instanceof Gs))return new Gs(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=Ha.toArray(r.entropy,r.entropyEnc||"hex"),t=Ha.toArray(r.nonce,r.nonceEnc||"hex"),n=Ha.toArray(r.pers,r.persEnc||"hex");c6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(Gs,"HmacDRBG");u6.exports=Gs;Gs.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");Gs.prototype._hmac=o(function(){return new XN.hmac(this.hash,this.K)},"hmac");Gs.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");Gs.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Ha.toArray(e,t),n=Ha.toArray(n,i),c6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Gs.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=Ha.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 f=s.slice(0,e);return this._update(n),this._reseed++,Ha.encode(f,t)},"generate")});var d6=Re((yG,h6)=>{"use strict";var QN=mo(),eP=zn(),j1=eP.assert;function Zr(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(Zr,"KeyPair");h6.exports=Zr;Zr.fromPublic=o(function(e,t,n){return t instanceof Zr?t:new Zr(e,{pub:t,pubEnc:n})},"fromPublic");Zr.fromPrivate=o(function(e,t,n){return t instanceof Zr?t:new Zr(e,{priv:t,privEnc:n})},"fromPrivate");Zr.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");Zr.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");Zr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Zr.prototype._importPrivate=o(function(e,t){this.priv=new QN(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Zr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?j1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&j1(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");Zr.prototype.derive=o(function(e){return e.validate()||j1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Zr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");Zr.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");Zr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var b6=Re((xG,m6)=>{"use strict";var Sd=mo(),K1=zn(),tP=K1.assert;function Md(r,e){if(r instanceof Md)return r;this._importDER(r,e)||(tP(r.r&&r.s,"Signature without r or s"),this.r=new Sd(r.r,16),this.s=new Sd(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(Md,"Signature");m6.exports=Md;function rP(){this.place=0}o(rP,"Position");function H1(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4||r[e.place]===0)return!1;for(var i=0,s=0,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(H1,"getLength");function p6(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(p6,"rmPadding");Md.prototype._importDER=o(function(e,t){e=K1.toArray(e,t);var n=new rP;if(e[n.place++]!==48)return!1;var i=H1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=H1(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=H1(e,n);if(u===!1||e.length!==u+n.place||(e[n.place]&128)!==0)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new Sd(f),this.s=new Sd(d),this.recoveryParam=null,!0},"_importDER");function z1(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(z1,"constructLength");Md.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=p6(t),n=p6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];z1(i,t.length),i=i.concat(t),i.push(2),z1(i,n.length);var s=i.concat(n),f=[48];return z1(f,s.length),f=f.concat(s),K1.encode(f,e)},"toDER")});var y6=Re((wG,v6)=>{"use strict";var Gi=mo(),g6=l6(),nP=zn(),V1=Ad(),iP=T1(),za=nP.assert,G1=d6(),Td=b6();function Ei(r){if(!(this instanceof Ei))return new Ei(r);typeof r=="string"&&(za(Object.prototype.hasOwnProperty.call(V1,r),"Unknown curve "+r),r=V1[r]),r instanceof V1.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(Ei,"EC");v6.exports=Ei;Ei.prototype.keyPair=o(function(e){return new G1(this,e)},"keyPair");Ei.prototype.keyFromPrivate=o(function(e,t){return G1.fromPrivate(this,e,t)},"keyFromPrivate");Ei.prototype.keyFromPublic=o(function(e,t){return G1.fromPublic(this,e,t)},"keyFromPublic");Ei.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new g6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||iP(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Gi(2));;){var s=new Gi(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");Ei.prototype._truncateToN=o(function(e,t,n){var i;if(Gi.isBN(e)||typeof e=="number")e=new Gi(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new Gi(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new Gi(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");Ei.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!Gi.isBN(e)){za(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),za(e.length>>>0===e.length);for(var s=0;s<e.length;s++)za((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),za(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);za(new Gi(d).eq(e),"Can not sign message");for(var y=new g6({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),w=this.n.sub(new Gi(1)),A=0;;A++){var O=i.k?i.k(A):new Gi(y.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(w)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new Td({r:B,s:Y,recoveryParam:P})}}}}}},"sign");Ei.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new Td(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),y=d.mul(e).umod(this.n),w=d.mul(f).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.eqXToP(f)):(A=this.g.mulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.getX().umod(this.n).cmp(f)===0)},"verify");Ei.prototype.recoverPubKey=function(r,e,t,n){za((3&t)===t,"The recovery param is more than two bits"),e=new Td(e,n);var i=this.n,s=new Gi(r),f=e.r,u=e.s,d=t&1,y=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var w=e.r.invm(i),A=i.sub(s).mul(w).umod(i),O=u.mul(w).umod(i);return this.g.mulAdd(A,f,O)};Ei.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Td(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var E6=Re((_G,_6)=>{"use strict";var Gu=zn(),w6=Gu.assert,x6=Gu.parseBytes,pc=Gu.cachedProperty;function Rr(r,e){this.eddsa=r,this._secret=x6(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=x6(e.pub)}o(Rr,"KeyPair");Rr.fromPublic=o(function(e,t){return t instanceof Rr?t:new Rr(e,{pub:t})},"fromPublic");Rr.fromSecret=o(function(e,t){return t instanceof Rr?t:new Rr(e,{secret:t})},"fromSecret");Rr.prototype.secret=o(function(){return this._secret},"secret");pc(Rr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));pc(Rr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));pc(Rr,"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"));pc(Rr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));pc(Rr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));pc(Rr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Rr.prototype.sign=o(function(e){return w6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Rr.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Rr.prototype.getSecret=o(function(e){return w6(this._secret,"KeyPair is public only"),Gu.encode(this.secret(),e)},"getSecret");Rr.prototype.getPublic=o(function(e){return Gu.encode(this.pubBytes(),e)},"getPublic");_6.exports=Rr});var M6=Re((EG,S6)=>{"use strict";var oP=mo(),Cd=zn(),A6=Cd.assert,kd=Cd.cachedProperty,sP=Cd.parseBytes;function Ka(r,e){this.eddsa=r,typeof e!="object"&&(e=sP(e)),Array.isArray(e)&&(A6(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),A6(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof oP&&(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(Ka,"Signature");kd(Ka,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));kd(Ka,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));kd(Ka,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));kd(Ka,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Ka.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Ka.prototype.toHex=o(function(){return Cd.encode(this.toBytes(),"hex").toUpperCase()},"toHex");S6.exports=Ka});var D6=Re((AG,I6)=>{"use strict";var aP=Vu(),fP=Ad(),mc=zn(),cP=mc.assert,C6=mc.parseBytes,k6=E6(),T6=M6();function Sn(r){if(cP(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sn))return new Sn(r);r=fP[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=aP.sha512}o(Sn,"EDDSA");I6.exports=Sn;Sn.prototype.sign=o(function(e,t){e=C6(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),f=this.encodePoint(s),u=this.hashInt(f,n.pubBytes(),e).mul(n.priv()),d=i.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:d,Rencoded:f})},"sign");Sn.prototype.verify=o(function(e,t,n){if(e=C6(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),f=this.g.mul(t.S()),u=t.R().add(i.pub().mul(s));return u.eq(f)},"verify");Sn.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return mc.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");Sn.prototype.keyFromPublic=o(function(e){return k6.fromPublic(this,e)},"keyFromPublic");Sn.prototype.keyFromSecret=o(function(e){return k6.fromSecret(this,e)},"keyFromSecret");Sn.prototype.makeSignature=o(function(e){return e instanceof T6?e:new T6(this,e)},"makeSignature");Sn.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");Sn.prototype.decodePoint=o(function(e){e=mc.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=mc.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");Sn.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");Sn.prototype.decodeInt=o(function(e){return mc.intFromLE(e)},"decodeInt");Sn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var O6=Re(R6=>{"use strict";var Va=R6;Va.version=ax().version;Va.utils=zn();Va.rand=T1();Va.curve=I1();Va.curves=Ad();Va.ec=y6();Va.eddsa=D6()});var P6=Re(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.BrowserRandomSource=void 0;var N6=65536,Id=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=N6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,N6)));return t}};o(Id,"BrowserRandomSource");Dd.BrowserRandomSource=Id});var B6=Re(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.NodeRandomSource=void 0;var uP=xi(),Rd=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=t[i];return(0,uP.wipe)(t),n}};o(Rd,"NodeRandomSource");Od.NodeRandomSource=Rd});var L6=Re(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.SystemRandomSource=void 0;var lP=P6(),hP=B6(),Nd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new lP.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new hP.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};o(Nd,"SystemRandomSource");Pd.SystemRandomSource=Nd});var Ga=Re(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.randomStringForEntropy=Xr.randomString=Xr.randomUint32=Xr.randomBytes=Xr.defaultRandomSource=void 0;var dP=L6(),pP=$a(),U6=xi();Xr.defaultRandomSource=new dP.SystemRandomSource;function W1(r,e=Xr.defaultRandomSource){return e.randomBytes(r)}o(W1,"randomBytes");Xr.randomBytes=W1;function mP(r=Xr.defaultRandomSource){let e=W1(4,r),t=(0,pP.readUint32LE)(e);return(0,U6.wipe)(e),t}o(mP,"randomUint32");Xr.randomUint32=mP;var F6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function $6(r,e=F6,t=Xr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",i=e.length,s=256-256%i;for(;r>0;){let f=W1(Math.ceil(r*256/s),t);for(let u=0;u<f.length&&r>0;u++){let d=f[u];d<s&&(n+=e.charAt(d%i),r--)}(0,U6.wipe)(f)}return n}o($6,"randomString");Xr.randomString=$6;function bP(r,e=F6,t=Xr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return $6(n,e,t)}o(bP,"randomStringForEntropy");Xr.randomStringForEntropy=bP});var H6=Re(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var gc=$a(),bc=xi();ss.DIGEST_LENGTH=64;ss.BLOCK_SIZE=128;var j6=function(){function r(){this.digestLength=ss.DIGEST_LENGTH,this.blockSize=ss.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(){bc.wipe(this._buffer),bc.wipe(this._tempHi),bc.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<ss.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(J1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=J1(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,f=t%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<f-8;u++)this._buffer[u]=0;gc.writeUint32BE(i,this._buffer,f-8),gc.writeUint32BE(s,this._buffer,f-4),J1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,f),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)gc.writeUint32BE(this._stateHi[u],e,u*8),gc.writeUint32BE(this._stateLo[u],e,u*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){bc.wipe(e.stateHi),bc.wipe(e.stateLo),e.buffer&&bc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();ss.SHA512=j6;var q6=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 J1(r,e,t,n,i,s,f){for(var u=t[0],d=t[1],y=t[2],w=t[3],A=t[4],O=t[5],R=t[6],I=t[7],B=n[0],Y=n[1],P=n[2],J=n[3],ee=n[4],Z=n[5],ne=n[6],V=n[7],j,H,he,L,h,v,g,l;f>=128;){for(var b=0;b<16;b++){var E=8*b+s;r[b]=gc.readUint32BE(i,E),e[b]=gc.readUint32BE(i,E+4)}for(var b=0;b<80;b++){var M=u,S=d,x=y,C=w,N=A,_=O,k=R,fe=I,D=B,Q=Y,se=P,q=J,z=ee,G=Z,te=ne,ae=V;if(j=I,H=V,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=(A>>>14|ee<<32-14)^(A>>>18|ee<<32-18)^(ee>>>41-32|A<<32-(41-32)),H=(ee>>>14|A<<32-14)^(ee>>>18|A<<32-18)^(A>>>41-32|ee<<32-(41-32)),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=A&O^~A&R,H=ee&Z^~ee&ne,h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=q6[b*2],H=q6[b*2+1],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=r[b%16],H=e[b%16],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,he=g&65535|l<<16,L=h&65535|v<<16,j=he,H=L,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=(u>>>28|B<<32-28)^(B>>>34-32|u<<32-(34-32))^(B>>>39-32|u<<32-(39-32)),H=(B>>>28|u<<32-28)^(u>>>34-32|B<<32-(34-32))^(u>>>39-32|B<<32-(39-32)),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,j=u&d^u&y^d&y,H=B&Y^B&P^Y&P,h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,fe=g&65535|l<<16,ae=h&65535|v<<16,j=C,H=q,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=he,H=L,h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,C=g&65535|l<<16,q=h&65535|v<<16,d=M,y=S,w=x,A=C,O=N,R=_,I=k,u=fe,Y=D,P=Q,J=se,ee=q,Z=z,ne=G,V=te,B=ae,b%16===15)for(var E=0;E<16;E++)j=r[E],H=e[E],h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=r[(E+9)%16],H=e[(E+9)%16],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,he=r[(E+1)%16],L=e[(E+1)%16],j=(he>>>1|L<<32-1)^(he>>>8|L<<32-8)^he>>>7,H=(L>>>1|he<<32-1)^(L>>>8|he<<32-8)^(L>>>7|he<<32-7),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,he=r[(E+14)%16],L=e[(E+14)%16],j=(he>>>19|L<<32-19)^(L>>>61-32|he<<32-(61-32))^he>>>6,H=(L>>>19|he<<32-19)^(he>>>61-32|L<<32-(61-32))^(L>>>6|he<<32-6),h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,r[E]=g&65535|l<<16,e[E]=h&65535|v<<16}j=u,H=B,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[0],H=n[0],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[0]=u=g&65535|l<<16,n[0]=B=h&65535|v<<16,j=d,H=Y,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[1],H=n[1],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[1]=d=g&65535|l<<16,n[1]=Y=h&65535|v<<16,j=y,H=P,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[2],H=n[2],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[2]=y=g&65535|l<<16,n[2]=P=h&65535|v<<16,j=w,H=J,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[3],H=n[3],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[3]=w=g&65535|l<<16,n[3]=J=h&65535|v<<16,j=A,H=ee,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[4],H=n[4],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[4]=A=g&65535|l<<16,n[4]=ee=h&65535|v<<16,j=O,H=Z,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[5],H=n[5],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[5]=O=g&65535|l<<16,n[5]=Z=h&65535|v<<16,j=R,H=ne,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[6],H=n[6],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[6]=R=g&65535|l<<16,n[6]=ne=h&65535|v<<16,j=I,H=V,h=H&65535,v=H>>>16,g=j&65535,l=j>>>16,j=t[7],H=n[7],h+=H&65535,v+=H>>>16,g+=j&65535,l+=j>>>16,v+=h>>>16,g+=v>>>16,l+=g>>>16,t[7]=I=g&65535|l<<16,n[7]=V=h&65535|v<<16,s+=128,f-=128}return s}o(J1,"hashBlocks");function gP(r){var e=new j6;e.update(r);var t=e.digest();return e.clean(),t}o(gP,"hash");ss.hash=gP});var Bd=Re(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.convertSecretKeyToX25519=Wt.convertPublicKeyToX25519=Wt.verify=Wt.sign=Wt.extractPublicKeyFromSecretKey=Wt.generateKeyPair=Wt.generateKeyPairFromSeed=Wt.SEED_LENGTH=Wt.SECRET_KEY_LENGTH=Wt.PUBLIC_KEY_LENGTH=Wt.SIGNATURE_LENGTH=void 0;var vP=Ga(),Wu=H6(),W6=xi();Wt.SIGNATURE_LENGTH=64;Wt.PUBLIC_KEY_LENGTH=32;Wt.SECRET_KEY_LENGTH=64;Wt.SEED_LENGTH=32;function We(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(We,"gf");var yP=new Uint8Array(32);yP[0]=9;var X1=We(),vc=We([1]),xP=We([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),wP=We([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),z6=We([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),K6=We([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_P=We([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ws(r,e){for(let t=0;t<16;t++)r[t]=e[t]|0}o(Ws,"set25519");function Y1(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Y1,"car25519");function J6(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(J6,"sel25519");function Ju(r,e){let t=We(),n=We();for(let i=0;i<16;i++)n[i]=e[i];Y1(n),Y1(n),Y1(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,J6(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(Ju,"pack25519");function Y6(r,e){let t=0;for(let n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(Y6,"verify32");function V6(r,e){let t=new Uint8Array(32),n=new Uint8Array(32);return Ju(t,r),Ju(n,e),Y6(t,n)}o(V6,"neq25519");function Z6(r){let e=new Uint8Array(32);return Ju(e,r),e[0]&1}o(Z6,"par25519");function EP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(EP,"unpack25519");function Wa(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Wa,"add");function Ya(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ya,"sub");function Xt(r,e,t){let n,i,s=0,f=0,u=0,d=0,y=0,w=0,A=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,Z=0,ne=0,V=0,j=0,H=0,he=0,L=0,h=0,v=0,g=0,l=0,b=0,E=0,M=0,S=0,x=0,C=t[0],N=t[1],_=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],z=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*_,d+=n*k,y+=n*fe,w+=n*D,A+=n*Q,O+=n*se,R+=n*q,I+=n*z,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,Z+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*_,y+=n*k,w+=n*fe,A+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*z,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,Z+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,y+=n*_,w+=n*k,A+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*z,P+=n*G,J+=n*te,ee+=n*ae,Z+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,y+=n*N,w+=n*_,A+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*z,J+=n*G,ee+=n*te,Z+=n*ae,ne+=n*Ae,V+=n*ge,j+=n*ie,n=e[4],y+=n*C,w+=n*N,A+=n*_,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*z,ee+=n*G,Z+=n*te,ne+=n*ae,V+=n*Ae,j+=n*ge,H+=n*ie,n=e[5],w+=n*C,A+=n*N,O+=n*_,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*z,Z+=n*G,ne+=n*te,V+=n*ae,j+=n*Ae,H+=n*ge,he+=n*ie,n=e[6],A+=n*C,O+=n*N,R+=n*_,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,Z+=n*z,ne+=n*G,V+=n*te,j+=n*ae,H+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*_,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,Z+=n*q,ne+=n*z,V+=n*G,j+=n*te,H+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*_,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,Z+=n*se,ne+=n*q,V+=n*z,j+=n*G,H+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,v+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*_,P+=n*k,J+=n*fe,ee+=n*D,Z+=n*Q,ne+=n*se,V+=n*q,j+=n*z,H+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,v+=n*ge,g+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*_,J+=n*k,ee+=n*fe,Z+=n*D,ne+=n*Q,V+=n*se,j+=n*q,H+=n*z,he+=n*G,L+=n*te,h+=n*ae,v+=n*Ae,g+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*_,ee+=n*k,Z+=n*fe,ne+=n*D,V+=n*Q,j+=n*se,H+=n*q,he+=n*z,L+=n*G,h+=n*te,v+=n*ae,g+=n*Ae,l+=n*ge,b+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*_,Z+=n*k,ne+=n*fe,V+=n*D,j+=n*Q,H+=n*se,he+=n*q,L+=n*z,h+=n*G,v+=n*te,g+=n*ae,l+=n*Ae,b+=n*ge,E+=n*ie,n=e[13],J+=n*C,ee+=n*N,Z+=n*_,ne+=n*k,V+=n*fe,j+=n*D,H+=n*Q,he+=n*se,L+=n*q,h+=n*z,v+=n*G,g+=n*te,l+=n*ae,b+=n*Ae,E+=n*ge,M+=n*ie,n=e[14],ee+=n*C,Z+=n*N,ne+=n*_,V+=n*k,j+=n*fe,H+=n*D,he+=n*Q,L+=n*se,h+=n*q,v+=n*z,g+=n*G,l+=n*te,b+=n*ae,E+=n*Ae,M+=n*ge,S+=n*ie,n=e[15],Z+=n*C,ne+=n*N,V+=n*_,j+=n*k,H+=n*fe,he+=n*D,L+=n*Q,h+=n*se,v+=n*q,g+=n*z,l+=n*G,b+=n*te,E+=n*ae,M+=n*Ae,S+=n*ge,x+=n*ie,s+=38*ne,f+=38*V,u+=38*j,d+=38*H,y+=38*he,w+=38*L,A+=38*h,O+=38*v,R+=38*g,I+=38*l,B+=38*b,Y+=38*E,P+=38*M,J+=38*S,ee+=38*x,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=y,r[5]=w,r[6]=A,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=Z}o(Xt,"mul");function Ja(r,e){Xt(r,e,e)}o(Ja,"square");function X6(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Ja(t,t),n!==2&&n!==4&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(X6,"inv25519");function AP(r,e){let t=We(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Ja(t,t),n!==1&&Xt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(AP,"pow2523");function Q1(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We(),y=We(),w=We();Ya(t,r[1],r[0]),Ya(w,e[1],e[0]),Xt(t,t,w),Wa(n,r[0],r[1]),Wa(w,e[0],e[1]),Xt(n,n,w),Xt(i,r[3],e[3]),Xt(i,i,wP),Xt(s,r[2],e[2]),Wa(s,s,s),Ya(f,n,t),Ya(u,s,i),Wa(d,s,i),Wa(y,n,t),Xt(r[0],f,u),Xt(r[1],y,d),Xt(r[2],d,u),Xt(r[3],f,y)}o(Q1,"edadd");function G6(r,e,t){for(let n=0;n<4;n++)J6(r[n],e[n],t)}o(G6,"cswap");function tb(r,e){let t=We(),n=We(),i=We();X6(i,e[2]),Xt(t,e[0],i),Xt(n,e[1],i),Ju(r,n),r[31]^=Z6(t)<<7}o(tb,"pack");function Q6(r,e,t){Ws(r[0],X1),Ws(r[1],vc),Ws(r[2],vc),Ws(r[3],X1);for(let n=255;n>=0;--n){let i=t[n/8|0]>>(n&7)&1;G6(r,e,i),Q1(e,r),Q1(r,r),G6(r,e,i)}}o(Q6,"scalarmult");function rb(r,e){let t=[We(),We(),We(),We()];Ws(t[0],z6),Ws(t[1],K6),Ws(t[2],vc),Xt(t[3],z6,K6),Q6(r,t,e)}o(rb,"scalarbase");function ew(r){if(r.length!==Wt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Wt.SEED_LENGTH} bytes`);let e=(0,Wu.hash)(r);e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(32),n=[We(),We(),We(),We()];rb(n,e),tb(t,n);let i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(ew,"generateKeyPairFromSeed");Wt.generateKeyPairFromSeed=ew;function SP(r){let e=(0,vP.randomBytes)(32,r),t=ew(e);return(0,W6.wipe)(e),t}o(SP,"generateKeyPair");Wt.generateKeyPair=SP;function MP(r){if(r.length!==Wt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Wt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(r.subarray(32))}o(MP,"extractPublicKeyFromSecretKey");Wt.extractPublicKeyFromSecretKey=MP;var Z1=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 tw(r,e){let 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]*Z1[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)*Z1[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Z1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(tw,"modL");function eb(r){let e=new Float64Array(64);for(let t=0;t<64;t++)e[t]=r[t];for(let t=0;t<64;t++)r[t]=0;tw(r,e)}o(eb,"reduce");function TP(r,e){let t=new Float64Array(64),n=[We(),We(),We(),We()],i=(0,Wu.hash)(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let s=new Uint8Array(64);s.set(i.subarray(32),32);let f=new Wu.SHA512;f.update(s.subarray(32)),f.update(e);let u=f.digest();f.clean(),eb(u),rb(n,u),tb(s,n),f.reset(),f.update(s.subarray(0,32)),f.update(r.subarray(32)),f.update(e);let d=f.digest();eb(d);for(let y=0;y<32;y++)t[y]=u[y];for(let y=0;y<32;y++)for(let w=0;w<32;w++)t[y+w]+=d[y]*i[w];return tw(s.subarray(32),t),s}o(TP,"sign");Wt.sign=TP;function rw(r,e){let t=We(),n=We(),i=We(),s=We(),f=We(),u=We(),d=We();return Ws(r[2],vc),EP(r[1],e),Ja(i,r[1]),Xt(s,i,xP),Ya(i,i,r[2]),Wa(s,r[2],s),Ja(f,s),Ja(u,f),Xt(d,u,f),Xt(t,d,i),Xt(t,t,s),AP(t,t),Xt(t,t,i),Xt(t,t,s),Xt(t,t,s),Xt(r[0],t,s),Ja(n,r[0]),Xt(n,n,s),V6(n,i)&&Xt(r[0],r[0],_P),Ja(n,r[0]),Xt(n,n,s),V6(n,i)?-1:(Z6(r[0])===e[31]>>7&&Ya(r[0],X1,r[0]),Xt(r[3],r[0],r[1]),0)}o(rw,"unpackneg");function CP(r,e,t){let n=new Uint8Array(32),i=[We(),We(),We(),We()],s=[We(),We(),We(),We()];if(t.length!==Wt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Wt.SIGNATURE_LENGTH} bytes`);if(rw(s,r))return!1;let f=new Wu.SHA512;f.update(t.subarray(0,32)),f.update(r),f.update(e);let u=f.digest();return eb(u),Q6(i,s,u),rb(s,t.subarray(32)),Q1(i,s),tb(n,i),!Y6(t,n)}o(CP,"verify");Wt.verify=CP;function kP(r){let e=[We(),We(),We(),We()];if(rw(e,r))throw new Error("Ed25519: invalid public key");let t=We(),n=We(),i=e[1];Wa(t,vc,i),Ya(n,vc,i),X6(n,n),Xt(t,t,n);let s=new Uint8Array(32);return Ju(s,t),s}o(kP,"convertPublicKeyToX25519");Wt.convertPublicKeyToX25519=kP;function IP(r){let e=(0,Wu.hash)(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let t=new Uint8Array(e.subarray(0,32));return(0,W6.wipe)(e),t}o(IP,"convertSecretKeyToX25519");Wt.convertSecretKeyToX25519=IP});var iw=Re((RG,nw)=>{"use strict";nw.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?"":",",f=n===void 0||typeof n=="symbol"?null:n;return t+s+r(f)},"")+"]":"{"+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 fw=Re(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.sharedKey=pr.generateKeyPair=pr.generateKeyPairFromSeed=pr.scalarMultBase=pr.scalarMult=pr.SHARED_KEY_LENGTH=pr.SECRET_KEY_LENGTH=pr.PUBLIC_KEY_LENGTH=void 0;var DP=Ga(),RP=xi();pr.PUBLIC_KEY_LENGTH=32;pr.SECRET_KEY_LENGTH=32;pr.SHARED_KEY_LENGTH=32;function Eo(r){let e=new Float64Array(16);if(r)for(let t=0;t<r.length;t++)e[t]=r[t];return e}o(Eo,"gf");var ow=new Uint8Array(32);ow[0]=9;var OP=Eo([56129,1]);function nb(r){let e=1;for(let t=0;t<16;t++){let n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(nb,"car25519");function Yu(r,e,t){let n=~(t-1);for(let i=0;i<16;i++){let s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(Yu,"sel25519");function NP(r,e){let t=Eo(),n=Eo();for(let i=0;i<16;i++)n[i]=e[i];nb(n),nb(n),nb(n);for(let i=0;i<2;i++){t[0]=n[0]-65517;for(let f=1;f<15;f++)t[f]=n[f]-65535-(t[f-1]>>16&1),t[f-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);let s=t[15]>>16&1;t[14]&=65535,Yu(n,t,1-s)}for(let i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(NP,"pack25519");function PP(r,e){for(let t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(PP,"unpack25519");function Ld(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]+t[n]}o(Ld,"add");function Ud(r,e,t){for(let n=0;n<16;n++)r[n]=e[n]-t[n]}o(Ud,"sub");function as(r,e,t){let n,i,s=0,f=0,u=0,d=0,y=0,w=0,A=0,O=0,R=0,I=0,B=0,Y=0,P=0,J=0,ee=0,Z=0,ne=0,V=0,j=0,H=0,he=0,L=0,h=0,v=0,g=0,l=0,b=0,E=0,M=0,S=0,x=0,C=t[0],N=t[1],_=t[2],k=t[3],fe=t[4],D=t[5],Q=t[6],se=t[7],q=t[8],z=t[9],G=t[10],te=t[11],ae=t[12],Ae=t[13],ge=t[14],ie=t[15];n=e[0],s+=n*C,f+=n*N,u+=n*_,d+=n*k,y+=n*fe,w+=n*D,A+=n*Q,O+=n*se,R+=n*q,I+=n*z,B+=n*G,Y+=n*te,P+=n*ae,J+=n*Ae,ee+=n*ge,Z+=n*ie,n=e[1],f+=n*C,u+=n*N,d+=n*_,y+=n*k,w+=n*fe,A+=n*D,O+=n*Q,R+=n*se,I+=n*q,B+=n*z,Y+=n*G,P+=n*te,J+=n*ae,ee+=n*Ae,Z+=n*ge,ne+=n*ie,n=e[2],u+=n*C,d+=n*N,y+=n*_,w+=n*k,A+=n*fe,O+=n*D,R+=n*Q,I+=n*se,B+=n*q,Y+=n*z,P+=n*G,J+=n*te,ee+=n*ae,Z+=n*Ae,ne+=n*ge,V+=n*ie,n=e[3],d+=n*C,y+=n*N,w+=n*_,A+=n*k,O+=n*fe,R+=n*D,I+=n*Q,B+=n*se,Y+=n*q,P+=n*z,J+=n*G,ee+=n*te,Z+=n*ae,ne+=n*Ae,V+=n*ge,j+=n*ie,n=e[4],y+=n*C,w+=n*N,A+=n*_,O+=n*k,R+=n*fe,I+=n*D,B+=n*Q,Y+=n*se,P+=n*q,J+=n*z,ee+=n*G,Z+=n*te,ne+=n*ae,V+=n*Ae,j+=n*ge,H+=n*ie,n=e[5],w+=n*C,A+=n*N,O+=n*_,R+=n*k,I+=n*fe,B+=n*D,Y+=n*Q,P+=n*se,J+=n*q,ee+=n*z,Z+=n*G,ne+=n*te,V+=n*ae,j+=n*Ae,H+=n*ge,he+=n*ie,n=e[6],A+=n*C,O+=n*N,R+=n*_,I+=n*k,B+=n*fe,Y+=n*D,P+=n*Q,J+=n*se,ee+=n*q,Z+=n*z,ne+=n*G,V+=n*te,j+=n*ae,H+=n*Ae,he+=n*ge,L+=n*ie,n=e[7],O+=n*C,R+=n*N,I+=n*_,B+=n*k,Y+=n*fe,P+=n*D,J+=n*Q,ee+=n*se,Z+=n*q,ne+=n*z,V+=n*G,j+=n*te,H+=n*ae,he+=n*Ae,L+=n*ge,h+=n*ie,n=e[8],R+=n*C,I+=n*N,B+=n*_,Y+=n*k,P+=n*fe,J+=n*D,ee+=n*Q,Z+=n*se,ne+=n*q,V+=n*z,j+=n*G,H+=n*te,he+=n*ae,L+=n*Ae,h+=n*ge,v+=n*ie,n=e[9],I+=n*C,B+=n*N,Y+=n*_,P+=n*k,J+=n*fe,ee+=n*D,Z+=n*Q,ne+=n*se,V+=n*q,j+=n*z,H+=n*G,he+=n*te,L+=n*ae,h+=n*Ae,v+=n*ge,g+=n*ie,n=e[10],B+=n*C,Y+=n*N,P+=n*_,J+=n*k,ee+=n*fe,Z+=n*D,ne+=n*Q,V+=n*se,j+=n*q,H+=n*z,he+=n*G,L+=n*te,h+=n*ae,v+=n*Ae,g+=n*ge,l+=n*ie,n=e[11],Y+=n*C,P+=n*N,J+=n*_,ee+=n*k,Z+=n*fe,ne+=n*D,V+=n*Q,j+=n*se,H+=n*q,he+=n*z,L+=n*G,h+=n*te,v+=n*ae,g+=n*Ae,l+=n*ge,b+=n*ie,n=e[12],P+=n*C,J+=n*N,ee+=n*_,Z+=n*k,ne+=n*fe,V+=n*D,j+=n*Q,H+=n*se,he+=n*q,L+=n*z,h+=n*G,v+=n*te,g+=n*ae,l+=n*Ae,b+=n*ge,E+=n*ie,n=e[13],J+=n*C,ee+=n*N,Z+=n*_,ne+=n*k,V+=n*fe,j+=n*D,H+=n*Q,he+=n*se,L+=n*q,h+=n*z,v+=n*G,g+=n*te,l+=n*ae,b+=n*Ae,E+=n*ge,M+=n*ie,n=e[14],ee+=n*C,Z+=n*N,ne+=n*_,V+=n*k,j+=n*fe,H+=n*D,he+=n*Q,L+=n*se,h+=n*q,v+=n*z,g+=n*G,l+=n*te,b+=n*ae,E+=n*Ae,M+=n*ge,S+=n*ie,n=e[15],Z+=n*C,ne+=n*N,V+=n*_,j+=n*k,H+=n*fe,he+=n*D,L+=n*Q,h+=n*se,v+=n*q,g+=n*z,l+=n*G,b+=n*te,E+=n*ae,M+=n*Ae,S+=n*ge,x+=n*ie,s+=38*ne,f+=38*V,u+=38*j,d+=38*H,y+=38*he,w+=38*L,A+=38*h,O+=38*v,R+=38*g,I+=38*l,B+=38*b,Y+=38*E,P+=38*M,J+=38*S,ee+=38*x,i=1,n=s+i+65535,i=Math.floor(n/65536),s=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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=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=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=w+i+65535,i=Math.floor(n/65536),w=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=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,n=P+i+65535,i=Math.floor(n/65536),P=n-i*65536,n=J+i+65535,i=Math.floor(n/65536),J=n-i*65536,n=ee+i+65535,i=Math.floor(n/65536),ee=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=f,r[2]=u,r[3]=d,r[4]=y,r[5]=w,r[6]=A,r[7]=O,r[8]=R,r[9]=I,r[10]=B,r[11]=Y,r[12]=P,r[13]=J,r[14]=ee,r[15]=Z}o(as,"mul");function Zu(r,e){as(r,e,e)}o(Zu,"square");function BP(r,e){let t=Eo();for(let n=0;n<16;n++)t[n]=e[n];for(let n=253;n>=0;n--)Zu(t,t),n!==2&&n!==4&&as(t,t,e);for(let n=0;n<16;n++)r[n]=t[n]}o(BP,"inv25519");function ib(r,e){let t=new Uint8Array(32),n=new Float64Array(80),i=Eo(),s=Eo(),f=Eo(),u=Eo(),d=Eo(),y=Eo();for(let R=0;R<31;R++)t[R]=r[R];t[31]=r[31]&127|64,t[0]&=248,PP(n,e);for(let R=0;R<16;R++)s[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let I=t[R>>>3]>>>(R&7)&1;Yu(i,s,I),Yu(f,u,I),Ld(d,i,f),Ud(i,i,f),Ld(f,s,u),Ud(s,s,u),Zu(u,d),Zu(y,i),as(i,f,i),as(f,s,d),Ld(d,i,f),Ud(i,i,f),Zu(s,i),Ud(f,u,y),as(i,f,OP),Ld(i,i,u),as(f,f,i),as(i,u,y),as(u,s,n),Zu(s,d),Yu(i,s,I),Yu(f,u,I)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=f[R],n[R+48]=s[R],n[R+64]=u[R];let w=n.subarray(32),A=n.subarray(16);BP(w,w),as(A,A,w);let O=new Uint8Array(32);return NP(O,A),O}o(ib,"scalarMult");pr.scalarMult=ib;function sw(r){return ib(r,ow)}o(sw,"scalarMultBase");pr.scalarMultBase=sw;function aw(r){if(r.length!==pr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${pr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(r);return{publicKey:sw(e),secretKey:e}}o(aw,"generateKeyPairFromSeed");pr.generateKeyPairFromSeed=aw;function LP(r){let e=(0,DP.randomBytes)(32,r),t=aw(e);return(0,RP.wipe)(e),t}o(LP,"generateKeyPair");pr.generateKeyPair=LP;function UP(r,e,t=!1){if(r.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==pr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=ib(r,e);if(t){let i=0;for(let s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(UP,"sharedKey");pr.sharedKey=UP});var sb=Re(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var Qr=$a(),ob=xi(),FP=20;function $P(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],y=t[11]<<24|t[10]<<16|t[9]<<8|t[8],w=t[15]<<24|t[14]<<16|t[13]<<8|t[12],A=t[19]<<24|t[18]<<16|t[17]<<8|t[16],O=t[23]<<24|t[22]<<16|t[21]<<8|t[20],R=t[27]<<24|t[26]<<16|t[25]<<8|t[24],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Z=i,ne=s,V=f,j=u,H=d,he=y,L=w,h=A,v=O,g=R,l=I,b=B,E=Y,M=P,S=J,x=0;x<FP;x+=2)ee=ee+j|0,b^=ee,b=b>>>32-16|b<<16,h=h+b|0,j^=h,j=j>>>32-12|j<<12,Z=Z+H|0,E^=Z,E=E>>>32-16|E<<16,v=v+E|0,H^=v,H=H>>>32-12|H<<12,ne=ne+he|0,M^=ne,M=M>>>32-16|M<<16,g=g+M|0,he^=g,he=he>>>32-12|he<<12,V=V+L|0,S^=V,S=S>>>32-16|S<<16,l=l+S|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,M^=ne,M=M>>>32-8|M<<8,g=g+M|0,he^=g,he=he>>>32-7|he<<7,V=V+L|0,S^=V,S=S>>>32-8|S<<8,l=l+S|0,L^=l,L=L>>>32-7|L<<7,Z=Z+H|0,E^=Z,E=E>>>32-8|E<<8,v=v+E|0,H^=v,H=H>>>32-7|H<<7,ee=ee+j|0,b^=ee,b=b>>>32-8|b<<8,h=h+b|0,j^=h,j=j>>>32-7|j<<7,ee=ee+H|0,S^=ee,S=S>>>32-16|S<<16,g=g+S|0,H^=g,H=H>>>32-12|H<<12,Z=Z+he|0,b^=Z,b=b>>>32-16|b<<16,l=l+b|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,E^=ne,E=E>>>32-16|E<<16,h=h+E|0,L^=h,L=L>>>32-12|L<<12,V=V+j|0,M^=V,M=M>>>32-16|M<<16,v=v+M|0,j^=v,j=j>>>32-12|j<<12,ne=ne+L|0,E^=ne,E=E>>>32-8|E<<8,h=h+E|0,L^=h,L=L>>>32-7|L<<7,V=V+j|0,M^=V,M=M>>>32-8|M<<8,v=v+M|0,j^=v,j=j>>>32-7|j<<7,Z=Z+he|0,b^=Z,b=b>>>32-8|b<<8,l=l+b|0,he^=l,he=he>>>32-7|he<<7,ee=ee+H|0,S^=ee,S=S>>>32-8|S<<8,g=g+S|0,H^=g,H=H>>>32-7|H<<7;Qr.writeUint32LE(ee+n|0,r,0),Qr.writeUint32LE(Z+i|0,r,4),Qr.writeUint32LE(ne+s|0,r,8),Qr.writeUint32LE(V+f|0,r,12),Qr.writeUint32LE(j+u|0,r,16),Qr.writeUint32LE(H+d|0,r,20),Qr.writeUint32LE(he+y|0,r,24),Qr.writeUint32LE(L+w|0,r,28),Qr.writeUint32LE(h+A|0,r,32),Qr.writeUint32LE(v+O|0,r,36),Qr.writeUint32LE(g+R|0,r,40),Qr.writeUint32LE(l+I|0,r,44),Qr.writeUint32LE(b+B|0,r,48),Qr.writeUint32LE(E+Y|0,r,52),Qr.writeUint32LE(M+P|0,r,56),Qr.writeUint32LE(S+J|0,r,60)}o($P,"core");function cw(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,f;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),f=s.length-e.length,s.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,f=i}for(var u=new Uint8Array(64),d=0;d<t.length;d+=64){$P(u,s,r);for(var y=d;y<d+64&&y<t.length;y++)n[y]=t[y]^u[y-d];jP(s,0,f)}return ob.wipe(u),i===0&&ob.wipe(s),n}o(cw,"streamXOR");Fd.streamXOR=cw;function qP(r,e,t,n){return n===void 0&&(n=0),ob.wipe(t),cw(r,e,t,t,n)}o(qP,"stream");Fd.stream=qP;function jP(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(jP,"incrementCounter")});var dw=Re(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});var Js=$a(),uw=xi(),HP=sb(),zP=20;function lw(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=hw(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var f=HP.streamXOR(i,s,t,n);return uw.wipe(i),f}o(lw,"streamXOR");Xu.streamXOR=lw;function KP(r,e,t){return uw.wipe(t),lw(r,e,t,t)}o(KP,"stream");Xu.stream=KP;function hw(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,f=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],d=r[7]<<24|r[6]<<16|r[5]<<8|r[4],y=r[11]<<24|r[10]<<16|r[9]<<8|r[8],w=r[15]<<24|r[14]<<16|r[13]<<8|r[12],A=r[19]<<24|r[18]<<16|r[17]<<8|r[16],O=r[23]<<24|r[22]<<16|r[21]<<8|r[20],R=r[27]<<24|r[26]<<16|r[25]<<8|r[24],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],B=e[3]<<24|e[2]<<16|e[1]<<8|e[0],Y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],P=e[11]<<24|e[10]<<16|e[9]<<8|e[8],J=e[15]<<24|e[14]<<16|e[13]<<8|e[12],ee=n,Z=i,ne=s,V=f,j=u,H=d,he=y,L=w,h=A,v=O,g=R,l=I,b=B,E=Y,M=P,S=J,x=0;x<zP;x+=2)ee=ee+j|0,b^=ee,b=b>>>32-16|b<<16,h=h+b|0,j^=h,j=j>>>32-12|j<<12,Z=Z+H|0,E^=Z,E=E>>>32-16|E<<16,v=v+E|0,H^=v,H=H>>>32-12|H<<12,ne=ne+he|0,M^=ne,M=M>>>32-16|M<<16,g=g+M|0,he^=g,he=he>>>32-12|he<<12,V=V+L|0,S^=V,S=S>>>32-16|S<<16,l=l+S|0,L^=l,L=L>>>32-12|L<<12,ne=ne+he|0,M^=ne,M=M>>>32-8|M<<8,g=g+M|0,he^=g,he=he>>>32-7|he<<7,V=V+L|0,S^=V,S=S>>>32-8|S<<8,l=l+S|0,L^=l,L=L>>>32-7|L<<7,Z=Z+H|0,E^=Z,E=E>>>32-8|E<<8,v=v+E|0,H^=v,H=H>>>32-7|H<<7,ee=ee+j|0,b^=ee,b=b>>>32-8|b<<8,h=h+b|0,j^=h,j=j>>>32-7|j<<7,ee=ee+H|0,S^=ee,S=S>>>32-16|S<<16,g=g+S|0,H^=g,H=H>>>32-12|H<<12,Z=Z+he|0,b^=Z,b=b>>>32-16|b<<16,l=l+b|0,he^=l,he=he>>>32-12|he<<12,ne=ne+L|0,E^=ne,E=E>>>32-16|E<<16,h=h+E|0,L^=h,L=L>>>32-12|L<<12,V=V+j|0,M^=V,M=M>>>32-16|M<<16,v=v+M|0,j^=v,j=j>>>32-12|j<<12,ne=ne+L|0,E^=ne,E=E>>>32-8|E<<8,h=h+E|0,L^=h,L=L>>>32-7|L<<7,V=V+j|0,M^=V,M=M>>>32-8|M<<8,v=v+M|0,j^=v,j=j>>>32-7|j<<7,Z=Z+he|0,b^=Z,b=b>>>32-8|b<<8,l=l+b|0,he^=l,he=he>>>32-7|he<<7,ee=ee+H|0,S^=ee,S=S>>>32-8|S<<8,g=g+S|0,H^=g,H=H>>>32-7|H<<7;return Js.writeUint32LE(ee,t,0),Js.writeUint32LE(Z,t,4),Js.writeUint32LE(ne,t,8),Js.writeUint32LE(V,t,12),Js.writeUint32LE(b,t,16),Js.writeUint32LE(E,t,20),Js.writeUint32LE(M,t,24),Js.writeUint32LE(S,t,28),t}o(hw,"hchacha");Xu.hchacha=hw});var ab=Re(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});function VP(r,e,t){return~(r-1)&e|r-1&t}o(VP,"select");yc.select=VP;function GP(r,e){return(r|0)-(e|0)-1>>>31&1}o(GP,"lessOrEqual");yc.lessOrEqual=GP;function pw(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(pw,"compare");yc.compare=pw;function WP(r,e){return r.length===0||e.length===0?!1:pw(r,e)!==0}o(WP,"equal");yc.equal=WP});var bw=Re(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var JP=ab(),$d=xi();fs.DIGEST_LENGTH=16;var mw=function(){function r(e){this.digestLength=fs.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 f=e[8]|e[9]<<8;this._r[4]=(s>>>4|f<<12)&255,this._r[5]=f>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(f>>>14|u<<2)&8191;var d=e[12]|e[13]<<8;this._r[7]=(u>>>11|d<<5)&8065;var y=e[14]|e[15]<<8;this._r[8]=(d>>>8|y<<8)&8191,this._r[9]=y>>>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],f=this._h[1],u=this._h[2],d=this._h[3],y=this._h[4],w=this._h[5],A=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],B=this._r[0],Y=this._r[1],P=this._r[2],J=this._r[3],ee=this._r[4],Z=this._r[5],ne=this._r[6],V=this._r[7],j=this._r[8],H=this._r[9];n>=16;){var he=e[t+0]|e[t+1]<<8;s+=he&8191;var L=e[t+2]|e[t+3]<<8;f+=(he>>>13|L<<3)&8191;var h=e[t+4]|e[t+5]<<8;u+=(L>>>10|h<<6)&8191;var v=e[t+6]|e[t+7]<<8;d+=(h>>>7|v<<9)&8191;var g=e[t+8]|e[t+9]<<8;y+=(v>>>4|g<<12)&8191,w+=g>>>1&8191;var l=e[t+10]|e[t+11]<<8;A+=(g>>>14|l<<2)&8191;var b=e[t+12]|e[t+13]<<8;O+=(l>>>11|b<<5)&8191;var E=e[t+14]|e[t+15]<<8;R+=(b>>>8|E<<8)&8191,I+=E>>>5|i;var M=0,S=M;S+=s*B,S+=f*(5*H),S+=u*(5*j),S+=d*(5*V),S+=y*(5*ne),M=S>>>13,S&=8191,S+=w*(5*Z),S+=A*(5*ee),S+=O*(5*J),S+=R*(5*P),S+=I*(5*Y),M+=S>>>13,S&=8191;var x=M;x+=s*Y,x+=f*B,x+=u*(5*H),x+=d*(5*j),x+=y*(5*V),M=x>>>13,x&=8191,x+=w*(5*ne),x+=A*(5*Z),x+=O*(5*ee),x+=R*(5*J),x+=I*(5*P),M+=x>>>13,x&=8191;var C=M;C+=s*P,C+=f*Y,C+=u*B,C+=d*(5*H),C+=y*(5*j),M=C>>>13,C&=8191,C+=w*(5*V),C+=A*(5*ne),C+=O*(5*Z),C+=R*(5*ee),C+=I*(5*J),M+=C>>>13,C&=8191;var N=M;N+=s*J,N+=f*P,N+=u*Y,N+=d*B,N+=y*(5*H),M=N>>>13,N&=8191,N+=w*(5*j),N+=A*(5*V),N+=O*(5*ne),N+=R*(5*Z),N+=I*(5*ee),M+=N>>>13,N&=8191;var _=M;_+=s*ee,_+=f*J,_+=u*P,_+=d*Y,_+=y*B,M=_>>>13,_&=8191,_+=w*(5*H),_+=A*(5*j),_+=O*(5*V),_+=R*(5*ne),_+=I*(5*Z),M+=_>>>13,_&=8191;var k=M;k+=s*Z,k+=f*ee,k+=u*J,k+=d*P,k+=y*Y,M=k>>>13,k&=8191,k+=w*B,k+=A*(5*H),k+=O*(5*j),k+=R*(5*V),k+=I*(5*ne),M+=k>>>13,k&=8191;var fe=M;fe+=s*ne,fe+=f*Z,fe+=u*ee,fe+=d*J,fe+=y*P,M=fe>>>13,fe&=8191,fe+=w*Y,fe+=A*B,fe+=O*(5*H),fe+=R*(5*j),fe+=I*(5*V),M+=fe>>>13,fe&=8191;var D=M;D+=s*V,D+=f*ne,D+=u*Z,D+=d*ee,D+=y*J,M=D>>>13,D&=8191,D+=w*P,D+=A*Y,D+=O*B,D+=R*(5*H),D+=I*(5*j),M+=D>>>13,D&=8191;var Q=M;Q+=s*j,Q+=f*V,Q+=u*ne,Q+=d*Z,Q+=y*ee,M=Q>>>13,Q&=8191,Q+=w*J,Q+=A*P,Q+=O*Y,Q+=R*B,Q+=I*(5*H),M+=Q>>>13,Q&=8191;var se=M;se+=s*H,se+=f*j,se+=u*V,se+=d*ne,se+=y*Z,M=se>>>13,se&=8191,se+=w*ee,se+=A*J,se+=O*P,se+=R*Y,se+=I*B,M+=se>>>13,se&=8191,M=(M<<2)+M|0,M=M+S|0,S=M&8191,M=M>>>13,x+=M,s=S,f=x,u=C,d=N,y=_,w=k,A=fe,O=D,R=Q,I=se,t+=16,n-=16}this._h[0]=s,this._h[1]=f,this._h[2]=u,this._h[3]=d,this._h[4]=y,this._h[5]=w,this._h[6]=A,this._h[7]=O,this._h[8]=R,this._h[9]=I},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,f,u;if(this._leftover){for(u=this._leftover,this._buffer[u++]=1;u<16;u++)this._buffer[u]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,u=2;u<10;u++)this._h[u]+=i,i=this._h[u]>>>13,this._h[u]&=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,u=1;u<10;u++)n[u]=this._h[u]+i,i=n[u]>>>13,n[u]&=8191;for(n[9]-=1<<13,s=(i^1)-1,u=0;u<10;u++)n[u]&=s;for(s=~s,u=0;u<10;u++)this._h[u]=this._h[u]&s|n[u];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,f=this._h[0]+this._pad[0],this._h[0]=f&65535,u=1;u<8;u++)f=(this._h[u]+this._pad[u]|0)+(f>>>16)|0,this._h[u]=f&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 $d.wipe(this._buffer),$d.wipe(this._r),$d.wipe(this._h),$d.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();fs.Poly1305=mw;function YP(r,e){var t=new mw(r);t.update(e);var n=t.digest();return t.clean(),n}o(YP,"oneTimeAuth");fs.oneTimeAuth=YP;function ZP(r,e){return r.length!==fs.DIGEST_LENGTH||e.length!==fs.DIGEST_LENGTH?!1:JP.equal(r,e)}o(ZP,"equal");fs.equal=ZP});var yw=Re(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var qd=sb(),XP=bw(),Qu=xi(),gw=$a(),QP=ab();cs.KEY_LENGTH=32;cs.NONCE_LENGTH=12;cs.TAG_LENGTH=16;var vw=new Uint8Array(16),eB=function(){function r(e){if(this.nonceLength=cs.NONCE_LENGTH,this.tagLength=cs.TAG_LENGTH,e.length!==cs.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 f=new Uint8Array(32);qd.stream(this._key,s,f,4);var u=t.length+this.tagLength,d;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");d=i}else d=new Uint8Array(u);return qd.streamXOR(this._key,s,t,d,4),this._authenticate(d.subarray(d.length-this.tagLength,d.length),f,d.subarray(0,d.length-this.tagLength),n),Qu.wipe(s),d},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 f=new Uint8Array(32);qd.stream(this._key,s,f,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,f,t.subarray(0,t.length-this.tagLength),n),!QP.equal(u,t.subarray(t.length-this.tagLength,t.length)))return null;var d=t.length-this.tagLength,y;if(i){if(i.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");y=i}else y=new Uint8Array(d);return qd.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),y,4),Qu.wipe(s),y},r.prototype.clean=function(){return Qu.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new XP.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(vw.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(vw.subarray(n.length%16));var f=new Uint8Array(8);i&&gw.writeUint64LE(i.length,f),s.update(f),gw.writeUint64LE(n.length,f),s.update(f);for(var u=s.digest(),d=0;d<u.length;d++)e[d]=u[d];s.clean(),Qu.wipe(u),Qu.wipe(f)},r}();cs.ChaCha20Poly1305=eB});var _w=Re(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var xw=dw(),ww=yw(),el=xi();us.KEY_LENGTH=32;us.NONCE_LENGTH=24;us.TAG_LENGTH=16;var tB=function(){function r(e){if(this.nonceLength=us.NONCE_LENGTH,this.tagLength=us.TAG_LENGTH,e.length!==us.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=xw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new ww.ChaCha20Poly1305(s),d=u.seal(f,t,n,i);return el.wipe(s),el.wipe(f),u.clean(),d},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=xw.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),f=new Uint8Array(12);f.set(e.subarray(16),4);var u=new ww.ChaCha20Poly1305(s),d=u.open(f,t,n,i);return el.wipe(s),el.wipe(f),u.clean(),d},r.prototype.clean=function(){return el.wipe(this._key),this},r}();us.XChaCha20Poly1305=tB});var d5=Re(o0=>{"use strict";o0.byteLength=_L;o0.toByteArray=AL;o0.fromByteArray=TL;var So=[],Ti=[],wL=typeof Uint8Array<"u"?Uint8Array:Array,Ob="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(nf=0,l5=Ob.length;nf<l5;++nf)So[nf]=Ob[nf],Ti[Ob.charCodeAt(nf)]=nf;var nf,l5;Ti["-".charCodeAt(0)]=62;Ti["_".charCodeAt(0)]=63;function h5(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}o(h5,"getLens");function _L(r){var e=h5(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(_L,"byteLength");function EL(r,e,t){return(e+t)*3/4-t}o(EL,"_byteLength");function AL(r){var e,t=h5(r),n=t[0],i=t[1],s=new wL(EL(r,n,i)),f=0,u=i>0?n-4:n,d;for(d=0;d<u;d+=4)e=Ti[r.charCodeAt(d)]<<18|Ti[r.charCodeAt(d+1)]<<12|Ti[r.charCodeAt(d+2)]<<6|Ti[r.charCodeAt(d+3)],s[f++]=e>>16&255,s[f++]=e>>8&255,s[f++]=e&255;return i===2&&(e=Ti[r.charCodeAt(d)]<<2|Ti[r.charCodeAt(d+1)]>>4,s[f++]=e&255),i===1&&(e=Ti[r.charCodeAt(d)]<<10|Ti[r.charCodeAt(d+1)]<<4|Ti[r.charCodeAt(d+2)]>>2,s[f++]=e>>8&255,s[f++]=e&255),s}o(AL,"toByteArray");function SL(r){return So[r>>18&63]+So[r>>12&63]+So[r>>6&63]+So[r&63]}o(SL,"tripletToBase64");function ML(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push(SL(n));return i.join("")}o(ML,"encodeChunk");function TL(r){for(var e,t=r.length,n=t%3,i=[],s=16383,f=0,u=t-n;f<u;f+=s)i.push(ML(r,f,f+s>u?u:f+s));return n===1?(e=r[t-1],i.push(So[e>>2]+So[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(So[e>>10]+So[e>>4&63]+So[e<<2&63]+"=")),i.join("")}o(TL,"fromByteArray")});var p5=Re(Nb=>{Nb.read=function(r,e,t,n,i){var s,f,u=i*8-n-1,d=(1<<u)-1,y=d>>1,w=-7,A=t?i-1:0,O=t?-1:1,R=r[e+A];for(A+=O,s=R&(1<<-w)-1,R>>=-w,w+=u;w>0;s=s*256+r[e+A],A+=O,w-=8);for(f=s&(1<<-w)-1,s>>=-w,w+=n;w>0;f=f*256+r[e+A],A+=O,w-=8);if(s===0)s=1-y;else{if(s===d)return f?NaN:(R?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-y}return(R?-1:1)*f*Math.pow(2,s-n)};Nb.write=function(r,e,t,n,i,s){var f,u,d,y=s*8-i-1,w=(1<<y)-1,A=w>>1,O=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:s-1,I=n?1:-1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,f=w):(f=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-f))<1&&(f--,d*=2),f+A>=1?e+=O/d:e+=O*Math.pow(2,1-A),e*d>=2&&(f++,d/=2),f+A>=w?(u=0,f=w):f+A>=1?(u=(e*d-1)*Math.pow(2,i),f=f+A):(u=e*Math.pow(2,A-1)*Math.pow(2,i),f=0));i>=8;r[t+R]=u&255,R+=I,u/=256,i-=8);for(f=f<<i|u,y+=i;y>0;r[t+R]=f&255,R+=I,f/=256,y-=8);r[t+R-I]|=B*128}});var f0=Re(kc=>{"use strict";var Pb=d5(),Cc=p5(),m5=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;kc.Buffer=Se;kc.SlowBuffer=OL;kc.INSPECT_MAX_BYTES=50;var s0=2147483647;kc.kMaxLength=s0;Se.TYPED_ARRAY_SUPPORT=CL();!Se.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function CL(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}o(CL,"typedArraySupport");Object.defineProperty(Se.prototype,"parent",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.buffer}});Object.defineProperty(Se.prototype,"offset",{enumerable:!0,get:function(){if(!!Se.isBuffer(this))return this.byteOffset}});function hs(r){if(r>s0)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Se.prototype),e}o(hs,"createBuffer");function Se(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Fb(r)}return v5(r,e,t)}o(Se,"Buffer");Se.poolSize=8192;function v5(r,e,t){if(typeof r=="string")return IL(r,e);if(ArrayBuffer.isView(r))return DL(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Mo(r,ArrayBuffer)||r&&Mo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mo(r,SharedArrayBuffer)||r&&Mo(r.buffer,SharedArrayBuffer)))return Lb(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return Se.from(n,e,t);var i=RL(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Se.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o(v5,"from");Se.from=function(r,e,t){return v5(r,e,t)};Object.setPrototypeOf(Se.prototype,Uint8Array.prototype);Object.setPrototypeOf(Se,Uint8Array);function y5(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}o(y5,"assertSize");function kL(r,e,t){return y5(r),r<=0?hs(r):e!==void 0?typeof t=="string"?hs(r).fill(e,t):hs(r).fill(e):hs(r)}o(kL,"alloc");Se.alloc=function(r,e,t){return kL(r,e,t)};function Fb(r){return y5(r),hs(r<0?0:$b(r)|0)}o(Fb,"allocUnsafe");Se.allocUnsafe=function(r){return Fb(r)};Se.allocUnsafeSlow=function(r){return Fb(r)};function IL(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Se.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=x5(r,e)|0,n=hs(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(IL,"fromString");function Bb(r){for(var e=r.length<0?0:$b(r.length)|0,t=hs(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}o(Bb,"fromArrayLike");function DL(r){if(Mo(r,Uint8Array)){var e=new Uint8Array(r);return Lb(e.buffer,e.byteOffset,e.byteLength)}return Bb(r)}o(DL,"fromArrayView");function Lb(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,Se.prototype),n}o(Lb,"fromArrayBuffer");function RL(r){if(Se.isBuffer(r)){var e=$b(r.length)|0,t=hs(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||qb(r.length)?hs(0):Bb(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Bb(r.data)}o(RL,"fromObject");function $b(r){if(r>=s0)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s0.toString(16)+" bytes");return r|0}o($b,"checked");function OL(r){return+r!=r&&(r=0),Se.alloc(+r)}o(OL,"SlowBuffer");Se.isBuffer=o(function(e){return e!=null&&e._isBuffer===!0&&e!==Se.prototype},"isBuffer");Se.compare=o(function(e,t){if(Mo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),Mo(t,Uint8Array)&&(t=Se.from(t,t.offset,t.byteLength)),!Se.isBuffer(e)||!Se.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,s=0,f=Math.min(n,i);s<f;++s)if(e[s]!==t[s]){n=e[s],i=t[s];break}return n<i?-1:i<n?1:0},"compare");Se.isEncoding=o(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");Se.concat=o(function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Se.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=Se.allocUnsafe(t),s=0;for(n=0;n<e.length;++n){var f=e[n];if(Mo(f,Uint8Array))s+f.length>i.length?Se.from(f).copy(i,s):Uint8Array.prototype.set.call(i,f,s);else if(Se.isBuffer(f))f.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=f.length}return i},"concat");function x5(r,e){if(Se.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Mo(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Ub(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return M5(r).length;default:if(i)return n?-1:Ub(r).length;e=(""+e).toLowerCase(),i=!0}}o(x5,"byteLength");Se.byteLength=x5;function NL(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return zL(this,e,t);case"utf8":case"utf-8":return _5(this,e,t);case"ascii":return jL(this,e,t);case"latin1":case"binary":return HL(this,e,t);case"base64":return $L(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KL(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o(NL,"slowToString");Se.prototype._isBuffer=!0;function of(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}o(of,"swap");Se.prototype.swap16=o(function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)of(this,t,t+1);return this},"swap16");Se.prototype.swap32=o(function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)of(this,t,t+3),of(this,t+1,t+2);return this},"swap32");Se.prototype.swap64=o(function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)of(this,t,t+7),of(this,t+1,t+6),of(this,t+2,t+5),of(this,t+3,t+4);return this},"swap64");Se.prototype.toString=o(function(){var e=this.length;return e===0?"":arguments.length===0?_5(this,0,e):NL.apply(this,arguments)},"toString");Se.prototype.toLocaleString=Se.prototype.toString;Se.prototype.equals=o(function(e){if(!Se.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Se.compare(this,e)===0},"equals");Se.prototype.inspect=o(function(){var e="",t=kc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},"inspect");m5&&(Se.prototype[m5]=Se.prototype.inspect);Se.prototype.compare=o(function(e,t,n,i,s){if(Mo(e,Uint8Array)&&(e=Se.from(e,e.offset,e.byteLength)),!Se.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var f=s-i,u=n-t,d=Math.min(f,u),y=this.slice(i,s),w=e.slice(t,n),A=0;A<d;++A)if(y[A]!==w[A]){f=y[A],u=w[A];break}return f<u?-1:u<f?1:0},"compare");function w5(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,qb(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=Se.from(e,n)),Se.isBuffer(e))return e.length===0?-1:b5(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):b5(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(w5,"bidirectionalIndexOf");function b5(r,e,t,n,i){var s=1,f=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,f/=2,u/=2,t/=2}function d(R,I){return s===1?R[I]:R.readUInt16BE(I*s)}o(d,"read");var y;if(i){var w=-1;for(y=t;y<f;y++)if(d(r,y)===d(e,w===-1?0:y-w)){if(w===-1&&(w=y),y-w+1===u)return w*s}else w!==-1&&(y-=y-w),w=-1}else for(t+u>f&&(t=f-u),y=t;y>=0;y--){for(var A=!0,O=0;O<u;O++)if(d(r,y+O)!==d(e,O)){A=!1;break}if(A)return y}return-1}o(b5,"arrayIndexOf");Se.prototype.includes=o(function(e,t,n){return this.indexOf(e,t,n)!==-1},"includes");Se.prototype.indexOf=o(function(e,t,n){return w5(this,e,t,n,!0)},"indexOf");Se.prototype.lastIndexOf=o(function(e,t,n){return w5(this,e,t,n,!1)},"lastIndexOf");function PL(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var s=e.length;n>s/2&&(n=s/2);for(var f=0;f<n;++f){var u=parseInt(e.substr(f*2,2),16);if(qb(u))return f;r[t+f]=u}return f}o(PL,"hexWrite");function BL(r,e,t,n){return a0(Ub(e,r.length-t),r,t,n)}o(BL,"utf8Write");function LL(r,e,t,n){return a0(WL(e),r,t,n)}o(LL,"asciiWrite");function UL(r,e,t,n){return a0(M5(e),r,t,n)}o(UL,"base64Write");function FL(r,e,t,n){return a0(JL(e,r.length-t),r,t,n)}o(FL,"ucs2Write");Se.prototype.write=o(function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return PL(this,e,t,n);case"utf8":case"utf-8":return BL(this,e,t,n);case"ascii":case"latin1":case"binary":return LL(this,e,t,n);case"base64":return UL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return FL(this,e,t,n);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},"write");Se.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function $L(r,e,t){return e===0&&t===r.length?Pb.fromByteArray(r):Pb.fromByteArray(r.slice(e,t))}o($L,"base64Slice");function _5(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var s=r[i],f=null,u=s>239?4:s>223?3:s>191?2:1;if(i+u<=t){var d,y,w,A;switch(u){case 1:s<128&&(f=s);break;case 2:d=r[i+1],(d&192)===128&&(A=(s&31)<<6|d&63,A>127&&(f=A));break;case 3:d=r[i+1],y=r[i+2],(d&192)===128&&(y&192)===128&&(A=(s&15)<<12|(d&63)<<6|y&63,A>2047&&(A<55296||A>57343)&&(f=A));break;case 4:d=r[i+1],y=r[i+2],w=r[i+3],(d&192)===128&&(y&192)===128&&(w&192)===128&&(A=(s&15)<<18|(d&63)<<12|(y&63)<<6|w&63,A>65535&&A<1114112&&(f=A))}}f===null?(f=65533,u=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),i+=u}return qL(n)}o(_5,"utf8Slice");var g5=4096;function qL(r){var e=r.length;if(e<=g5)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=g5));return t}o(qL,"decodeCodePointsArray");function jL(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}o(jL,"asciiSlice");function HL(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}o(HL,"latin1Slice");function zL(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",s=e;s<t;++s)i+=YL[r[s]];return i}o(zL,"hexSlice");function KL(r,e,t){for(var n=r.slice(e,t),i="",s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}o(KL,"utf16leSlice");Se.prototype.slice=o(function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,Se.prototype),i},"slice");function Nr(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o(Nr,"checkOffset");Se.prototype.readUintLE=Se.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return i},"readUIntLE");Se.prototype.readUintBE=Se.prototype.readUIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=this[e+--t],s=1;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");Se.prototype.readUint8=Se.prototype.readUInt8=o(function(e,t){return e=e>>>0,t||Nr(e,1,this.length),this[e]},"readUInt8");Se.prototype.readUint16LE=Se.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||Nr(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");Se.prototype.readUint16BE=Se.prototype.readUInt16BE=o(function(e,t){return e=e>>>0,t||Nr(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");Se.prototype.readUint32LE=Se.prototype.readUInt32LE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");Se.prototype.readUint32BE=Se.prototype.readUInt32BE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");Se.prototype.readIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=this[e],s=1,f=0;++f<t&&(s*=256);)i+=this[e+f]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");Se.prototype.readIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||Nr(e,t,this.length);for(var i=t,s=1,f=this[e+--i];i>0&&(s*=256);)f+=this[e+--i]*s;return s*=128,f>=s&&(f-=Math.pow(2,8*t)),f},"readIntBE");Se.prototype.readInt8=o(function(e,t){return e=e>>>0,t||Nr(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");Se.prototype.readInt16LE=o(function(e,t){e=e>>>0,t||Nr(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");Se.prototype.readInt16BE=o(function(e,t){e=e>>>0,t||Nr(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");Se.prototype.readInt32LE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");Se.prototype.readInt32BE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");Se.prototype.readFloatLE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),Cc.read(this,e,!0,23,4)},"readFloatLE");Se.prototype.readFloatBE=o(function(e,t){return e=e>>>0,t||Nr(e,4,this.length),Cc.read(this,e,!1,23,4)},"readFloatBE");Se.prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Cc.read(this,e,!0,52,8)},"readDoubleLE");Se.prototype.readDoubleBE=o(function(e,t){return e=e>>>0,t||Nr(e,8,this.length),Cc.read(this,e,!1,52,8)},"readDoubleBE");function Cn(r,e,t,n,i,s){if(!Se.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}o(Cn,"checkInt");Se.prototype.writeUintLE=Se.prototype.writeUIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Cn(this,e,t,n,s,0)}var f=1,u=0;for(this[t]=e&255;++u<n&&(f*=256);)this[t+u]=e/f&255;return t+n},"writeUIntLE");Se.prototype.writeUintBE=Se.prototype.writeUIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var s=Math.pow(2,8*n)-1;Cn(this,e,t,n,s,0)}var f=n-1,u=1;for(this[t+f]=e&255;--f>=0&&(u*=256);)this[t+f]=e/u&255;return t+n},"writeUIntBE");Se.prototype.writeUint8=Se.prototype.writeUInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");Se.prototype.writeUint16LE=Se.prototype.writeUInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");Se.prototype.writeUint16BE=Se.prototype.writeUInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");Se.prototype.writeUint32LE=Se.prototype.writeUInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},"writeUInt32LE");Se.prototype.writeUint32BE=Se.prototype.writeUInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");Se.prototype.writeIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Cn(this,e,t,n,s-1,-s)}var f=0,u=1,d=0;for(this[t]=e&255;++f<n&&(u*=256);)e<0&&d===0&&this[t+f-1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntLE");Se.prototype.writeIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){var s=Math.pow(2,8*n-1);Cn(this,e,t,n,s-1,-s)}var f=n-1,u=1,d=0;for(this[t+f]=e&255;--f>=0&&(u*=256);)e<0&&d===0&&this[t+f+1]!==0&&(d=1),this[t+f]=(e/u>>0)-d&255;return t+n},"writeIntBE");Se.prototype.writeInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");Se.prototype.writeInt16LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");Se.prototype.writeInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");Se.prototype.writeInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");Se.prototype.writeInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||Cn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");function E5(r,e,t,n,i,s){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}o(E5,"checkIEEE754");function A5(r,e,t,n,i){return e=+e,t=t>>>0,i||E5(r,e,t,4,34028234663852886e22,-34028234663852886e22),Cc.write(r,e,t,n,23,4),t+4}o(A5,"writeFloat");Se.prototype.writeFloatLE=o(function(e,t,n){return A5(this,e,t,!0,n)},"writeFloatLE");Se.prototype.writeFloatBE=o(function(e,t,n){return A5(this,e,t,!1,n)},"writeFloatBE");function S5(r,e,t,n,i){return e=+e,t=t>>>0,i||E5(r,e,t,8,17976931348623157e292,-17976931348623157e292),Cc.write(r,e,t,n,52,8),t+8}o(S5,"writeDouble");Se.prototype.writeDoubleLE=o(function(e,t,n){return S5(this,e,t,!0,n)},"writeDoubleLE");Se.prototype.writeDoubleBE=o(function(e,t,n){return S5(this,e,t,!1,n)},"writeDoubleBE");Se.prototype.copy=o(function(e,t,n,i){if(!Se.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var s=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),s},"copy");Se.prototype.fill=o(function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Se.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var f;if(typeof e=="number")for(f=t;f<n;++f)this[f]=e;else{var u=Se.isBuffer(e)?e:Se.from(e,i),d=u.length;if(d===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(f=0;f<n-t;++f)this[f+t]=u[f%d]}return this},"fill");var VL=/[^+/0-9A-Za-z-_]/g;function GL(r){if(r=r.split("=")[0],r=r.trim().replace(VL,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}o(GL,"base64clean");function Ub(r,e){e=e||1/0;for(var t,n=r.length,i=null,s=[],f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(Ub,"utf8ToBytes");function WL(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}o(WL,"asciiToBytes");function JL(r,e){for(var t,n,i,s=[],f=0;f<r.length&&!((e-=2)<0);++f)t=r.charCodeAt(f),n=t>>8,i=t%256,s.push(i),s.push(n);return s}o(JL,"utf16leToBytes");function M5(r){return Pb.toByteArray(GL(r))}o(M5,"base64ToBytes");function a0(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}o(a0,"blitBuffer");function Mo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}o(Mo,"isInstance");function qb(r){return r!==r}o(qb,"numberIsNaN");var YL=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)e[n+i]=r[t]+r[i];return e}()});var Zi=Re((bJ,T5)=>{T5.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 ul=Re((gJ,C5)=>{C5.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 I5=Re(Pr=>{var{Buffer:Mr}=f0(),c0=4294967292,u0=4294967293,jb=4294967294,k5=4294967295,Ue=[0,1,3,7,15,31,63,127,255,511,1023],Qs=["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"],ZL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Jn=[];ZL.forEach(r=>{Jn.push(r.charCodeAt(0))});Pr.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&Ue[5])),e.push(128+(t&Ue[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]));else if(t>=65536&&t<=1114111){let n=t>>16&Ue[5];e.push(240+(n>>2)),e.push(128+((n&Ue[2])<<4)+(t>>12&Ue[4])),e.push(128+(t>>6&Ue[6])),e.push(128+(t&Ue[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Mr.from(e)},decode(r,e){function t(I,B){if((B&192)!==128)return u0;let Y=((I&Ue[5])<<6)+(B&Ue[6]);return Y<128?c0:Y}o(t,"bytes2");function n(I,B,Y){if((Y&192)!==128||(B&192)!==128)return u0;let P=((I&Ue[4])<<12)+((B&Ue[6])<<6)+(Y&Ue[6]);return P<2048?c0:P>=55296&&P<=57343?jb:P}o(n,"bytes3");function i(I,B,Y,P){if((P&192)!==128||(Y&192)!==128||(B&192)!==128)return u0;let J=(((I&Ue[3])<<2)+(B>>4&Ue[2])<<16)+((B&Ue[4])<<12)+((Y&Ue[6])<<6)+(P&Ue[6]);return J<65536?c0:J>1114111?jb:J}o(i,"bytes4");let s,f,u,d,y,w,A=r.length,O=e?3:0,R=[];for(;O<A;){f=r[O],s=k5;let I=!0;for(;I;){if(f>=0&&f<=127){s=f,w=1;break}if(u=O+1,u<A&&f>=194&&f<=223){s=t(f,r[u]),w=2;break}if(d=O+2,d<A&&f>=224&&f<=239){s=n(f,r[u],r[d]),w=3;break}if(y=O+3,y<A&&f>=240&&f<=244){s=i(f,r[u],r[d],r[y]),w=4;break}break}if(s>1114111){let B=`byte[${O}]`;throw s===k5?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${B}`):s===u0?new RangeError(`utf8.decode: illegal trailing byte found at: ${B}`):s===jb?new RangeError(`utf8.decode: code point out of range found at: ${B}`):s===c0?new RangeError(`utf8.decode: non-shortest form found at: ${B}`):new RangeError(`utf8.decode: unrecognized error found at: ${B}`)}R.push(s),O+=w}return R}};Pr.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&Ue[8]),e.push(t&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n>>8&Ue[8]),e.push(n&Ue[8]),e.push(i>>8&Ue[8]),e.push(i&Ue[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Mr.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,f,u,d,y,w,A;for(;i<n;){for(;;){if(d=i+1,d<n){if(w=(r[i]<<8)+r[d],w<55296||w>57343){f=w,u=2;break}if(y=i+3,y<n&&(A=(r[i+2]<<8)+r[y],w<=56319&&A>=56320&&A<=57343)){f=65536+(w-55296<<10)+(A-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Pr.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&Ue[8]),e.push(t>>8&Ue[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&Ue[10]),e.push(n&Ue[8]),e.push(n>>8&Ue[8]),e.push(i&Ue[8]),e.push(i>>8&Ue[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Mr.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,f,u,d,y,w,A;for(;i<n;){for(;;){if(d=i+1,d<n){if(w=(r[d]<<8)+r[i],w<55296||w>57343){f=w,u=2;break}if(y=i+3,y<n&&(A=(r[y]<<8)+r[i+2],w<=56319&&A>=56320&&A<=57343)){f=65536+(w-55296<<10)+(A-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=f,i+=u}return t}};Pr.utf32be={encode(r){let e=Mr.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&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Pr.utf32le={encode(r){let e=Mr.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&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Pr.uint7={encode(r){let e=Mr.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}};Pr.uint8={encode(r){let e=Mr.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}};Pr.uint16be={encode(r){let e=Mr.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&Ue[8],e[t++]=n&Ue[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}};Pr.uint16le={encode(r){let e=Mr.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&Ue[8],e[t++]=n>>8&Ue[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}};Pr.uint32be={encode(r){let e=Mr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n&Ue[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}};Pr.uint32le={encode(r){let e=Mr.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&Ue[8],e[t++]=n>>8&Ue[8],e[t++]=n>>16&Ue[8],e[t++]=n>>24&Ue[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}};Pr.string={encode(r){return Pr.utf16le.encode(r).toString("utf16le")},decode(r){return Pr.utf16le.decode(Mr.from(r,"utf16le"),0)}};Pr.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${Qs[n]}`;else if(n>=127&&n<=255)i+=`\`x${Qs[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Qs[n>>8&Ue[8]]}${Qs[n&Ue[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let f=n>>24&Ue[8];f>0&&(i+=Qs[f]),i+=`${Qs[n>>16&Ue[8]]+Qs[n>>8&Ue[8]]+Qs[n&Ue[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Mr.from(i).forEach(f=>{e.push(f)})}}return Mr.from(e)},decode(r){function e(A){return A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102}o(e,"isHex");function t(A,O,R){let I={char:null,nexti:A+2,error:!0};if(A+1<O&&e(R[A])&&e(R[A+1])){let B=String.fromCodePoint(R[A],R[A+1]);I.char=parseInt(B,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(t,"getx");function n(A,O,R){let I={char:null,nexti:A+4,error:!0};if(A+3<O&&e(R[A])&&e(R[A+1])&&e(R[A+2])&&e(R[A+3])){let B=String.fromCodePoint(R[A],R[A+1],R[A+2],R[A+3]);I.char=parseInt(B,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(n,"getu");function i(A,O,R){let I={char:null,nexti:A+4,error:!0},B="";for(;A<O&&e(R[A]);)B+=String.fromCodePoint(R[A]),A+=1;return I.char=parseInt(B,16),R[A]===125&&!Number.isNaN(I.char)&&(I.error=!1),I.nexti=A+1,I}o(i,"getU");let s=[],f=r.length,u,d,y,w=0;for(;w<f;){for(;;){if(y=!0,r[w]!==96){s.push(r[w]),w+=1,y=!1;break}if(u=w+1,u>=f)break;if(r[u]===96){s.push(96),w+=2,y=!1;break}if(r[u]===120){if(d=t(u+1,f,r),d.error)break;s.push(d.char),w=d.nexti,y=!1;break}if(r[u]===117){if(r[u+1]===123){if(d=i(u+2,f,r),d.error)break;s.push(d.char),w=d.nexti,y=!1;break}if(d=n(u+1,f,r),d.error)break;s.push(d.char),w=d.nexti,y=!1;break}break}if(y)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${w}]`)}return s}};var ll=13,Ci=10;Pr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case ll:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(ll),e.push(Ci);break;case Ci:e.push(ll),e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&(e.push(ll),e.push(Ci)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case ll:t+1<r.length&&r[t+1]===Ci?t+=2:t+=1,e.push(Ci);break;case Ci:e.push(Ci),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==Ci&&e.push(Ci),e}};Pr.base64={encode(r){if(r.length===0)return Mr.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,f=Mr.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let u=0;u<s;u+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],f[t++]=Jn[n>>18&Ue[6]],f[t++]=Jn[n>>12&Ue[6]],f[t++]=Jn[n>>6&Ue[6]],f[t++]=Jn[n&Ue[6]];if(i===0)return f;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,f[t++]=Jn[n>>18&Ue[6]],f[t++]=Jn[n>>12&Ue[6]],f[t++]=Jn[n>>6&Ue[6]],f[t]=Jn[64],f;if(i===2)return n=r[e]<<16,f[t++]=Jn[n>>18&Ue[6]],f[t++]=Jn[n>>12&Ue[6]],f[t++]=Jn[64],f[t]=Jn[64],f},decode(r){function e(w){let A=[],O=0;for(let R=0;R<w.length;R+=1){let I=w[R],B=!0;for(;B&&!(I===32||I===9||I===10||I===13);){if(I>=65&&I<=90){A.push(I-65);break}if(I>=97&&I<=122){A.push(I-71);break}if(I>=48&&I<=57){A.push(I+4);break}if(I===43){A.push(62);break}if(I===47){A.push(63);break}if(I===61){A.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${I}`)}}if(A.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${A.length}`);switch(O){case 0:break;case 1:if(A[A.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(A[A.length-1]!==64||A[A.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: ${O}`)}return{tail:O,buf:Mr.from(A)}}if(o(e,"validate"),r.length===0)return Mr.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,f,u,d=i.length/4,y=Mr.alloc(d*3-n);n>0&&(d-=1),f=0,s=0;for(let w=0;w<d;w+=1)u=i[s++]<<18,u+=i[s++]<<12,u+=i[s++]<<6,u+=i[s++],y[f++]=u>>16&Ue[8],y[f++]=u>>8&Ue[8],y[f++]=u&Ue[8];return n===1&&(u=i[s++]<<18,u+=i[s++]<<12,u+=i[s]<<6,y[f++]=u>>16&Ue[8],y[f]=u>>8&Ue[8]),n===2&&(u=i[s++]<<18,u+=i[s++]<<12,y[f]=u>>16&Ue[8]),y},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,f,u,d){switch(t){case 76:e+=`\r
35
35
  ${s}${f}${u}${d}`,t=4;break;case 75:e+=`${s}\r
36
36
  ${f}${u}${d}`,t=3;break;case 74:e+=`${s+f}\r
37
37
  ${u}${d}`,t=2;break;case 73:e+=`${s+f+u}\r
38
- ${d}`,t=1;break;default:e+=s+f+u+d,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 f=s;f<s+4;f+=1)if(!i(r[f]))throw new RangeError(`base64.toString: buf[${f}]: ${r[f]} : 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 Gb=Re(Nc=>{var{Buffer:Hb}=f0(),Kt=I5(),hl="UTF8",Kb="UTF16",To="UTF16BE",ds="UTF16LE",Vb="UTF32",Co="UTF32BE",ps="UTF32LE",Ic="UINT7",D5="ASCII",R5="BINARY",Dc="UINT8",O5="UINT16",l0="UINT16LE",Rc="UINT16BE",N5="UINT32",h0="UINT32LE",Oc="UINT32BE",d0="ESCAPED",ea="STRING",XL=o(function(e){e.type=hl;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),QL=o(function(e){let t=e.data;switch(e.bom=0,e.type){case Kb:e.type=To,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=ds,e.bom=2));break;case To:if(e.type=To,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: "${To}" specified but BOM is for "${ds}"`)}break;case ds:if(e.type=ds,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${ds}" specified but BOM is for "${To}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),eU=o(function(e){let t=e.data;switch(e.bom=0,e.type){case Vb:e.type=Co,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=ps,e.bom=4));break;case Co:if(e.type=Co,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: ${Co} specified but BOM is for ${ps}"`);break;case ps:if(e.type=ps,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${ps}" specified but BOM is for "${Co}"`);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"),tU=o(function(e,t){function n(s){let f={type:"",base64:!1},d=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return d&&(d[2]&&(f.type=d[2].toUpperCase()),d[1]&&(f.base64=!0)),f}o(n,"getType");let i=n(e.toUpperCase());if(i.base64){if(i.type===ea)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${ea}`);if(Hb.isBuffer(t))i.data=Kt.base64.decode(t);else if(typeof t=="string"){let s=Hb.from(t,"ascii");i.data=Kt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case hl:XL(i);break;case Kb:case To:case ds:QL(i);break;case Vb:case Co:case ps:eU(i);break;case O5:i.type=Rc;break;case N5:i.type=Oc;break;case D5:i.type=Ic;break;case R5:i.type=Dc;break;case Ic:case Dc:case l0:case Rc:case h0:case Oc:case ea:case d0:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===ea){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Hb.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),rU=o(function(e,t){function n(s){let f,u,d={crlf:!1,lf:!1,base64:!1,type:""},y=!0;for(;y;){if(u=s,f=s.slice(0,5),f==="CRLF:"){d.crlf=!0,u=s.slice(5);break}if(f=s.slice(0,3),f==="LF:"){d.lf=!0,u=s.slice(3);break}break}return f=u.split(":"),f.length===1?d.type=f[0]:f.length===2&&f[1]==="BASE64"&&(d.base64=!0,d.type=f[0]),d}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 hl:case To:case ds:case Co:case ps:case Ic:case Dc:case l0:case Rc:case h0:case Oc:case d0:break;case ea:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${ea}`);break;case D5:i.type=Ic;break;case R5:i.type=Dc;break;case Kb:i.type=To;break;case Vb:i.type=Co;break;case O5:i.type=Rc;break;case N5:i.type=Oc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),zb=o(function(e,t){switch(e){case hl:return Kt.utf8.encode(t);case To:return Kt.utf16be.encode(t);case ds:return Kt.utf16le.encode(t);case Co:return Kt.utf32be.encode(t);case ps:return Kt.utf32le.encode(t);case Ic:return Kt.uint7.encode(t);case Dc:return Kt.uint8.encode(t);case Rc:return Kt.uint16be.encode(t);case l0:return Kt.uint16le.encode(t);case Oc:return Kt.uint32be.encode(t);case h0:return Kt.uint32le.encode(t);case ea:return Kt.string.encode(t);case d0:return Kt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),nU=o(function(e){switch(e.type){case hl:return Kt.utf8.decode(e.data,e.bom);case ds:return Kt.utf16le.decode(e.data,e.bom);case To:return Kt.utf16be.decode(e.data,e.bom);case Co:return Kt.utf32be.decode(e.data,e.bom);case ps:return Kt.utf32le.decode(e.data,e.bom);case Ic:return Kt.uint7.decode(e.data);case Dc:return Kt.uint8.decode(e.data);case Rc:return Kt.uint16be.decode(e.data);case l0:return Kt.uint16le.decode(e.data);case Oc:return Kt.uint32be.decode(e.data);case h0:return Kt.uint32le.decode(e.data);case ea:return Kt.string.decode(e.data);case d0:return Kt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Nc.decode=o(function(e,t){let n=tU(e,t);return nU(n)},"exportsDecode");Nc.encode=o(function(e,t){let n,i,s=rU(e,t);return s.crlf?(n=Kt.lineEnds.crlf(t),i=zb(s.type,n)):s.lf?(n=Kt.lineEnds.lf(t),i=zb(s.type,n)):i=zb(s.type,t),s.base64&&(i=Kt.base64.encode(i)),i},"exportsEncode");var iU=o(function(e,t,n){return Nc.encode(n,Nc.decode(e,t))},"convert");Nc.convert=iU});var Wb=Re((wJ,P5)=>{P5.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
38
+ ${d}`,t=1;break;default:e+=s+f+u+d,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 f=s;f<s+4;f+=1)if(!i(r[f]))throw new RangeError(`base64.toString: buf[${f}]: ${r[f]} : 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 Gb=Re(Nc=>{var{Buffer:Hb}=f0(),Kt=I5(),hl="UTF8",Kb="UTF16",To="UTF16BE",ds="UTF16LE",Vb="UTF32",Co="UTF32BE",ps="UTF32LE",Ic="UINT7",D5="ASCII",R5="BINARY",Dc="UINT8",O5="UINT16",l0="UINT16LE",Rc="UINT16BE",N5="UINT32",h0="UINT32LE",Oc="UINT32BE",d0="ESCAPED",ea="STRING",XL=o(function(e){e.type=hl;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),QL=o(function(e){let t=e.data;switch(e.bom=0,e.type){case Kb:e.type=To,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=ds,e.bom=2));break;case To:if(e.type=To,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: "${To}" specified but BOM is for "${ds}"`)}break;case ds:if(e.type=ds,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${ds}" specified but BOM is for "${To}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),eU=o(function(e){let t=e.data;switch(e.bom=0,e.type){case Vb:e.type=Co,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=ps,e.bom=4));break;case Co:if(e.type=Co,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: ${Co} specified but BOM is for ${ps}"`);break;case ps:if(e.type=ps,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${ps}" specified but BOM is for "${Co}"`);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"),tU=o(function(e,t){function n(s){let f={type:"",base64:!1},d=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return d&&(d[2]&&(f.type=d[2].toUpperCase()),d[1]&&(f.base64=!0)),f}o(n,"getType");let i=n(e.toUpperCase());if(i.base64){if(i.type===ea)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${ea}`);if(Hb.isBuffer(t))i.data=Kt.base64.decode(t);else if(typeof t=="string"){let s=Hb.from(t,"ascii");i.data=Kt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case hl:XL(i);break;case Kb:case To:case ds:QL(i);break;case Vb:case Co:case ps:eU(i);break;case O5:i.type=Rc;break;case N5:i.type=Oc;break;case D5:i.type=Ic;break;case R5:i.type=Dc;break;case Ic:case Dc:case l0:case Rc:case h0:case Oc:case ea:case d0:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===ea){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Hb.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),rU=o(function(e,t){function n(s){let f,u,d={crlf:!1,lf:!1,base64:!1,type:""},y=!0;for(;y;){if(u=s,f=s.slice(0,5),f==="CRLF:"){d.crlf=!0,u=s.slice(5);break}if(f=s.slice(0,3),f==="LF:"){d.lf=!0,u=s.slice(3);break}break}return f=u.split(":"),f.length===1?d.type=f[0]:f.length===2&&f[1]==="BASE64"&&(d.base64=!0,d.type=f[0]),d}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 hl:case To:case ds:case Co:case ps:case Ic:case Dc:case l0:case Rc:case h0:case Oc:case d0:break;case ea:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${ea}`);break;case D5:i.type=Ic;break;case R5:i.type=Dc;break;case Kb:i.type=To;break;case Vb:i.type=Co;break;case O5:i.type=Rc;break;case N5:i.type=Oc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),zb=o(function(e,t){switch(e){case hl:return Kt.utf8.encode(t);case To:return Kt.utf16be.encode(t);case ds:return Kt.utf16le.encode(t);case Co:return Kt.utf32be.encode(t);case ps:return Kt.utf32le.encode(t);case Ic:return Kt.uint7.encode(t);case Dc:return Kt.uint8.encode(t);case Rc:return Kt.uint16be.encode(t);case l0:return Kt.uint16le.encode(t);case Oc:return Kt.uint32be.encode(t);case h0:return Kt.uint32le.encode(t);case ea:return Kt.string.encode(t);case d0:return Kt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),nU=o(function(e){switch(e.type){case hl:return Kt.utf8.decode(e.data,e.bom);case ds:return Kt.utf16le.decode(e.data,e.bom);case To:return Kt.utf16be.decode(e.data,e.bom);case Co:return Kt.utf32be.decode(e.data,e.bom);case ps:return Kt.utf32le.decode(e.data,e.bom);case Ic:return Kt.uint7.decode(e.data);case Dc:return Kt.uint8.decode(e.data);case Rc:return Kt.uint16be.decode(e.data);case l0:return Kt.uint16le.decode(e.data);case Oc:return Kt.uint32be.decode(e.data);case h0:return Kt.uint32le.decode(e.data);case ea:return Kt.string.decode(e.data);case d0:return Kt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Nc.decode=o(function(e,t){let n=tU(e,t);return nU(n)},"exportsDecode");Nc.encode=o(function(e,t){let n,i,s=rU(e,t);return s.crlf?(n=Kt.lineEnds.crlf(t),i=zb(s.type,n)):s.lf?(n=Kt.lineEnds.lf(t),i=zb(s.type,n)):i=zb(s.type,t),s.base64&&(i=Kt.base64.encode(i)),i},"exportsEncode");var iU=o(function(e,t,n){return Nc.encode(n,Nc.decode(e,t))},"convert");Nc.convert=iU});var Wb=Re((xJ,P5)=>{P5.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
39
39
  .apg-mono {
40
40
  font-family: monospace;
41
41
  }
@@ -280,7 +280,7 @@ table.apg-attrs a:hover {
280
280
  `,s+=`<tr><td>sub-string end</td><td>${r.subEnd}</td><td>sub-string end-of-string index</td></tr>
281
281
  `,s+=`<tr><td>sub-string length</td><td>${r.subLength}</td><td>sub-string length</td></tr>
282
282
  `,s+=`</table>
283
- `,s};ir.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?Jb.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};ir.stringToChars=function(r){return Jb.decode("STRING",r)};ir.opcodeToString=function(r){let e="unknown";switch(r){case mr.ALT:e="ALT";break;case mr.CAT:e="CAT";break;case mr.RNM:e="RNM";break;case mr.UDT:e="UDT";break;case mr.AND:e="AND";break;case mr.NOT:e="NOT";break;case mr.REP:e="REP";break;case mr.TRG:e="TRG";break;case mr.TBS:e="TBS";break;case mr.TLS:e="TLS";break;case mr.BKR:e="BKR";break;case mr.BKA:e="BKA";break;case mr.BKN:e="BKN";break;case mr.ABG:e="ABG";break;case mr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};ir.stateToString=function(r){let e="unknown";switch(r){case mr.ACTIVE:e="ACTIVE";break;case mr.MATCH:e="MATCH";break;case mr.EMPTY:e="EMPTY";break;case mr.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};ir.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"];ir.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};ir.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToDec: input must be an array of integers`);let i=sf(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};ir.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToHex: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg){n+=`\\x${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${ir.charToHex(r[s])}`}return n};ir.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToHex: input must be an array of integers`);let i=sf(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 sU(r){return!(r>=55296&&r<=57343||r>1114111)}o(sU,"isUnicode");ir.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToUnicode: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)sU(r[s])?n+=`&#${r[s]};`:n+=` U+${ir.charToHex(r[s])}`;return n};ir.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToJsUnicode: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg){n+=`\\u${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${ir.charToHex(r[s])}`}return n};ir.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToAscii: input must be an array of integers`);let i=sf(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let f=r[s];f>=32&&f<=126?n+=String.fromCharCode(f):n+=`\\x${ir.charToHex(f)}`}return n};ir.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${ta}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=sf(r.length,e,t);for(let f=s.beg;f<s.end;f+=1)i=r[f],i<32||i===127?n+=`<span class="${kn.CLASS_CTRLCHAR}">${ir.asciiChars[i]}</span>`:i>127?n+=`<span class="${kn.CLASS_CTRLCHAR}">U+${ir.charToHex(i)}</span>`:n+=ir.asciiChars[i];return n};ir.stringToAsciiHtml=function(r){let e=Jb.decode("STRING",r);return this.charsToAsciiHtml(e)}});var L5=Re((EJ,B5)=>{B5.exports=o(function(){let e=Zi(),t=af(),n="ast.js: ",i=this,s=null,f=null,u=null,d=0,y=[],w=[],A=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(B,Y,P){A.length=0,O.length=0,y.length=0,d=0,s=B,f=Y,u=P;let J,ee=[];for(J=0;J<s.length;J+=1)ee.push(s[J].lower);for(J=0;J<f.length;J+=1)ee.push(f[J].lower);for(d=s.length+f.length,J=0;J<d;J+=1)y[J]=!1,w[J]=null;for(let Z in i.callbacks){let ne=Z.toLowerCase();if(J=ee.indexOf(ne),J<0)throw new Error(`${n}init: node '${Z}' not a rule or udt name`);typeof i.callbacks[Z]=="function"&&(y[J]=!0,w[J]=i.callbacks[Z]),i.callbacks[Z]===!0&&(y[J]=!0)}},"init"),this.ruleDefined=o(function(B){return y[B]!==!1},"ruleDefined"),this.udtDefined=o(function(B){return y[s.length+B]!==!1},"udtDefined"),this.down=o(function(B,Y){let P=O.length;return A.push(P),O.push({name:Y,thisIndex:P,thatIndex:null,state:e.SEM_PRE,callbackIndex:B,phraseIndex:null,phraseLength:null,stack:A.length}),P},"down"),this.up=o(function(B,Y,P,J){let ee=O.length,Z=A.pop();return O.push({name:Y,thisIndex:ee,thatIndex:Z,state:e.SEM_POST,callbackIndex:B,phraseIndex:P,phraseLength:J,stack:A.length}),O[Z].thatIndex=ee,O[Z].phraseIndex=P,O[Z].phraseLength=J,ee},"up"),this.translate=o(function(B){let Y,P,J;for(let ee=0;ee<O.length;ee+=1)J=O[ee],P=w[J.callbackIndex],J.state===e.SEM_PRE?P!==null&&(Y=P(e.SEM_PRE,u,J.phraseIndex,J.phraseLength,B),Y===e.SEM_SKIP&&(ee=J.thatIndex)):P!==null&&P(e.SEM_POST,u,J.phraseIndex,J.phraseLength,B)},"translate"),this.setLength=o(function(B){O.length=B,B>0?A.length=O[B-1].stack:A.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let B="";for(let Y=0;Y<I;Y+=1)B+=" ";return B}o(R,"indent"),this.toXml=o(function(B){let Y=t.charsToDec,P="decimal integer character codes";if(typeof B=="string"&&B.length>=3){let Z=B.slice(0,3).toLowerCase();Z==="asc"?(Y=t.charsToAscii,P="ASCII for printing characters, hex for non-printing"):Z==="hex"?(Y=t.charsToHex,P="hexadecimal integer character codes"):Z==="uni"&&(Y=t.charsToUnicode,P="Unicode UTF-32 integer character codes")}let J="",ee=0;return J+=`<?xml version="1.0" encoding="utf-8"?>
283
+ `,s};ir.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?Jb.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};ir.stringToChars=function(r){return Jb.decode("STRING",r)};ir.opcodeToString=function(r){let e="unknown";switch(r){case mr.ALT:e="ALT";break;case mr.CAT:e="CAT";break;case mr.RNM:e="RNM";break;case mr.UDT:e="UDT";break;case mr.AND:e="AND";break;case mr.NOT:e="NOT";break;case mr.REP:e="REP";break;case mr.TRG:e="TRG";break;case mr.TBS:e="TBS";break;case mr.TLS:e="TLS";break;case mr.BKR:e="BKR";break;case mr.BKA:e="BKA";break;case mr.BKN:e="BKN";break;case mr.ABG:e="ABG";break;case mr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};ir.stateToString=function(r){let e="unknown";switch(r){case mr.ACTIVE:e="ACTIVE";break;case mr.MATCH:e="MATCH";break;case mr.EMPTY:e="EMPTY";break;case mr.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};ir.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"];ir.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};ir.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToDec: input must be an array of integers`);let i=sf(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};ir.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToHex: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg){n+=`\\x${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${ir.charToHex(r[s])}`}return n};ir.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToHex: input must be an array of integers`);let i=sf(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 sU(r){return!(r>=55296&&r<=57343||r>1114111)}o(sU,"isUnicode");ir.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToUnicode: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)sU(r[s])?n+=`&#${r[s]};`:n+=` U+${ir.charToHex(r[s])}`;return n};ir.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToJsUnicode: input must be an array of integers`);let i=sf(r.length,e,t);if(i.end>i.beg){n+=`\\u${ir.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${ir.charToHex(r[s])}`}return n};ir.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${ta}charsToAscii: input must be an array of integers`);let i=sf(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let f=r[s];f>=32&&f<=126?n+=String.fromCharCode(f):n+=`\\x${ir.charToHex(f)}`}return n};ir.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${ta}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=sf(r.length,e,t);for(let f=s.beg;f<s.end;f+=1)i=r[f],i<32||i===127?n+=`<span class="${kn.CLASS_CTRLCHAR}">${ir.asciiChars[i]}</span>`:i>127?n+=`<span class="${kn.CLASS_CTRLCHAR}">U+${ir.charToHex(i)}</span>`:n+=ir.asciiChars[i];return n};ir.stringToAsciiHtml=function(r){let e=Jb.decode("STRING",r);return this.charsToAsciiHtml(e)}});var L5=Re((_J,B5)=>{B5.exports=o(function(){let e=Zi(),t=af(),n="ast.js: ",i=this,s=null,f=null,u=null,d=0,y=[],w=[],A=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(B,Y,P){A.length=0,O.length=0,y.length=0,d=0,s=B,f=Y,u=P;let J,ee=[];for(J=0;J<s.length;J+=1)ee.push(s[J].lower);for(J=0;J<f.length;J+=1)ee.push(f[J].lower);for(d=s.length+f.length,J=0;J<d;J+=1)y[J]=!1,w[J]=null;for(let Z in i.callbacks){let ne=Z.toLowerCase();if(J=ee.indexOf(ne),J<0)throw new Error(`${n}init: node '${Z}' not a rule or udt name`);typeof i.callbacks[Z]=="function"&&(y[J]=!0,w[J]=i.callbacks[Z]),i.callbacks[Z]===!0&&(y[J]=!0)}},"init"),this.ruleDefined=o(function(B){return y[B]!==!1},"ruleDefined"),this.udtDefined=o(function(B){return y[s.length+B]!==!1},"udtDefined"),this.down=o(function(B,Y){let P=O.length;return A.push(P),O.push({name:Y,thisIndex:P,thatIndex:null,state:e.SEM_PRE,callbackIndex:B,phraseIndex:null,phraseLength:null,stack:A.length}),P},"down"),this.up=o(function(B,Y,P,J){let ee=O.length,Z=A.pop();return O.push({name:Y,thisIndex:ee,thatIndex:Z,state:e.SEM_POST,callbackIndex:B,phraseIndex:P,phraseLength:J,stack:A.length}),O[Z].thatIndex=ee,O[Z].phraseIndex=P,O[Z].phraseLength=J,ee},"up"),this.translate=o(function(B){let Y,P,J;for(let ee=0;ee<O.length;ee+=1)J=O[ee],P=w[J.callbackIndex],J.state===e.SEM_PRE?P!==null&&(Y=P(e.SEM_PRE,u,J.phraseIndex,J.phraseLength,B),Y===e.SEM_SKIP&&(ee=J.thatIndex)):P!==null&&P(e.SEM_POST,u,J.phraseIndex,J.phraseLength,B)},"translate"),this.setLength=o(function(B){O.length=B,B>0?A.length=O[B-1].stack:A.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(I){let B="";for(let Y=0;Y<I;Y+=1)B+=" ";return B}o(R,"indent"),this.toXml=o(function(B){let Y=t.charsToDec,P="decimal integer character codes";if(typeof B=="string"&&B.length>=3){let Z=B.slice(0,3).toLowerCase();Z==="asc"?(Y=t.charsToAscii,P="ASCII for printing characters, hex for non-printing"):Z==="hex"?(Y=t.charsToHex,P="hexadecimal integer character codes"):Z==="uni"&&(Y=t.charsToUnicode,P="Unicode UTF-32 integer character codes")}let J="",ee=0;return J+=`<?xml version="1.0" encoding="utf-8"?>
284
284
  `,J+=`<root nodes="${O.length/2}" characters="${u.length}">
285
285
  `,J+=`<!-- input string, ${P} -->
286
286
  `,J+=R(ee+2),J+=Y(u),J+=`
@@ -288,7 +288,7 @@ table.apg-attrs a:hover {
288
288
  `,J+=R(ee+2),J+=Y(u,Z.phraseIndex,Z.phraseLength),J+=`
289
289
  `):(J+=R(ee),J+=`</node><!-- name="${Z.name}" -->
290
290
  `,ee-=1)}),J+=`</root>
291
- `,J},"toSml"),this.phrases=o(function(){let B={},Y,P;for(Y=0;Y<O.length;Y+=1)P=O[Y],P.state===e.SEM_PRE&&(Array.isArray(B[P.name])||(B[P.name]=[]),B[P.name].push({index:P.phraseIndex,length:P.phraseLength}));return B},"phrases")},"exportsAst")});var Yb=Re((AJ,U5)=>{U5.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 f=0;f<=t;f+=1)s(f,f);return}for(let f=t-n+1;f<=t;f+=1){let u=(f+n)%n;s(u,f)}}},"forEach")},"exportsCircularBuffer")});var $5=Re((SJ,F5)=>{F5.exports=o(function(){let e=Zi(),t=af(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let f=null,u=null,d,y,w,A,O=0,R=0,I=0,B=null,Y=null,P=null,J=null,ee=null,Z=0,ne=1/0,V=1/0,j=o(function(oe,F,X){let me=`${n}evaluateRule(): `;if(oe>=P.length)throw new Error(`${me}rule index: ${oe} out of range`);if(F>=w)throw new Error(`${me}phrase index: ${F} out of range`);let{length:ye}=f;f.push({type:e.RNM,index:oe}),s(ye,F,X),f.pop()},"evaluateRule"),H=o(function(le,oe,F){let X=`${n}evaluateUdt(): `;if(le>=J.length)throw new Error(`${X}udt index: ${le} out of range`);if(oe>=w)throw new Error(`${X}phrase index: ${oe} out of range`);let{length:me}=f;f.push({type:e.UDT,empty:J[le].empty,index:le}),s(me,oe,F),f.pop()},"evaluateUdt"),he=o(function(){O=0,R=0,I=0,Z=0,A=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],P=null,J=null,u=null,d=0,y=0,w=0,B=null,Y=null,ee=null,f=null},"clear"),L=o(function(){let le=[],oe=o(function(){let X={};P.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),J.length>0&&J.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),le.push(X)},"init"),F=o(function(){let X=le[le.length-1],me={};for(let ye in X)me[ye]=X[ye];return me},"copy");this.push=o(function(){le.push(F())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=le.length-1),ye<1||ye>le.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return le.length=ye,le[le.length-1]},"pop"),this.length=o(function(){return le.length},"length"),this.savePhrase=o(function(me,ye,we){le[le.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(X){return le[le.length-1][X]},oe()},"backRef"),h=o(function(){let oe=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=A[A.length-1],this.uFrame=new L,this.pFrame=new L,this.evaluateRule=j,this.evaluateUdt=H,this.refresh=o(function(){oe.state=e.ACTIVE,oe.phraseLength=0,oe.lookAround=A[A.length-1]},"refresh")},"systemData"),v=o(function(){return A[A.length-1]},"lookAroundValue"),g=o(function(){return A.length>1},"inLookAround"),l=o(function(){return A[A.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),b=o(function(){let le=`${n}initializeAst(): `,oe=!0;for(;oe;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${le}ast object not recognized`);break}i.ast!==null&&i.ast.init(P,J,u)},"initializeAst"),E=o(function(){let le=`${n}initializeTrace(): `,oe=!0;for(;oe;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${le}trace object not recognized`);break}i.trace!==null&&i.trace.init(P,J,u)},"initializeTrace"),M=o(function(){let le=`${n}initializeStats(): `,oe=!0;for(;oe;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${le}stats object not recognized`);break}i.stats!==null&&i.stats.init(P,J)},"initializeStats"),S=o(function(le){let oe=`${n}initializeGrammar(): `;if(!le)throw new Error(`${oe}grammar object undefined`);if(le.grammarObject!=="grammarObject")throw new Error(`${oe}bad grammar object`);P=le.rules,J=le.udts},"initializeGrammar"),x=o(function(le){let oe=`${n}initializeStartRule(): `,F=null;if(typeof le=="number"){if(le>=P.length)throw new Error(`${oe}start rule index too large: max: ${P.length}: index: ${le}`);F=le}else if(typeof le=="string"){let X=le.toLowerCase();for(let me=0;me<P.length;me+=1)if(X===P[me].lower){F=P[me].index;break}if(F===null)throw new Error(`${oe}start rule name '${le}' not recognized`)}else throw new Error(`${oe}type of start rule '${typeof le}' not recognized`);return F},"initializeStartRule"),C=o(function(oe,F,X){let me=`${n}initializeInputChars(): `,ye=oe,we=F,Ie=X;if(ye===void 0)throw new Error(`${me}input string is undefined`);if(ye===null)throw new Error(`${me}input string is null`);if(typeof ye=="string")ye=t.stringToChars(ye);else if(!Array.isArray(ye))throw new Error(`${me}input string is not a string or array`);if(ye.length>0&&typeof ye[0]!="number")throw new Error(`${me}input string not an array of integers`);if(typeof we!="number")we=0;else if(we=Math.floor(we),we<0||we>ye.length)throw new Error(`${me}input beginning index out of range: ${we}`);if(typeof Ie!="number")Ie=ye.length-we;else if(Ie=Math.floor(Ie),Ie<0||Ie>ye.length-we)throw new Error(`${me}input length out of range: ${Ie}`);u=ye,d=we,y=Ie,w=d+y},"initializeInputChars"),N=o(function(){let le=`${n}initializeCallbacks(): `,oe;for(B=[],Y=[],oe=0;oe<P.length;oe+=1)B[oe]=null;for(oe=0;oe<J.length;oe+=1)Y[oe]=null;let F,X=[];for(oe=0;oe<P.length;oe+=1)X.push(P[oe].lower);for(oe=0;oe<J.length;oe+=1)X.push(J[oe].lower);for(let me in i.callbacks){if(oe=X.indexOf(me.toLowerCase()),oe<0)throw new Error(`${le}syntax callback '${me}' not a rule or udt name`);if(F=i.callbacks[me],F||(F=null),typeof F=="function"||F===null)oe<P.length?B[oe]=F:Y[oe-P.length]=F;else throw new Error(`${le}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(oe=0;oe<J.length;oe+=1)if(Y[oe]===null)throw new Error(`${le}all UDT callbacks must be defined. UDT callback[${J[oe].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(le){if(typeof le!="number")throw new Error(`parser: max tree depth must be integer > 0: ${le}`);if(ne=Math.floor(le),ne<=0)throw new Error(`parser: max tree depth must be integer > 0: ${le}`)},this.setMaxNodeHits=function(le){if(typeof le!="number")throw new Error(`parser: max node hits must be integer > 0: ${le}`);if(V=Math.floor(le),V<=0)throw new Error(`parser: max node hits must be integer > 0: ${le}`)};let _=o(function(le,oe,F){let X,me=`${n}parse(): `;S(le);let ye=x(oe);N(),E(),M(),b();let we=new h;switch(F!=null&&(ee=F),f=[{type:e.RNM,index:ye}],s(0,d,we),f=null,we.state){case e.ACTIVE:throw new Error(`${me}final state should never be 'ACTIVE'`);case e.NOMATCH:X=!1;break;case e.EMPTY:case e.MATCH:we.phraseLength===y?X=!0:X=!1;break;default:throw new Error("unrecognized state")}return{success:X,state:we.state,length:y,matched:we.phraseLength,maxMatched:Z,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:w,subLength:y}},"privateParse");this.parseSubstring=o(function(oe,F,X,me,ye,we){return he(),C(X,me,ye),_(oe,F,we)},"parseSubstring"),this.parse=o(function(oe,F,X,me){return he(),C(X,0,X.length),_(oe,F,me)},"parse");let k=o(function(le,oe,F){let X=f[le];for(let me=0;me<X.children.length&&(s(X.children[me],oe,F),F.state===e.NOMATCH);me+=1);},"opALT"),fe=o(function(le,oe,F){let X,me,ye,we,Ie=f[le],Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=oe,we=0;for(let Ne=0;Ne<Ie.children.length;Ne+=1)if(s(Ie.children[Ne],ye,F),F.state===e.NOMATCH){X=!1;break}else ye+=F.phraseLength,we+=F.phraseLength;X?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCAT"),D=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];if(Ie.max===0){F.state=e.EMPTY,F.phraseLength=0;return}me=oe,ye=0,we=0;let Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(X=i.ast.getLength());let Ne=!0;for(;Ne&&!(me>=w||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me+=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(X))},"opREP"),Q=o(function(le,oe,F,X){if(oe.phraseLength>F){let me=`${n}opRNM(${le.name}): callback function error: `;throw me+=`sysData.phraseLength: ${oe.phraseLength}`,me+=` must be <= remaining chars: ${F}`,new Error(me)}switch(oe.state){case e.ACTIVE:if(X!==!0)throw new Error(`${n}opRNM(${le.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:oe.phraseLength=0;break;case e.MATCH:oe.phraseLength===0&&(oe.state=e.EMPTY);break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opRNM(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateRnmCallbackResult"),se=o(function(le,oe,F){let X,me,ye,we,Ie,Ot,Fe=f[le],Ne=P[Fe.index],Ut=B[Ne.index],Ve=!g();if(Ve&&(me=i.ast&&i.ast.ruleDefined(Fe.index),me&&(X=i.ast.getLength(),i.ast.down(Fe.index,P[Fe.index].name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Ot=F.pFrame,F.pFrame=new L),Ut===null)ye=f,f=Ne.opcodes,s(0,oe,F),f=ye;else{let Ze=w-oe;F.ruleIndex=Ne.index,Ut(F,u,oe,ee),Q(Ne,F,Ze,!0),F.state===e.ACTIVE&&(ye=f,f=Ne.opcodes,s(0,oe,F),f=ye,F.ruleIndex=Ne.index,Ut(F,u,oe,ee),Q(Ne,F,Ze,!1))}Ve&&(me&&(F.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Fe.index,Ne.name,oe,F.phraseLength)),F.pFrame=Ot,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opRNM"),q=o(function(le,oe,F){if(oe.phraseLength>F){let X=`${n}opUDT(${le.name}): callback function error: `;throw X+=`sysData.phraseLength: ${oe.phraseLength}`,X+=` must be <= remaining chars: ${F}`,new Error(X)}switch(oe.state){case e.ACTIVE:throw new Error(`${n}opUDT(${le.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.phraseLength=0;break;case e.MATCH:if(oe.phraseLength===0){if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.state=e.EMPTY}break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opUDT(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateUdtCallbackResult"),z=o(function(le,oe,F){let X,me,ye,we,Ie,Ot,Fe=f[le],Ne=J[Fe.index];F.UdtIndex=Ne.index;let Ut=!g();Ut&&(ye=i.ast&&i.ast.udtDefined(Fe.index),ye&&(me=P.length+Fe.index,X=i.ast.getLength(),i.ast.down(me,Ne.name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Ot=F.pFrame,F.pFrame=new L);let Ve=w-oe;Y[Fe.index](F,u,oe,ee),q(Ne,F,Ve),Ut&&(ye&&(F.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Ne.name,oe,F.phraseLength)),F.pFrame=Ot,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opUDT"),G=o(function(le,oe,F){A.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:w,charsLength:y}),w=u.length,y=u.length-d,s(le+1,oe,F);let X=A.pop();switch(w=X.charsEnd,y=X.charsLength,F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${F.state}`)}},"opAND"),te=o(function(le,oe,F){A.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:w,charsLength:y}),w=u.length,y=u.length-d,s(le+1,oe,F);let X=A.pop();switch(w=X.charsEnd,y=X.charsLength,F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${F.state}`)}},"opNOT"),ae=o(function(le,oe,F){let X=f[le];F.state=e.NOMATCH,oe<w&&X.min<=u[oe]&&u[oe]<=X.max&&(F.state=e.MATCH,F.phraseLength=1)},"opTRG"),Ae=o(function(le,oe,F){let X,me=f[le],ye=me.string.length;if(F.state=e.NOMATCH,oe+ye<=w){for(X=0;X<ye;X+=1)if(u[oe+X]!==me.string[X])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBS"),ge=o(function(le,oe,F){let X,me,ye=f[le];F.state=e.NOMATCH;let we=ye.string.length;if(we===0){F.state=e.EMPTY;return}if(oe+we<=w){for(X=0;X<we;X+=1)if(me=u[oe+X],me>=65&&me<=90&&(me+=32),me!==ye.string[X])return;F.state=e.MATCH,F.phraseLength=we}},"opTLS"),ie=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===0?e.EMPTY:e.NOMATCH},"opABG"),Me=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ue=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];F.state=e.NOMATCH,Ie.index<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Ot=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Ot===null)return;let Ne=Ot.phraseIndex,Ut=Ot.phraseLength;if(Ut===0){F.state=e.EMPTY;return}if(oe+Ut<=w){if(Fe){for(X=0;X<Ut;X+=1)if(me=u[oe+X],ye=u[Ne+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}else for(X=0;X<Ut;X+=1)if(me=u[oe+X],ye=u[Ne+X],me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}},"opBKR"),ve=o(function(le,oe,F){switch(A.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),A.pop(),F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${F.state}`)}},"opBKA"),W=o(function(le,oe,F){switch(A.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),A.pop(),F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${F.state}`)}},"opBKN"),pe=o(function(le,oe,F){let X,me,ye,we,Ie=f[le],Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=oe,we=0;for(let Ne=Ie.children.length-1;Ne>=0;Ne-=1)if(s(Ie.children[Ne],ye,F),ye-=F.phraseLength,we+=F.phraseLength,F.state===e.NOMATCH){X=!1;break}X?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCATBehind"),ke=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];me=oe,ye=0,we=0;let Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(X=i.ast.getLength());let Ne=!0;for(;Ne&&!(me<=0||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me-=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(X))},"opREPBehind"),ze=o(function(le,oe,F){let X=f[le];if(F.state=e.NOMATCH,F.phraseLength=0,oe>0){let me=u[oe-1];X.min<=me&&me<=X.max&&(F.state=e.MATCH,F.phraseLength=1)}},"opTRGBehind"),Pe=o(function(le,oe,F){let X,me=f[le];F.state=e.NOMATCH;let ye=me.string.length,we=oe-ye;if(we>=0){for(X=0;X<ye;X+=1)if(u[we+X]!==me.string[X])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBSBehind"),Je=o(function(le,oe,F){let X,me=f[le];F.state=e.NOMATCH;let ye=me.string.length;if(ye===0){F.state=e.EMPTY;return}let we=oe-ye;if(we>=0){for(let Ie=0;Ie<ye;Ie+=1)if(X=u[we+Ie],X>=65&&X<=90&&(X+=32),X!==me.string[Ie])return;F.state=e.MATCH,F.phraseLength=ye}},"opTLSBehind"),gr=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];F.state=e.NOMATCH,F.phraseLength=0,Ie.index<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Ot=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Ot===null)return;let Ne=Ot.phraseIndex,Ut=Ot.phraseLength;if(Ut===0){F.state=e.EMPTY,F.phraseLength=0;return}let Ve=oe-Ut;if(Ve>=0){if(Fe){for(X=0;X<Ut;X+=1)if(me=u[Ve+X],ye=u[Ne+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}else for(X=0;X<Ut;X+=1)if(me=u[Ve+X],ye=u[Ne+X],me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}},"opBKRBehind");s=o(function(oe,F,X){let me=!0,ye=f[oe];if(I+=1,I>V)throw new Error(`parser: maximum number of node hits exceeded: ${V}`);if(O+=1,O>R&&(R=O,R>ne))throw new Error(`parser: maximum parse tree depth exceeded: ${ne}`);if(X.refresh(),i.trace!==null){let we=v();i.trace.down(ye,X.state,F,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(oe,F,X);break;case e.CAT:pe(oe,F,X);break;case e.REP:ke(oe,F,X);break;case e.RNM:se(oe,F,X);break;case e.UDT:z(oe,F,X);break;case e.AND:G(oe,F,X);break;case e.NOT:te(oe,F,X);break;case e.TRG:ze(oe,F,X);break;case e.TBS:Pe(oe,F,X);break;case e.TLS:Je(oe,F,X);break;case e.BKR:gr(oe,F,X);break;case e.BKA:ve(oe,F,X);break;case e.BKN:W(oe,F,X);break;case e.ABG:ie(oe,F,X);break;case e.AEN:Me(oe,F,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(oe,F,X);break;case e.CAT:fe(oe,F,X);break;case e.REP:D(oe,F,X);break;case e.RNM:se(oe,F,X);break;case e.UDT:z(oe,F,X);break;case e.AND:G(oe,F,X);break;case e.NOT:te(oe,F,X);break;case e.TRG:ae(oe,F,X);break;case e.TBS:Ae(oe,F,X);break;case e.TLS:ge(oe,F,X);break;case e.BKR:ue(oe,F,X);break;case e.BKA:ve(oe,F,X);break;case e.BKN:W(oe,F,X);break;case e.ABG:ie(oe,F,X);break;case e.AEN:Me(oe,F,X);break;default:me=!1;break}if(!g()&&F+X.phraseLength>Z&&(Z=F+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=v();i.trace.up(ye,X.state,F,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var j5=Re((MJ,q5)=>{q5.exports=o(function(){let e=Zi(),t=af(),n=ul(),i="stats.js: ",s=[],f=[],u=[],d,y=[],w=[];this.statsObject="statsObject";let A="stats",O=o(function(V,j){return V.lower<j.lower?-1:V.lower>j.lower?1:0},"sortAlpha"),R=o(function(V,j){return V.total<j.total?1:V.total>j.total?-1:O(V,j)},"sortHits"),I=o(function(V,j){return V.index<j.index?-1:V.index>j.index?1:0},"sortIndex"),B=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),Y=o(function(){u.length=0,d=new B,u[e.ALT]=new B,u[e.CAT]=new B,u[e.REP]=new B,u[e.RNM]=new B,u[e.TRG]=new B,u[e.TBS]=new B,u[e.TLS]=new B,u[e.UDT]=new B,u[e.AND]=new B,u[e.NOT]=new B,u[e.BKR]=new B,u[e.BKA]=new B,u[e.BKN]=new B,u[e.ABG]=new B,u[e.AEN]=new B,y.length=0;for(let V=0;V<s.length;V+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:s[V].name,lower:s[V].lower,index:s[V].index});if(f.length>0){w.length=0;for(let V=0;V<f.length;V+=1)w.push({empty:0,match:0,nomatch:0,total:0,name:f[V].name,lower:f[V].lower,index:f[V].index})}},"clear"),P=o(function(V,j){switch(V.total+=1,j){case e.EMPTY:V.empty+=1;break;case e.MATCH:V.match+=1;break;case e.NOMATCH:V.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${j}`)}},"incStat"),J=o(function(V,j){let H="";return H+="<tr>",H+=`<td class="${n.CLASS_ACTIVE}">${V}</td>`,H+=`<td class="${n.CLASS_EMPTY}">${j.empty}</td>`,H+=`<td class="${n.CLASS_MATCH}">${j.match}</td>`,H+=`<td class="${n.CLASS_NOMATCH}">${j.nomatch}</td>`,H+=`<td class="${n.CLASS_ACTIVE}">${j.total}</td>`,H+=`</tr>
291
+ `,J},"toSml"),this.phrases=o(function(){let B={},Y,P;for(Y=0;Y<O.length;Y+=1)P=O[Y],P.state===e.SEM_PRE&&(Array.isArray(B[P.name])||(B[P.name]=[]),B[P.name].push({index:P.phraseIndex,length:P.phraseLength}));return B},"phrases")},"exportsAst")});var Yb=Re((EJ,U5)=>{U5.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 f=0;f<=t;f+=1)s(f,f);return}for(let f=t-n+1;f<=t;f+=1){let u=(f+n)%n;s(u,f)}}},"forEach")},"exportsCircularBuffer")});var $5=Re((AJ,F5)=>{F5.exports=o(function(){let e=Zi(),t=af(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let f=null,u=null,d,y,w,A,O=0,R=0,I=0,B=null,Y=null,P=null,J=null,ee=null,Z=0,ne=1/0,V=1/0,j=o(function(oe,F,X){let me=`${n}evaluateRule(): `;if(oe>=P.length)throw new Error(`${me}rule index: ${oe} out of range`);if(F>=w)throw new Error(`${me}phrase index: ${F} out of range`);let{length:ye}=f;f.push({type:e.RNM,index:oe}),s(ye,F,X),f.pop()},"evaluateRule"),H=o(function(le,oe,F){let X=`${n}evaluateUdt(): `;if(le>=J.length)throw new Error(`${X}udt index: ${le} out of range`);if(oe>=w)throw new Error(`${X}phrase index: ${oe} out of range`);let{length:me}=f;f.push({type:e.UDT,empty:J[le].empty,index:le}),s(me,oe,F),f.pop()},"evaluateUdt"),he=o(function(){O=0,R=0,I=0,Z=0,A=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],P=null,J=null,u=null,d=0,y=0,w=0,B=null,Y=null,ee=null,f=null},"clear"),L=o(function(){let le=[],oe=o(function(){let X={};P.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),J.length>0&&J.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),le.push(X)},"init"),F=o(function(){let X=le[le.length-1],me={};for(let ye in X)me[ye]=X[ye];return me},"copy");this.push=o(function(){le.push(F())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=le.length-1),ye<1||ye>le.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return le.length=ye,le[le.length-1]},"pop"),this.length=o(function(){return le.length},"length"),this.savePhrase=o(function(me,ye,we){le[le.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(X){return le[le.length-1][X]},oe()},"backRef"),h=o(function(){let oe=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=A[A.length-1],this.uFrame=new L,this.pFrame=new L,this.evaluateRule=j,this.evaluateUdt=H,this.refresh=o(function(){oe.state=e.ACTIVE,oe.phraseLength=0,oe.lookAround=A[A.length-1]},"refresh")},"systemData"),v=o(function(){return A[A.length-1]},"lookAroundValue"),g=o(function(){return A.length>1},"inLookAround"),l=o(function(){return A[A.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),b=o(function(){let le=`${n}initializeAst(): `,oe=!0;for(;oe;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${le}ast object not recognized`);break}i.ast!==null&&i.ast.init(P,J,u)},"initializeAst"),E=o(function(){let le=`${n}initializeTrace(): `,oe=!0;for(;oe;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${le}trace object not recognized`);break}i.trace!==null&&i.trace.init(P,J,u)},"initializeTrace"),M=o(function(){let le=`${n}initializeStats(): `,oe=!0;for(;oe;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${le}stats object not recognized`);break}i.stats!==null&&i.stats.init(P,J)},"initializeStats"),S=o(function(le){let oe=`${n}initializeGrammar(): `;if(!le)throw new Error(`${oe}grammar object undefined`);if(le.grammarObject!=="grammarObject")throw new Error(`${oe}bad grammar object`);P=le.rules,J=le.udts},"initializeGrammar"),x=o(function(le){let oe=`${n}initializeStartRule(): `,F=null;if(typeof le=="number"){if(le>=P.length)throw new Error(`${oe}start rule index too large: max: ${P.length}: index: ${le}`);F=le}else if(typeof le=="string"){let X=le.toLowerCase();for(let me=0;me<P.length;me+=1)if(X===P[me].lower){F=P[me].index;break}if(F===null)throw new Error(`${oe}start rule name '${le}' not recognized`)}else throw new Error(`${oe}type of start rule '${typeof le}' not recognized`);return F},"initializeStartRule"),C=o(function(oe,F,X){let me=`${n}initializeInputChars(): `,ye=oe,we=F,Ie=X;if(ye===void 0)throw new Error(`${me}input string is undefined`);if(ye===null)throw new Error(`${me}input string is null`);if(typeof ye=="string")ye=t.stringToChars(ye);else if(!Array.isArray(ye))throw new Error(`${me}input string is not a string or array`);if(ye.length>0&&typeof ye[0]!="number")throw new Error(`${me}input string not an array of integers`);if(typeof we!="number")we=0;else if(we=Math.floor(we),we<0||we>ye.length)throw new Error(`${me}input beginning index out of range: ${we}`);if(typeof Ie!="number")Ie=ye.length-we;else if(Ie=Math.floor(Ie),Ie<0||Ie>ye.length-we)throw new Error(`${me}input length out of range: ${Ie}`);u=ye,d=we,y=Ie,w=d+y},"initializeInputChars"),N=o(function(){let le=`${n}initializeCallbacks(): `,oe;for(B=[],Y=[],oe=0;oe<P.length;oe+=1)B[oe]=null;for(oe=0;oe<J.length;oe+=1)Y[oe]=null;let F,X=[];for(oe=0;oe<P.length;oe+=1)X.push(P[oe].lower);for(oe=0;oe<J.length;oe+=1)X.push(J[oe].lower);for(let me in i.callbacks){if(oe=X.indexOf(me.toLowerCase()),oe<0)throw new Error(`${le}syntax callback '${me}' not a rule or udt name`);if(F=i.callbacks[me],F||(F=null),typeof F=="function"||F===null)oe<P.length?B[oe]=F:Y[oe-P.length]=F;else throw new Error(`${le}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(oe=0;oe<J.length;oe+=1)if(Y[oe]===null)throw new Error(`${le}all UDT callbacks must be defined. UDT callback[${J[oe].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(le){if(typeof le!="number")throw new Error(`parser: max tree depth must be integer > 0: ${le}`);if(ne=Math.floor(le),ne<=0)throw new Error(`parser: max tree depth must be integer > 0: ${le}`)},this.setMaxNodeHits=function(le){if(typeof le!="number")throw new Error(`parser: max node hits must be integer > 0: ${le}`);if(V=Math.floor(le),V<=0)throw new Error(`parser: max node hits must be integer > 0: ${le}`)};let _=o(function(le,oe,F){let X,me=`${n}parse(): `;S(le);let ye=x(oe);N(),E(),M(),b();let we=new h;switch(F!=null&&(ee=F),f=[{type:e.RNM,index:ye}],s(0,d,we),f=null,we.state){case e.ACTIVE:throw new Error(`${me}final state should never be 'ACTIVE'`);case e.NOMATCH:X=!1;break;case e.EMPTY:case e.MATCH:we.phraseLength===y?X=!0:X=!1;break;default:throw new Error("unrecognized state")}return{success:X,state:we.state,length:y,matched:we.phraseLength,maxMatched:Z,maxTreeDepth:R,nodeHits:I,inputLength:u.length,subBegin:d,subEnd:w,subLength:y}},"privateParse");this.parseSubstring=o(function(oe,F,X,me,ye,we){return he(),C(X,me,ye),_(oe,F,we)},"parseSubstring"),this.parse=o(function(oe,F,X,me){return he(),C(X,0,X.length),_(oe,F,me)},"parse");let k=o(function(le,oe,F){let X=f[le];for(let me=0;me<X.children.length&&(s(X.children[me],oe,F),F.state===e.NOMATCH);me+=1);},"opALT"),fe=o(function(le,oe,F){let X,me,ye,we,Ie=f[le],Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=oe,we=0;for(let Ne=0;Ne<Ie.children.length;Ne+=1)if(s(Ie.children[Ne],ye,F),F.state===e.NOMATCH){X=!1;break}else ye+=F.phraseLength,we+=F.phraseLength;X?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCAT"),D=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];if(Ie.max===0){F.state=e.EMPTY,F.phraseLength=0;return}me=oe,ye=0,we=0;let Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(X=i.ast.getLength());let Ne=!0;for(;Ne&&!(me>=w||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me+=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(X))},"opREP"),Q=o(function(le,oe,F,X){if(oe.phraseLength>F){let me=`${n}opRNM(${le.name}): callback function error: `;throw me+=`sysData.phraseLength: ${oe.phraseLength}`,me+=` must be <= remaining chars: ${F}`,new Error(me)}switch(oe.state){case e.ACTIVE:if(X!==!0)throw new Error(`${n}opRNM(${le.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:oe.phraseLength=0;break;case e.MATCH:oe.phraseLength===0&&(oe.state=e.EMPTY);break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opRNM(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateRnmCallbackResult"),se=o(function(le,oe,F){let X,me,ye,we,Ie,Ot,Fe=f[le],Ne=P[Fe.index],Ut=B[Ne.index],Ve=!g();if(Ve&&(me=i.ast&&i.ast.ruleDefined(Fe.index),me&&(X=i.ast.getLength(),i.ast.down(Fe.index,P[Fe.index].name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Ot=F.pFrame,F.pFrame=new L),Ut===null)ye=f,f=Ne.opcodes,s(0,oe,F),f=ye;else{let Ze=w-oe;F.ruleIndex=Ne.index,Ut(F,u,oe,ee),Q(Ne,F,Ze,!0),F.state===e.ACTIVE&&(ye=f,f=Ne.opcodes,s(0,oe,F),f=ye,F.ruleIndex=Ne.index,Ut(F,u,oe,ee),Q(Ne,F,Ze,!1))}Ve&&(me&&(F.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Fe.index,Ne.name,oe,F.phraseLength)),F.pFrame=Ot,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opRNM"),q=o(function(le,oe,F){if(oe.phraseLength>F){let X=`${n}opUDT(${le.name}): callback function error: `;throw X+=`sysData.phraseLength: ${oe.phraseLength}`,X+=` must be <= remaining chars: ${F}`,new Error(X)}switch(oe.state){case e.ACTIVE:throw new Error(`${n}opUDT(${le.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.phraseLength=0;break;case e.MATCH:if(oe.phraseLength===0){if(le.empty===!1)throw new Error(`${n}opUDT(${le.name}): callback function return error. May not return EMPTY.`);oe.state=e.EMPTY}break;case e.NOMATCH:oe.phraseLength=0;break;default:throw new Error(`${n}opUDT(${le.name}): callback function return error. Unrecognized return state: ${oe.state}`)}},"validateUdtCallbackResult"),z=o(function(le,oe,F){let X,me,ye,we,Ie,Ot,Fe=f[le],Ne=J[Fe.index];F.UdtIndex=Ne.index;let Ut=!g();Ut&&(ye=i.ast&&i.ast.udtDefined(Fe.index),ye&&(me=P.length+Fe.index,X=i.ast.getLength(),i.ast.down(me,Ne.name)),we=F.uFrame.length(),Ie=F.pFrame.length(),F.uFrame.push(),F.pFrame.push(),Ot=F.pFrame,F.pFrame=new L);let Ve=w-oe;Y[Fe.index](F,u,oe,ee),q(Ne,F,Ve),Ut&&(ye&&(F.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Ne.name,oe,F.phraseLength)),F.pFrame=Ot,F.state===e.NOMATCH?(F.uFrame.pop(we),F.pFrame.pop(Ie)):Ne.isBkr&&(F.pFrame.savePhrase(Ne.lower,oe,F.phraseLength),F.uFrame.savePhrase(Ne.lower,oe,F.phraseLength)))},"opUDT"),G=o(function(le,oe,F){A.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:w,charsLength:y}),w=u.length,y=u.length-d,s(le+1,oe,F);let X=A.pop();switch(w=X.charsEnd,y=X.charsLength,F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${F.state}`)}},"opAND"),te=o(function(le,oe,F){A.push({lookAround:e.LOOKAROUND_AHEAD,anchor:oe,charsEnd:w,charsLength:y}),w=u.length,y=u.length-d,s(le+1,oe,F);let X=A.pop();switch(w=X.charsEnd,y=X.charsLength,F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${F.state}`)}},"opNOT"),ae=o(function(le,oe,F){let X=f[le];F.state=e.NOMATCH,oe<w&&X.min<=u[oe]&&u[oe]<=X.max&&(F.state=e.MATCH,F.phraseLength=1)},"opTRG"),Ae=o(function(le,oe,F){let X,me=f[le],ye=me.string.length;if(F.state=e.NOMATCH,oe+ye<=w){for(X=0;X<ye;X+=1)if(u[oe+X]!==me.string[X])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBS"),ge=o(function(le,oe,F){let X,me,ye=f[le];F.state=e.NOMATCH;let we=ye.string.length;if(we===0){F.state=e.EMPTY;return}if(oe+we<=w){for(X=0;X<we;X+=1)if(me=u[oe+X],me>=65&&me<=90&&(me+=32),me!==ye.string[X])return;F.state=e.MATCH,F.phraseLength=we}},"opTLS"),ie=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===0?e.EMPTY:e.NOMATCH},"opABG"),Me=o(function(le,oe,F){F.state=e.NOMATCH,F.phraseLength=0,F.state=oe===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ue=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];F.state=e.NOMATCH,Ie.index<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Ot=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Ot===null)return;let Ne=Ot.phraseIndex,Ut=Ot.phraseLength;if(Ut===0){F.state=e.EMPTY;return}if(oe+Ut<=w){if(Fe){for(X=0;X<Ut;X+=1)if(me=u[oe+X],ye=u[Ne+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}else for(X=0;X<Ut;X+=1)if(me=u[oe+X],ye=u[Ne+X],me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}},"opBKR"),ve=o(function(le,oe,F){switch(A.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),A.pop(),F.phraseLength=0,F.state){case e.EMPTY:F.state=e.EMPTY;break;case e.MATCH:F.state=e.EMPTY;break;case e.NOMATCH:F.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${F.state}`)}},"opBKA"),W=o(function(le,oe,F){switch(A.push({lookAround:e.LOOKAROUND_BEHIND,anchor:oe}),s(le+1,oe,F),A.pop(),F.phraseLength=0,F.state){case e.EMPTY:case e.MATCH:F.state=e.NOMATCH;break;case e.NOMATCH:F.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${F.state}`)}},"opBKN"),pe=o(function(le,oe,F){let X,me,ye,we,Ie=f[le],Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=oe,we=0;for(let Ne=Ie.children.length-1;Ne>=0;Ne-=1)if(s(Ie.children[Ne],ye,F),ye-=F.phraseLength,we+=F.phraseLength,F.state===e.NOMATCH){X=!1;break}X?(F.state=we===0?e.EMPTY:e.MATCH,F.phraseLength=we):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(me))},"opCATBehind"),ke=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];me=oe,ye=0,we=0;let Ot=F.uFrame.length(),Fe=F.pFrame.length();i.ast&&(X=i.ast.getLength());let Ne=!0;for(;Ne&&!(me<=0||(s(le+1,me,F),F.state===e.NOMATCH)||F.state===e.EMPTY||(we+=1,ye+=F.phraseLength,me-=F.phraseLength,we===Ie.max)););F.state===e.EMPTY||we>=Ie.min?(F.state=ye===0?e.EMPTY:e.MATCH,F.phraseLength=ye):(F.state=e.NOMATCH,F.phraseLength=0,F.uFrame.pop(Ot),F.pFrame.pop(Fe),i.ast&&i.ast.setLength(X))},"opREPBehind"),ze=o(function(le,oe,F){let X=f[le];if(F.state=e.NOMATCH,F.phraseLength=0,oe>0){let me=u[oe-1];X.min<=me&&me<=X.max&&(F.state=e.MATCH,F.phraseLength=1)}},"opTRGBehind"),Pe=o(function(le,oe,F){let X,me=f[le];F.state=e.NOMATCH;let ye=me.string.length,we=oe-ye;if(we>=0){for(X=0;X<ye;X+=1)if(u[we+X]!==me.string[X])return;F.state=e.MATCH,F.phraseLength=ye}},"opTBSBehind"),Je=o(function(le,oe,F){let X,me=f[le];F.state=e.NOMATCH;let ye=me.string.length;if(ye===0){F.state=e.EMPTY;return}let we=oe-ye;if(we>=0){for(let Ie=0;Ie<ye;Ie+=1)if(X=u[we+Ie],X>=65&&X<=90&&(X+=32),X!==me.string[Ie])return;F.state=e.MATCH,F.phraseLength=ye}},"opTLSBehind"),gr=o(function(le,oe,F){let X,me,ye,we,Ie=f[le];F.state=e.NOMATCH,F.phraseLength=0,Ie.index<P.length?we=P[Ie.index].lower:we=J[Ie.index-P.length].lower;let Ot=Ie.bkrMode===e.BKR_MODE_PM?F.pFrame.getPhrase(we):F.uFrame.getPhrase(we),Fe=Ie.bkrCase===e.BKR_MODE_CI;if(Ot===null)return;let Ne=Ot.phraseIndex,Ut=Ot.phraseLength;if(Ut===0){F.state=e.EMPTY,F.phraseLength=0;return}let Ve=oe-Ut;if(Ve>=0){if(Fe){for(X=0;X<Ut;X+=1)if(me=u[Ve+X],ye=u[Ne+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}else for(X=0;X<Ut;X+=1)if(me=u[Ve+X],ye=u[Ne+X],me!==ye)return;F.state=e.MATCH,F.phraseLength=Ut}},"opBKRBehind");s=o(function(oe,F,X){let me=!0,ye=f[oe];if(I+=1,I>V)throw new Error(`parser: maximum number of node hits exceeded: ${V}`);if(O+=1,O>R&&(R=O,R>ne))throw new Error(`parser: maximum parse tree depth exceeded: ${ne}`);if(X.refresh(),i.trace!==null){let we=v();i.trace.down(ye,X.state,F,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(oe,F,X);break;case e.CAT:pe(oe,F,X);break;case e.REP:ke(oe,F,X);break;case e.RNM:se(oe,F,X);break;case e.UDT:z(oe,F,X);break;case e.AND:G(oe,F,X);break;case e.NOT:te(oe,F,X);break;case e.TRG:ze(oe,F,X);break;case e.TBS:Pe(oe,F,X);break;case e.TLS:Je(oe,F,X);break;case e.BKR:gr(oe,F,X);break;case e.BKA:ve(oe,F,X);break;case e.BKN:W(oe,F,X);break;case e.ABG:ie(oe,F,X);break;case e.AEN:Me(oe,F,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(oe,F,X);break;case e.CAT:fe(oe,F,X);break;case e.REP:D(oe,F,X);break;case e.RNM:se(oe,F,X);break;case e.UDT:z(oe,F,X);break;case e.AND:G(oe,F,X);break;case e.NOT:te(oe,F,X);break;case e.TRG:ae(oe,F,X);break;case e.TBS:Ae(oe,F,X);break;case e.TLS:ge(oe,F,X);break;case e.BKR:ue(oe,F,X);break;case e.BKA:ve(oe,F,X);break;case e.BKN:W(oe,F,X);break;case e.ABG:ie(oe,F,X);break;case e.AEN:Me(oe,F,X);break;default:me=!1;break}if(!g()&&F+X.phraseLength>Z&&(Z=F+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=v();i.trace.up(ye,X.state,F,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var j5=Re((SJ,q5)=>{q5.exports=o(function(){let e=Zi(),t=af(),n=ul(),i="stats.js: ",s=[],f=[],u=[],d,y=[],w=[];this.statsObject="statsObject";let A="stats",O=o(function(V,j){return V.lower<j.lower?-1:V.lower>j.lower?1:0},"sortAlpha"),R=o(function(V,j){return V.total<j.total?1:V.total>j.total?-1:O(V,j)},"sortHits"),I=o(function(V,j){return V.index<j.index?-1:V.index>j.index?1:0},"sortIndex"),B=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),Y=o(function(){u.length=0,d=new B,u[e.ALT]=new B,u[e.CAT]=new B,u[e.REP]=new B,u[e.RNM]=new B,u[e.TRG]=new B,u[e.TBS]=new B,u[e.TLS]=new B,u[e.UDT]=new B,u[e.AND]=new B,u[e.NOT]=new B,u[e.BKR]=new B,u[e.BKA]=new B,u[e.BKN]=new B,u[e.ABG]=new B,u[e.AEN]=new B,y.length=0;for(let V=0;V<s.length;V+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:s[V].name,lower:s[V].lower,index:s[V].index});if(f.length>0){w.length=0;for(let V=0;V<f.length;V+=1)w.push({empty:0,match:0,nomatch:0,total:0,name:f[V].name,lower:f[V].lower,index:f[V].index})}},"clear"),P=o(function(V,j){switch(V.total+=1,j){case e.EMPTY:V.empty+=1;break;case e.MATCH:V.match+=1;break;case e.NOMATCH:V.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${j}`)}},"incStat"),J=o(function(V,j){let H="";return H+="<tr>",H+=`<td class="${n.CLASS_ACTIVE}">${V}</td>`,H+=`<td class="${n.CLASS_EMPTY}">${j.empty}</td>`,H+=`<td class="${n.CLASS_MATCH}">${j.match}</td>`,H+=`<td class="${n.CLASS_NOMATCH}">${j.nomatch}</td>`,H+=`<td class="${n.CLASS_ACTIVE}">${j.total}</td>`,H+=`</tr>
292
292
  `,H},"displayRow"),ee=o(function(){let V="";return V+=J("ALT",u[e.ALT]),V+=J("CAT",u[e.CAT]),V+=J("REP",u[e.REP]),V+=J("RNM",u[e.RNM]),V+=J("TRG",u[e.TRG]),V+=J("TBS",u[e.TBS]),V+=J("TLS",u[e.TLS]),V+=J("UDT",u[e.UDT]),V+=J("AND",u[e.AND]),V+=J("NOT",u[e.NOT]),V+=J("BKR",u[e.BKR]),V+=J("BKA",u[e.BKA]),V+=J("BKN",u[e.BKN]),V+=J("ABG",u[e.ABG]),V+=J("AEN",u[e.AEN]),V+=J("totals",d),V},"displayOpsOnly"),Z=o(function(){let V="";V+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
293
293
  `,V+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
294
294
  `;for(let j=0;j<s.length;j+=1)y[j].total>0&&(V+="<tr>",V+=`<td class="${n.CLASS_ACTIVE}">${y[j].name}</td>`,V+=`<td class="${n.CLASS_EMPTY}">${y[j].empty}</td>`,V+=`<td class="${n.CLASS_MATCH}">${y[j].match}</td>`,V+=`<td class="${n.CLASS_NOMATCH}">${y[j].nomatch}</td>`,V+=`<td class="${n.CLASS_ACTIVE}">${y[j].total}</td>`,V+=`</tr>
@@ -303,7 +303,7 @@ table.apg-attrs a:hover {
303
303
  `,H+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
304
304
  `,H+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
305
305
  `;let he=!0;for(;he;){if(V===void 0){H+=ee();break}if(V===null){H+=ee();break}if(V==="ops"){H+=ee();break}if(V==="index"){y.sort(I),w.length>0&&w.sort(I),H+=ee(),H+=Z();break}if(V==="hits"){y.sort(R),w.length>0&&w.sort(I),H+=ee(),H+=Z();break}if(V==="alpha"){y.sort(O),w.length>0&&w.sort(O),H+=ee(),H+=Z();break}break}return H+=`</table>
306
- `,H},"toHtml"),this.toHtmlPage=o(function(V,j,H){return t.htmlToPage(this.toHtml(V,j),H)},"toHtmlPage")},"statsFunc")});var z5=Re((TJ,H5)=>{H5.exports=o(function(){let e=af(),t=ul(),n=new(Yb()),i=Zi(),s="trace.js: ",f=this,u=16,d=10,y=8,w=32,A=80,O=5,R=[],I=5e3,B=-1,Y=0,P=0,J=[],ee=null,Z=null,ne=null,V=[],j=[],H=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,he=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,L=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let q=o(function(G){V[i.ALT]=G,V[i.CAT]=G,V[i.REP]=G,V[i.TLS]=G,V[i.TBS]=G,V[i.TRG]=G,V[i.AND]=G,V[i.NOT]=G,V[i.BKR]=G,V[i.BKA]=G,V[i.BKN]=G,V[i.ABG]=G,V[i.AEN]=G},"setOperators"),z=0;for(let G in f.filter.operators)z+=1;if(z===0){q(!1);return}for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="<ALL>"){q(!0);return}if(te==="<NONE>"){q(!1);return}}q(!1);for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="ALT")V[i.ALT]=f.filter.operators[G]===!0;else if(te==="CAT")V[i.CAT]=f.filter.operators[G]===!0;else if(te==="REP")V[i.REP]=f.filter.operators[G]===!0;else if(te==="AND")V[i.AND]=f.filter.operators[G]===!0;else if(te==="NOT")V[i.NOT]=f.filter.operators[G]===!0;else if(te==="TLS")V[i.TLS]=f.filter.operators[G]===!0;else if(te==="TBS")V[i.TBS]=f.filter.operators[G]===!0;else if(te==="TRG")V[i.TRG]=f.filter.operators[G]===!0;else if(te==="BKR")V[i.BKR]=f.filter.operators[G]===!0;else if(te==="BKA")V[i.BKA]=f.filter.operators[G]===!0;else if(te==="BKN")V[i.BKN]=f.filter.operators[G]===!0;else if(te==="ABG")V[i.ABG]=f.filter.operators[G]===!0;else if(te==="AEN")V[i.AEN]=f.filter.operators[G]===!0;else throw new Error(`${s}initOpratorFilter: '${G}' 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 q=o(function(ae){V[i.RNM]=ae,V[i.UDT]=ae;let Ae=Z.length+ne.length;j.length=0;for(let ge=0;ge<Ae;ge+=1)j.push(ae)},"setRules"),z,G,te=[];for(G=0;G<Z.length;G+=1)te.push(Z[G].lower);for(G=0;G<ne.length;G+=1)te.push(ne[G].lower);j.length=0,z=0;for(let ae in f.filter.rules)z+=1;if(z===0){q(!0);return}for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){q(!0);return}if(Ae==="<none>"){q(!1);return}}q(!1),V[i.RNM]=!0,V[i.UDT]=!0;for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(G=te.indexOf(Ae),G<0)throw new Error(`${s}initRuleFilter: '${ae}' not a valid rule or udt name`);j[G]=f.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(q,z){if(B=-1,typeof q=="number"&&q>0)I=Math.ceil(q);else{I=0;return}typeof z=="number"&&(B=Math.floor(z),B<0&&(B=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return B},this.init=function(q,z,G){R.length=0,J.length=0,Y=0,P=0,ee=G,Z=q,ne=z,h(),v(),n.init(I)};let g=o(function(q){let z=!1;return q.type===i.RNM?V[q.type]&&j[q.index]?z=!0:z=!1:q.type===i.UDT?V[q.type]&&j[Z.length+q.index]?z=!0:z=!1:z=V[q.type],z},"filterOps"),l=o(function(q){return B===-1||q<=B},"filterRecords");this.down=function(q,z,G,te,ae,Ae){l(Y)&&g(q)&&(J.push(Y),R[n.increment()]={dirUp:!1,depth:P,thisLine:Y,thatLine:void 0,opcode:q,state:z,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1,P+=1)},this.up=function(q,z,G,te,ae,Ae){if(l(Y)&&g(q)){let ge=Y,ie=J.pop(),Me=n.getListIndex(ie);Me!==-1&&(R[Me].thatLine=ge),P-=1,R[n.increment()]={dirUp:!0,depth:P,thisLine:ge,thatLine:ie,opcode:q,state:z,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1}};let b=o(function(){function q(F,X){let me,ye,we;if(X)switch(F.op={id:X.type,name:e.opcodeToString(X.type)},F.opData=void 0,X.type){case i.RNM:F.opData=Z[X.index].name;break;case i.UDT:F.opData=ne[X.index].name;break;case i.BKR:X.index<Z.length?me=Z[X.index].name:me=ne[X.index-Z.length].name,ye=X.bkrCase===i.BKR_MODE_CI?"%i":"%s",we=X.bkrMode===i.BKR_MODE_UM?"%u":"%p",F.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:F.opData=[];for(let Ie=0;Ie<X.string.length;Ie+=1)F.opData.push(X.string[Ie]);break;case i.TBS:F.opData=[];for(let Ie=0;Ie<X.string.length;Ie+=1)F.opData.push(X.string[Ie]);break;case i.TRG:F.opData=[X.min,X.max];break;case i.REP:F.opData=[X.min,X.max];break;default:throw new Error("unrecognized opcode")}else F.op={id:void 0,name:void 0},F.opData=void 0}o(q,"nodeOpcode");function z(F,X,me){return F===i.MATCH?{index:X,length:me}:F===i.NOMATCH?{index:X,length:0}:F===i.EMPTY?{index:X,length:0}:null}o(z,"nodePhrase");let G=-1;function te(F,X,me){let ye={id:G++,branch:-1,parent:F,up:!1,down:!1,depth:me,children:[]};return X?(ye.down=!0,ye.state={id:X.state,name:e.stateToString(X.state)},ye.phrase=null,q(ye,X.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=z(),q(ye,void 0)),ye}o(te,"nodeDown");function ae(F,X){X&&(F.up=!0,F.state={id:X.state,name:e.stateToString(X.state)},F.phrase=z(X.state,X.phraseIndex,X.phraseLength),F.down||q(F,X.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,ie=1;function Me(F){if(ge+=1,F.branch=ie,ge>P&&(P=ge),F.children.length===0)Ae+=1;else for(let X=0;X<F.children.length;X+=1)X>0&&(ie+=1),F.children[X].leftMost=!1,F.children[X].rightMost=!1,F.leftMost&&(F.children[X].leftMost=X===0),F.rightMost&&(F.children[X].rightMost=X===F.children.length-1),Me(F.children[X]);ge-=1}o(Me,"walk");function ue(F,X){let me,ye={};if(ye.id=F.id,ye.branch=F.branch,ye.leftMost=F.leftMost,ye.rightMost=F.rightMost,me=F.state.name?F.state.name:"ACTIVE",ye.state={id:F.state.id,name:me},me=F.op.name?F.op.name:"?",ye.op={id:F.op.id,name:me},typeof F.opData=="string")ye.opData=F.opData;else if(Array.isArray(F.opData)){ye.opData=[];for(let we=0;we<F.opData.length;we+=1)ye.opData[we]=F.opData[we]}else ye.opData=void 0;F.phrase?ye.phrase={index:F.phrase.index,length:F.phrase.length}:ye.phrase=null,ye.depth=F.depth,ye.children=[];for(let we=0;we<F.children.length;we+=1){let Ie=we!==F.children.length-1;ye.children[we]=ue(F.children[we],X,Ie)}return ye}o(ue,"display");let ve=[],W,pe,ke,ze,Pe=!0,Je=te(null,null,-1);for(ve.push(Je),pe=Je,n.forEach(F=>{if(ze=R[F],Pe&&(Pe=!1,ze.depth>0)){let X=ze.dirUp?ze.depth+1:ze.depth;for(let me=0;me<X;me+=1)ke=pe,pe=te(pe,null,me),ve.push(pe),ke.children.push(pe)}ze.dirUp?(pe=ve.pop(),ae(pe,ze),pe=ve[ve.length-1]):(ke=pe,pe=te(pe,ze,ze.depth),ve.push(pe),ke.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(Je.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ve.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");W=Je.children[0];let gr=W;for(;W&&!W.down&&!W.up;)gr=W,W=W.children[0];W=gr,W.leftMost=!0,W.rightMost=!0,Me(W),W.branch=0;let le={};le.string=[];for(let F=0;F<ee.length;F+=1)le.string[F]=ee[F];le.rules=[];for(let F=0;F<Z.length;F+=1)le.rules[F]=Z[F].name;le.udts=[];for(let F=0;F<ne.length;F+=1)le.udts[F]=ne[F].name;le.id={},le.id.ALT={id:i.ALT,name:"ALT"},le.id.CAT={id:i.CAT,name:"CAT"},le.id.REP={id:i.REP,name:"REP"},le.id.RNM={id:i.RNM,name:"RNM"},le.id.TLS={id:i.TLS,name:"TLS"},le.id.TBS={id:i.TBS,name:"TBS"},le.id.TRG={id:i.TRG,name:"TRG"},le.id.UDT={id:i.UDT,name:"UDT"},le.id.AND={id:i.AND,name:"AND"},le.id.NOT={id:i.NOT,name:"NOT"},le.id.BKR={id:i.BKR,name:"BKR"},le.id.BKA={id:i.BKA,name:"BKA"},le.id.BKN={id:i.BKN,name:"BKN"},le.id.ABG={id:i.ABG,name:"ABG"},le.id.AEN={id:i.AEN,name:"AEN"},le.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},le.id.MATCH={id:i.MATCH,name:"MATCH"},le.id.EMPTY={id:i.EMPTY,name:"EMPTY"},le.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},le.treeDepth=P,le.leafNodes=Ae;let oe;return W.down?W.up?oe="none":oe="right":W.up?oe="left":oe="both",le.branchesIncomplete=oe,le.tree=ue(W,W.depth,!1),le},"toTreeObj");this.toTree=function(q){let z=b();return q?JSON.stringify(z):z},this.toHtmlPage=function(q,z,G){return e.htmlToPage(this.toHtml(q,z),G)};let E=o(function(q,z){let G;switch(q){case u:G="hexadecimal";break;case d:G="decimal";break;case y:G="ASCII";break;case w:G="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${q}`)}let te="";return te+=`<p>display mode: ${G}</p>
306
+ `,H},"toHtml"),this.toHtmlPage=o(function(V,j,H){return t.htmlToPage(this.toHtml(V,j),H)},"toHtmlPage")},"statsFunc")});var z5=Re((MJ,H5)=>{H5.exports=o(function(){let e=af(),t=ul(),n=new(Yb()),i=Zi(),s="trace.js: ",f=this,u=16,d=10,y=8,w=32,A=80,O=5,R=[],I=5e3,B=-1,Y=0,P=0,J=[],ee=null,Z=null,ne=null,V=[],j=[],H=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,he=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,L=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,h=o(function(){let q=o(function(G){V[i.ALT]=G,V[i.CAT]=G,V[i.REP]=G,V[i.TLS]=G,V[i.TBS]=G,V[i.TRG]=G,V[i.AND]=G,V[i.NOT]=G,V[i.BKR]=G,V[i.BKA]=G,V[i.BKN]=G,V[i.ABG]=G,V[i.AEN]=G},"setOperators"),z=0;for(let G in f.filter.operators)z+=1;if(z===0){q(!1);return}for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="<ALL>"){q(!0);return}if(te==="<NONE>"){q(!1);return}}q(!1);for(let G in f.filter.operators){let te=G.toUpperCase();if(te==="ALT")V[i.ALT]=f.filter.operators[G]===!0;else if(te==="CAT")V[i.CAT]=f.filter.operators[G]===!0;else if(te==="REP")V[i.REP]=f.filter.operators[G]===!0;else if(te==="AND")V[i.AND]=f.filter.operators[G]===!0;else if(te==="NOT")V[i.NOT]=f.filter.operators[G]===!0;else if(te==="TLS")V[i.TLS]=f.filter.operators[G]===!0;else if(te==="TBS")V[i.TBS]=f.filter.operators[G]===!0;else if(te==="TRG")V[i.TRG]=f.filter.operators[G]===!0;else if(te==="BKR")V[i.BKR]=f.filter.operators[G]===!0;else if(te==="BKA")V[i.BKA]=f.filter.operators[G]===!0;else if(te==="BKN")V[i.BKN]=f.filter.operators[G]===!0;else if(te==="ABG")V[i.ABG]=f.filter.operators[G]===!0;else if(te==="AEN")V[i.AEN]=f.filter.operators[G]===!0;else throw new Error(`${s}initOpratorFilter: '${G}' 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 q=o(function(ae){V[i.RNM]=ae,V[i.UDT]=ae;let Ae=Z.length+ne.length;j.length=0;for(let ge=0;ge<Ae;ge+=1)j.push(ae)},"setRules"),z,G,te=[];for(G=0;G<Z.length;G+=1)te.push(Z[G].lower);for(G=0;G<ne.length;G+=1)te.push(ne[G].lower);j.length=0,z=0;for(let ae in f.filter.rules)z+=1;if(z===0){q(!0);return}for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){q(!0);return}if(Ae==="<none>"){q(!1);return}}q(!1),V[i.RNM]=!0,V[i.UDT]=!0;for(let ae in f.filter.rules){let Ae=ae.toLowerCase();if(G=te.indexOf(Ae),G<0)throw new Error(`${s}initRuleFilter: '${ae}' not a valid rule or udt name`);j[G]=f.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(q,z){if(B=-1,typeof q=="number"&&q>0)I=Math.ceil(q);else{I=0;return}typeof z=="number"&&(B=Math.floor(z),B<0&&(B=-1))},this.getMaxRecords=function(){return I},this.getLastRecord=function(){return B},this.init=function(q,z,G){R.length=0,J.length=0,Y=0,P=0,ee=G,Z=q,ne=z,h(),v(),n.init(I)};let g=o(function(q){let z=!1;return q.type===i.RNM?V[q.type]&&j[q.index]?z=!0:z=!1:q.type===i.UDT?V[q.type]&&j[Z.length+q.index]?z=!0:z=!1:z=V[q.type],z},"filterOps"),l=o(function(q){return B===-1||q<=B},"filterRecords");this.down=function(q,z,G,te,ae,Ae){l(Y)&&g(q)&&(J.push(Y),R[n.increment()]={dirUp:!1,depth:P,thisLine:Y,thatLine:void 0,opcode:q,state:z,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1,P+=1)},this.up=function(q,z,G,te,ae,Ae){if(l(Y)&&g(q)){let ge=Y,ie=J.pop(),Me=n.getListIndex(ie);Me!==-1&&(R[Me].thatLine=ge),P-=1,R[n.increment()]={dirUp:!0,depth:P,thisLine:ge,thatLine:ie,opcode:q,state:z,phraseIndex:G,phraseLength:te,lookAnchor:ae,lookAround:Ae},Y+=1}};let b=o(function(){function q(F,X){let me,ye,we;if(X)switch(F.op={id:X.type,name:e.opcodeToString(X.type)},F.opData=void 0,X.type){case i.RNM:F.opData=Z[X.index].name;break;case i.UDT:F.opData=ne[X.index].name;break;case i.BKR:X.index<Z.length?me=Z[X.index].name:me=ne[X.index-Z.length].name,ye=X.bkrCase===i.BKR_MODE_CI?"%i":"%s",we=X.bkrMode===i.BKR_MODE_UM?"%u":"%p",F.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:F.opData=[];for(let Ie=0;Ie<X.string.length;Ie+=1)F.opData.push(X.string[Ie]);break;case i.TBS:F.opData=[];for(let Ie=0;Ie<X.string.length;Ie+=1)F.opData.push(X.string[Ie]);break;case i.TRG:F.opData=[X.min,X.max];break;case i.REP:F.opData=[X.min,X.max];break;default:throw new Error("unrecognized opcode")}else F.op={id:void 0,name:void 0},F.opData=void 0}o(q,"nodeOpcode");function z(F,X,me){return F===i.MATCH?{index:X,length:me}:F===i.NOMATCH?{index:X,length:0}:F===i.EMPTY?{index:X,length:0}:null}o(z,"nodePhrase");let G=-1;function te(F,X,me){let ye={id:G++,branch:-1,parent:F,up:!1,down:!1,depth:me,children:[]};return X?(ye.down=!0,ye.state={id:X.state,name:e.stateToString(X.state)},ye.phrase=null,q(ye,X.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=z(),q(ye,void 0)),ye}o(te,"nodeDown");function ae(F,X){X&&(F.up=!0,F.state={id:X.state,name:e.stateToString(X.state)},F.phrase=z(X.state,X.phraseIndex,X.phraseLength),F.down||q(F,X.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,ie=1;function Me(F){if(ge+=1,F.branch=ie,ge>P&&(P=ge),F.children.length===0)Ae+=1;else for(let X=0;X<F.children.length;X+=1)X>0&&(ie+=1),F.children[X].leftMost=!1,F.children[X].rightMost=!1,F.leftMost&&(F.children[X].leftMost=X===0),F.rightMost&&(F.children[X].rightMost=X===F.children.length-1),Me(F.children[X]);ge-=1}o(Me,"walk");function ue(F,X){let me,ye={};if(ye.id=F.id,ye.branch=F.branch,ye.leftMost=F.leftMost,ye.rightMost=F.rightMost,me=F.state.name?F.state.name:"ACTIVE",ye.state={id:F.state.id,name:me},me=F.op.name?F.op.name:"?",ye.op={id:F.op.id,name:me},typeof F.opData=="string")ye.opData=F.opData;else if(Array.isArray(F.opData)){ye.opData=[];for(let we=0;we<F.opData.length;we+=1)ye.opData[we]=F.opData[we]}else ye.opData=void 0;F.phrase?ye.phrase={index:F.phrase.index,length:F.phrase.length}:ye.phrase=null,ye.depth=F.depth,ye.children=[];for(let we=0;we<F.children.length;we+=1){let Ie=we!==F.children.length-1;ye.children[we]=ue(F.children[we],X,Ie)}return ye}o(ue,"display");let ve=[],W,pe,ke,ze,Pe=!0,Je=te(null,null,-1);for(ve.push(Je),pe=Je,n.forEach(F=>{if(ze=R[F],Pe&&(Pe=!1,ze.depth>0)){let X=ze.dirUp?ze.depth+1:ze.depth;for(let me=0;me<X;me+=1)ke=pe,pe=te(pe,null,me),ve.push(pe),ke.children.push(pe)}ze.dirUp?(pe=ve.pop(),ae(pe,ze),pe=ve[ve.length-1]):(ke=pe,pe=te(pe,ze,ze.depth),ve.push(pe),ke.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(Je.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ve.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");W=Je.children[0];let gr=W;for(;W&&!W.down&&!W.up;)gr=W,W=W.children[0];W=gr,W.leftMost=!0,W.rightMost=!0,Me(W),W.branch=0;let le={};le.string=[];for(let F=0;F<ee.length;F+=1)le.string[F]=ee[F];le.rules=[];for(let F=0;F<Z.length;F+=1)le.rules[F]=Z[F].name;le.udts=[];for(let F=0;F<ne.length;F+=1)le.udts[F]=ne[F].name;le.id={},le.id.ALT={id:i.ALT,name:"ALT"},le.id.CAT={id:i.CAT,name:"CAT"},le.id.REP={id:i.REP,name:"REP"},le.id.RNM={id:i.RNM,name:"RNM"},le.id.TLS={id:i.TLS,name:"TLS"},le.id.TBS={id:i.TBS,name:"TBS"},le.id.TRG={id:i.TRG,name:"TRG"},le.id.UDT={id:i.UDT,name:"UDT"},le.id.AND={id:i.AND,name:"AND"},le.id.NOT={id:i.NOT,name:"NOT"},le.id.BKR={id:i.BKR,name:"BKR"},le.id.BKA={id:i.BKA,name:"BKA"},le.id.BKN={id:i.BKN,name:"BKN"},le.id.ABG={id:i.ABG,name:"ABG"},le.id.AEN={id:i.AEN,name:"AEN"},le.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},le.id.MATCH={id:i.MATCH,name:"MATCH"},le.id.EMPTY={id:i.EMPTY,name:"EMPTY"},le.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},le.treeDepth=P,le.leafNodes=Ae;let oe;return W.down?W.up?oe="none":oe="right":W.up?oe="left":oe="both",le.branchesIncomplete=oe,le.tree=ue(W,W.depth,!1),le},"toTreeObj");this.toTree=function(q){let z=b();return q?JSON.stringify(z):z},this.toHtmlPage=function(q,z,G){return e.htmlToPage(this.toHtml(q,z),G)};let E=o(function(q,z){let G;switch(q){case u:G="hexadecimal";break;case d:G="decimal";break;case y:G="ASCII";break;case w:G="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${q}`)}let te="";return te+=`<p>display mode: ${G}</p>
307
307
  `,te+=`<table class="${t.CLASS_TRACE}">
308
308
  `,typeof z=="string"&&(te+=`<caption>${z}</caption>`),te},"htmlHeader"),M=o(function(){let q="";return q+=`</table>
309
309
  `,q+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
@@ -352,7 +352,7 @@ table.apg-attrs a:hover {
352
352
  `,n.forEach(Me=>{let ue=R[Me];switch(G=ue.thisLine,te=ue.thatLine!==void 0?ue.thatLine:"--",ae=!1,Ae=!1,ge=!1,ue.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,ie=ue.lookAnchor),(ue.opcode.type===i.AND||ue.opcode.type===i.NOT)&&(ae=!0,ge=!0,ie=ue.phraseIndex),ue.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,ie=ue.lookAnchor),(ue.opcode.type===i.BKA||ue.opcode.type===i.BKN)&&(Ae=!0,ge=!0,ie=ue.phraseIndex),z+="<tr>",z+=`<td>${G}</td><td>${te}</td>`,z+=`<td>${ue.phraseIndex}</td>`,z+=`<td>${ue.phraseLength}</td>`,z+=`<td>${ue.depth}</td>`,z+="<td>",ue.state){case i.ACTIVE:z+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:z+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:z+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:z+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:z+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(z+="</td>",z+="<td>",z+=f.indent(ue.depth),ae?z+=`<span class="${t.CLASS_LOOKAHEAD}">`:Ae&&(z+=`<span class="${t.CLASS_LOOKBEHIND}">`),z+=e.opcodeToString(ue.opcode.type),ue.opcode.type===i.RNM&&(z+=`(${Z[ue.opcode.index].name}) `),ue.opcode.type===i.BKR){let ve=ue.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",W=ue.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";z+=`(\\${ve}${W}${Z[ue.opcode.index].name}) `}ue.opcode.type===i.UDT&&(z+=`(${ne[ue.opcode.index].name}) `),ue.opcode.type===i.TRG&&(z+=`(${S(q,ue.opcode)}) `),ue.opcode.type===i.TBS&&(z+=`(${C(q,ue.opcode)}) `),ue.opcode.type===i.TLS&&(z+=`(${N(q,ue.opcode)}) `),ue.opcode.type===i.REP&&(z+=`(${x(q,ue.opcode)}) `),ge&&(z+="</span>"),z+="</td>",z+="<td>",Ae?z+=k(q,ee,ue.state,ue.phraseIndex,ue.phraseLength,ie):ae?z+=D(q,ee,ue.state,ue.phraseIndex,ue.phraseLength):z+=Q(q,ee,ue.state,ue.phraseIndex,ue.phraseLength),z+=`</td></tr>
353
353
  `}),z+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",z+=`<th>operator</th><th>phrase</th></tr>
354
354
  `,z+=`</table>
355
- `,z},"htmlTable");this.toHtml=function(q,z){let G=y;if(typeof q=="string"&&q.length>=3){let ae=q.toLowerCase().slice(0,3);ae==="hex"?G=u:ae==="dec"?G=d:ae==="uni"&&(G=w)}let te="";return te+=E(G,z),te+=se(G),te+=M(),te}},"exportTrace")});var ff=Re((CJ,K5)=>{K5.exports={ast:L5(),circular:Yb(),ids:Zi(),parser:$5(),stats:j5(),trace:z5(),utils:af(),emitcss:Wb(),style:ul()}});var G5=Re((kJ,V5)=>{V5.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]
355
+ `,z},"htmlTable");this.toHtml=function(q,z){let G=y;if(typeof q=="string"&&q.length>=3){let ae=q.toLowerCase().slice(0,3);ae==="hex"?G=u:ae==="dec"?G=d:ae==="uni"&&(G=w)}let te="";return te+=E(G,z),te+=se(G),te+=M(),te}},"exportTrace")});var ff=Re((TJ,K5)=>{K5.exports={ast:L5(),circular:Yb(),ids:Zi(),parser:$5(),stats:j5(),trace:z5(),utils:af(),emitcss:Wb(),style:ul()}});var G5=Re((CJ,V5)=>{V5.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]
356
356
  `,t+=`line = line-text end
357
357
  `,t+=`line-text = *(valid/invalid)
358
358
  `,t+=`last-line = 1*(valid/invalid)
@@ -362,7 +362,7 @@ table.apg-attrs a:hover {
362
362
  `,t+=`CRLF = %d13.10
363
363
  `,t+=`LF = %d10
364
364
  `,t+=`CR = %d13
365
- `,t},"toString")},"grammar")});var J5=Re(W5=>{var en=Zi(),aU=af();function fU(r,e,t,n,i){return r===en.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}),en.SEM_OK}o(fU,"semLine");function cU(r,e,t,n,i){return r===en.SEM_PRE&&(i.textLength=n),en.SEM_OK}o(cU,"semLineText");function uU(r,e,t,n,i){return r===en.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})),en.SEM_OK}o(uU,"semLastLine");function lU(r,e,t,n,i){return r===en.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${aU.charToHex(e[t])}'`}),en.SEM_OK}o(lU,"semInvalid");function hU(r,e,t,n,i){return r===en.SEM_POST&&(i.lineNo+=1),en.SEM_OK}o(hU,"semEnd");function dU(r,e,t,n,i){return r===en.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)"})),en.SEM_OK}o(dU,"semLF");function pU(r,e,t,n,i){return r===en.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)"})),en.SEM_OK}o(pU,"semCR");function mU(r,e,t,n,i){return r===en.SEM_PRE&&(i.endType="CRLF"),en.SEM_OK}o(mU,"semCRLF");var ms=[];ms.line=fU;ms["line-text"]=cU;ms["last-line"]=uU;ms.invalid=lU;ms.end=hU;ms.lf=dU;ms.cr=pU;ms.crlf=mU;W5.callbacks=ms});var Z5=Re((DJ,Y5)=>{Y5.exports=o(function(e,t,n,i){let s="scanner.js: ",f=ff(),u=new(G5()),{callbacks:d}=J5(),y=[],w=new f.parser;if(w.ast=new f.ast,w.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);w.trace=i}if(w.parse(u,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:y,lineNo:0,errors:t,strict:!!n};return w.ast.translate(O),y},"exfn")});var Q5=Re((RJ,X5)=>{X5.exports=o(function(){let e="syntax-callbacks.js: ",t=ff(),n=t.ids,i,s=o(function(N,_,k,fe){switch(N.state){case n.ACTIVE:fe.altStack=[],fe.repCount=0;break;case n.EMPTY:fe.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:fe.ruleCount===0&&fe.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"),f=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:k.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),u=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),d=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),y=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),w=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),A=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),O=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),I=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),B=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"End of string anchor(%$) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),Y=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,_,C.phraseLength);k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`Back reference operator(${fe}) found - strict ABNF specified.`})}else if(k.lite){let fe=t.utils.charsToString(N,_,C.phraseLength);k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`Back reference operator(${fe}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),P=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,_,C.phraseLength);k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`UDT operator found(${fe}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),J=o(function(C,N,_){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),ee=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.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"),Z=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),ne=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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"),V=o(function(C,N,_){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),j=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),H=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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:k.strict&&k.errors.push({line:k.findLine(k.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"),he=o(function(C,N,_){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),L=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),h=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:k.errors.push({line:k.findLine(k.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(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:_,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),g=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=k.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),l=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:_,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),b=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=k.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),E=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),M=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(C.phraseLength===1&&k.strict){let fe=N[_]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`Line end '${fe}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),S=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),x=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.repCount+=1;break;case n.MATCH:k.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=w,this.callbacks.basicelementerr=E,this.callbacks.clsclose=H,this.callbacks.clsopen=V,this.callbacks.clsstring=j,this.callbacks.definedaserror=y,this.callbacks.file=s,this.callbacks.groupclose=g,this.callbacks.groupopen=v,this.callbacks.lineenderror=S,this.callbacks.lineend=M,this.callbacks.notop=A,this.callbacks.optionclose=b,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=he,this.callbacks.prosvalstring=L,this.callbacks.repetition=x,this.callbacks.rule=f,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=Z,this.callbacks.tlsclose=ne,this.callbacks.tlsopen=J,this.callbacks.tlsstring=ee,this.callbacks.udtop=P,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=Y,this.callbacks.abgop=I,this.callbacks.aenop=B},"exfn")});var t8=Re((OJ,e8)=>{e8.exports=o(function(){let e=ff(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(ue){let ve=-1;return this.get(ue)===-1&&(ve={name:ue,lower:ue.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ue){let ve=-1,W=ue.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===W){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=10*W+Me[pe]-48;return W},"decnum"),s=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=2*W+Me[pe]-48;return W},"binnum"),f=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1){let ke=Me[pe];if(ke>=48&&ke<=57)ke-=48;else if(ke>=65&&ke<=70)ke-=55;else if(ke>=97&&ke<=102)ke-=87;else throw new Error("hexnum out of range");W=16*W+ke}return W},"hexnum");function u(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)W.ruleNames=new n,W.udtNames=new n,W.rules=[],W.udts=[],W.rulesLineMap=[],W.opcodes=[],W.altStack=[],W.topStack=null,W.topRule=null;else if(ie===t.SEM_POST){let ke;W.rules.forEach(ze=>{ze.isBkr=!1,ze.opcodes.forEach(Pe=>{Pe.type===t.RNM&&(ke=W.ruleNames.get(Pe.index.name),ke===-1?(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Rule name '${Pe.index.name}' used but not defined.`}),Pe.index=-1):Pe.index=ke.index)})}),W.udts.forEach(ze=>{ze.isBkr=!1}),W.rules.forEach(ze=>{ze.opcodes.forEach(Pe=>{Pe.type===t.BKR&&(ze.hasBkr=!0,ke=W.ruleNames.get(Pe.index.name),ke!==-1?(W.rules[ke.index].isBkr=!0,Pe.index=ke.index):(ke=W.udtNames.get(Pe.index.name),ke!==-1?(W.udts[ke.index].isBkr=!0,Pe.index=W.rules.length+ke.index):(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Back reference name '${Pe.index.name}' refers to undefined rule or unamed UDT.`}),Pe.index=-1)))})})}return pe}o(u,"semFile");function d(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.altStack.length=0,W.topStack=null,W.rulesLineMap.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue})),pe}o(d,"semRule");function y(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)W.ruleName="",W.definedas="";else if(ie===t.SEM_POST){let ke;W.definedas==="="?(ke=W.ruleNames.add(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' previously defined.`})):(W.topRule={name:ke.name,lower:ke.lower,opcodes:[],index:ke.index},W.rules.push(W.topRule),W.opcodes=W.topRule.opcodes)):(ke=W.ruleNames.get(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' for incremental alternate not previously defined.`})):(W.topRule=W.rules[ke.index],W.opcodes=W.topRule.opcodes))}return pe}o(y,"semRuleLookup");function w(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)for(;;){if(W.definedas===null){pe=t.SEM_SKIP;break}if(W.topStack===null){if(W.definedas==="="){W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}W.topStack={alt:W.opcodes[0],cat:null},W.altStack.push(W.topStack);break}W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}else ie===t.SEM_POST&&(W.altStack.pop(),W.altStack.length>0?W.topStack=W.altStack[W.altStack.length-1]:W.topStack=null);return pe}o(w,"semAlternation");function A(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.topStack.alt.children.push(W.opcodes.length),W.topStack.cat={type:t.CAT,children:[]},W.opcodes.push(W.topStack.cat)):ie===t.SEM_POST&&(W.topStack.cat=null),pe}o(A,"semConcatenation");function O(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&W.topStack.cat.children.push(W.opcodes.length),pe}o(O,"semRepetition");function R(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.REP,min:0,max:1,char:ue}),pe}o(R,"semOptionOpen");function I(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.ruleName=e.utils.charsToString(Me,ue,ve)),pe}o(I,"semRuleName");function B(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="="),pe}o(B,"semDefined");function Y(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="=/"),pe}o(Y,"semIncAlt");function P(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.min=0,W.max=1/0,W.topRep={type:t.REP,min:0,max:1/0},W.opcodes.push(W.topRep)):ie===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`repetition min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.topRep.min=W.min,W.topRep.max=W.max),pe}o(P,"semRepOp");function J(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(J,"semRepMin");function ee(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(ee,"semRepMax");function Z(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve),W.min=W.max),pe}o(Z,"semRepMinMax");function ne(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AND}),pe}o(ne,"semAndOp");function V(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.NOT}),pe}o(V,"semNotOp");function j(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.RNM,index:{phraseIndex:ue,name:e.utils.charsToString(Me,ue,ve)}}),pe}o(j,"semRnmOp");function H(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.ABG}),pe}o(H,"semAbgOp");function he(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AEN}),pe}o(he,"semAenOp");function L(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKA}),pe}o(L,"semBkaOp");function h(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKN}),pe}o(h,"semBknOp");function v(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.ci=!0,W.cs=!1,W.um=!0,W.pm=!1):ie===t.SEM_POST&&W.opcodes.push({type:t.BKR,bkrCase:W.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:W.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:W.bkrname.phraseIndex,name:e.utils.charsToString(Me,W.bkrname.phraseIndex,W.bkrname.phraseLength)}}),pe}o(v,"semBkrOp");function g(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.ci=!0),pe}o(g,"semBkrCi");function l(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.cs=!0),pe}o(l,"semBkrCs");function b(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.um=!0),pe}o(b,"semBkrUm");function E(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.pm=!0),pe}o(E,"semBkrPm");function M(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.bkrname={phraseIndex:ue,phraseLength:ve}),pe}o(M,"semBkrName");function S(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!0});W.opcodes.push({type:t.UDT,empty:!0,index:ze.index})}return pe}o(S,"semUdtEmpty");function x(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtNonEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!1});W.opcodes.push({type:t.UDT,empty:!1,index:ze.index,syntax:null,semantic:null})}return pe}o(x,"semUdtNonEmpty");function C(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.tlscase=!0),pe}o(C,"semTlsOp");function N(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&ve>0&&(Me[ue+1]===83||Me[ue+1]===115)&&(W.tlscase=!1),pe}o(N,"semTlsCase");function _(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST)if(W.tlscase){let ke=Me.slice(ue,ue+ve);for(let ze=0;ze<ke.length;ze+=1)ke[ze]>=65&&ke[ze]<=90&&(ke[ze]+=32);W.opcodes.push({type:t.TLS,string:ke})}else W.opcodes.push({type:t.TBS,string:Me.slice(ue,ue+ve)});return pe}o(_,"semTlsString");function k(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(ve<=2?W.opcodes.push({type:t.TLS,string:[]}):W.opcodes.push({type:t.TBS,string:Me.slice(ue+1,ue+ve-1)})),pe}o(k,"semClsOp");function fe(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?W.tbsstr=[]:ie===t.SEM_POST&&W.opcodes.push({type:t.TBS,string:W.tbsstr}),pe}o(fe,"semTbsOp");function D(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.min=0,W.max=0):ie===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.opcodes.push({type:t.TRG,min:W.min,max:W.max})),pe}o(D,"semTrgOp");function Q(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(Q,"semDmin");function se(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(se,"semDmax");function q(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=s(Me,ue,ve)),pe}o(q,"semBmin");function z(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=s(Me,ue,ve)),pe}o(z,"semBmax");function G(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=f(Me,ue,ve)),pe}o(G,"semXmin");function te(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=f(Me,ue,ve)),pe}o(te,"semXmax");function ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(i(Me,ue,ve)),pe}o(ae,"semDstring");function Ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(s(Me,ue,ve)),pe}o(Ae,"semBstring");function ge(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(f(Me,ue,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=H,this.callbacks.aenop=he,this.callbacks.alternation=w,this.callbacks.andop=ne,this.callbacks.bmax=z,this.callbacks.bmin=q,this.callbacks.bkaop=L,this.callbacks.bknop=h,this.callbacks.bkrop=v,this.callbacks["bkr-name"]=M,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=g,this.callbacks.cs=l,this.callbacks.um=b,this.callbacks.pm=E,this.callbacks.concatenation=A,this.callbacks.defined=B,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=Y,this.callbacks.notop=V,this.callbacks.optionopen=R,this.callbacks["rep-max"]=ee,this.callbacks["rep-min"]=J,this.callbacks["rep-min-max"]=Z,this.callbacks.repetition=O,this.callbacks.repop=P,this.callbacks.rnmop=j,this.callbacks.rule=d,this.callbacks.rulelookup=y,this.callbacks.rulename=I,this.callbacks.tbsop=fe,this.callbacks.tlscase=N,this.callbacks.tlsstring=_,this.callbacks.tlsop=C,this.callbacks.trgop=D,this.callbacks["udt-empty"]=S,this.callbacks["udt-non-empty"]=x,this.callbacks.xmax=te,this.callbacks.xmin=G,this.callbacks.xstring=ge},"exfn")});var n8=Re((NJ,r8)=>{r8.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+=`;
365
+ `,t},"toString")},"grammar")});var J5=Re(W5=>{var en=Zi(),aU=af();function fU(r,e,t,n,i){return r===en.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}),en.SEM_OK}o(fU,"semLine");function cU(r,e,t,n,i){return r===en.SEM_PRE&&(i.textLength=n),en.SEM_OK}o(cU,"semLineText");function uU(r,e,t,n,i){return r===en.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})),en.SEM_OK}o(uU,"semLastLine");function lU(r,e,t,n,i){return r===en.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${aU.charToHex(e[t])}'`}),en.SEM_OK}o(lU,"semInvalid");function hU(r,e,t,n,i){return r===en.SEM_POST&&(i.lineNo+=1),en.SEM_OK}o(hU,"semEnd");function dU(r,e,t,n,i){return r===en.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)"})),en.SEM_OK}o(dU,"semLF");function pU(r,e,t,n,i){return r===en.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)"})),en.SEM_OK}o(pU,"semCR");function mU(r,e,t,n,i){return r===en.SEM_PRE&&(i.endType="CRLF"),en.SEM_OK}o(mU,"semCRLF");var ms=[];ms.line=fU;ms["line-text"]=cU;ms["last-line"]=uU;ms.invalid=lU;ms.end=hU;ms.lf=dU;ms.cr=pU;ms.crlf=mU;W5.callbacks=ms});var Z5=Re((IJ,Y5)=>{Y5.exports=o(function(e,t,n,i){let s="scanner.js: ",f=ff(),u=new(G5()),{callbacks:d}=J5(),y=[],w=new f.parser;if(w.ast=new f.ast,w.ast.callbacks=d,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);w.trace=i}if(w.parse(u,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:y,lineNo:0,errors:t,strict:!!n};return w.ast.translate(O),y},"exfn")});var Q5=Re((DJ,X5)=>{X5.exports=o(function(){let e="syntax-callbacks.js: ",t=ff(),n=t.ids,i,s=o(function(N,_,k,fe){switch(N.state){case n.ACTIVE:fe.altStack=[],fe.repCount=0;break;case n.EMPTY:fe.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:fe.ruleCount===0&&fe.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"),f=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:k.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),u=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),d=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),y=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),w=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),A=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),O=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),I=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),B=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.strict?k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"End of string anchor(%$) found - strict ABNF specified."}):k.lite&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),Y=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,_,C.phraseLength);k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`Back reference operator(${fe}) found - strict ABNF specified.`})}else if(k.lite){let fe=t.utils.charsToString(N,_,C.phraseLength);k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`Back reference operator(${fe}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),P=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let fe=t.utils.charsToString(N,_,C.phraseLength);k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`UDT operator found(${fe}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),J=o(function(C,N,_){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),ee=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.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"),Z=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),ne=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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"),V=o(function(C,N,_){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),j=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),H=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.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:k.strict&&k.errors.push({line:k.findLine(k.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"),he=o(function(C,N,_){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=_;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),L=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:k.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar!==!1&&k.errors.push({line:k.findLine(k.lines,k.stringTabChar),char:k.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),h=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:k.errors.push({line:k.findLine(k.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(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:_,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),g=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=k.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),l=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:_,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),b=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.errors.push({line:k.findLine(k.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=k.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=k.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),E=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),M=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(C.phraseLength===1&&k.strict){let fe=N[_]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:`Line end '${fe}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),S=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.errors.push({line:k.findLine(k.lines,_,k.charsLength),char:_,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),x=o(function(C,N,_,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:k.repCount+=1;break;case n.MATCH:k.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=w,this.callbacks.basicelementerr=E,this.callbacks.clsclose=H,this.callbacks.clsopen=V,this.callbacks.clsstring=j,this.callbacks.definedaserror=y,this.callbacks.file=s,this.callbacks.groupclose=g,this.callbacks.groupopen=v,this.callbacks.lineenderror=S,this.callbacks.lineend=M,this.callbacks.notop=A,this.callbacks.optionclose=b,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=he,this.callbacks.prosvalstring=L,this.callbacks.repetition=x,this.callbacks.rule=f,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=d,this.callbacks.stringtab=Z,this.callbacks.tlsclose=ne,this.callbacks.tlsopen=J,this.callbacks.tlsstring=ee,this.callbacks.udtop=P,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=Y,this.callbacks.abgop=I,this.callbacks.aenop=B},"exfn")});var t8=Re((RJ,e8)=>{e8.exports=o(function(){let e=ff(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(ue){let ve=-1;return this.get(ue)===-1&&(ve={name:ue,lower:ue.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ue){let ve=-1,W=ue.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===W){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=10*W+Me[pe]-48;return W},"decnum"),s=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1)W=2*W+Me[pe]-48;return W},"binnum"),f=o(function(Me,ue,ve){let W=0;for(let pe=ue;pe<ue+ve;pe+=1){let ke=Me[pe];if(ke>=48&&ke<=57)ke-=48;else if(ke>=65&&ke<=70)ke-=55;else if(ke>=97&&ke<=102)ke-=87;else throw new Error("hexnum out of range");W=16*W+ke}return W},"hexnum");function u(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)W.ruleNames=new n,W.udtNames=new n,W.rules=[],W.udts=[],W.rulesLineMap=[],W.opcodes=[],W.altStack=[],W.topStack=null,W.topRule=null;else if(ie===t.SEM_POST){let ke;W.rules.forEach(ze=>{ze.isBkr=!1,ze.opcodes.forEach(Pe=>{Pe.type===t.RNM&&(ke=W.ruleNames.get(Pe.index.name),ke===-1?(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Rule name '${Pe.index.name}' used but not defined.`}),Pe.index=-1):Pe.index=ke.index)})}),W.udts.forEach(ze=>{ze.isBkr=!1}),W.rules.forEach(ze=>{ze.opcodes.forEach(Pe=>{Pe.type===t.BKR&&(ze.hasBkr=!0,ke=W.ruleNames.get(Pe.index.name),ke!==-1?(W.rules[ke.index].isBkr=!0,Pe.index=ke.index):(ke=W.udtNames.get(Pe.index.name),ke!==-1?(W.udts[ke.index].isBkr=!0,Pe.index=W.rules.length+ke.index):(W.errors.push({line:W.findLine(W.lines,Pe.index.phraseIndex,W.charsLength),char:Pe.index.phraseIndex,msg:`Back reference name '${Pe.index.name}' refers to undefined rule or unamed UDT.`}),Pe.index=-1)))})})}return pe}o(u,"semFile");function d(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.altStack.length=0,W.topStack=null,W.rulesLineMap.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue})),pe}o(d,"semRule");function y(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)W.ruleName="",W.definedas="";else if(ie===t.SEM_POST){let ke;W.definedas==="="?(ke=W.ruleNames.add(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' previously defined.`})):(W.topRule={name:ke.name,lower:ke.lower,opcodes:[],index:ke.index},W.rules.push(W.topRule),W.opcodes=W.topRule.opcodes)):(ke=W.ruleNames.get(W.ruleName),ke===-1?(W.definedas=null,W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`Rule name '${W.ruleName}' for incremental alternate not previously defined.`})):(W.topRule=W.rules[ke.index],W.opcodes=W.topRule.opcodes))}return pe}o(y,"semRuleLookup");function w(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_PRE)for(;;){if(W.definedas===null){pe=t.SEM_SKIP;break}if(W.topStack===null){if(W.definedas==="="){W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}W.topStack={alt:W.opcodes[0],cat:null},W.altStack.push(W.topStack);break}W.topStack={alt:{type:t.ALT,children:[]},cat:null},W.altStack.push(W.topStack),W.opcodes.push(W.topStack.alt);break}else ie===t.SEM_POST&&(W.altStack.pop(),W.altStack.length>0?W.topStack=W.altStack[W.altStack.length-1]:W.topStack=null);return pe}o(w,"semAlternation");function A(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.topStack.alt.children.push(W.opcodes.length),W.topStack.cat={type:t.CAT,children:[]},W.opcodes.push(W.topStack.cat)):ie===t.SEM_POST&&(W.topStack.cat=null),pe}o(A,"semConcatenation");function O(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&W.topStack.cat.children.push(W.opcodes.length),pe}o(O,"semRepetition");function R(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.REP,min:0,max:1,char:ue}),pe}o(R,"semOptionOpen");function I(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.ruleName=e.utils.charsToString(Me,ue,ve)),pe}o(I,"semRuleName");function B(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="="),pe}o(B,"semDefined");function Y(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.definedas="=/"),pe}o(Y,"semIncAlt");function P(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.min=0,W.max=1/0,W.topRep={type:t.REP,min:0,max:1/0},W.opcodes.push(W.topRep)):ie===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`repetition min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.topRep.min=W.min,W.topRep.max=W.max),pe}o(P,"semRepOp");function J(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(J,"semRepMin");function ee(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(ee,"semRepMax");function Z(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve),W.min=W.max),pe}o(Z,"semRepMinMax");function ne(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AND}),pe}o(ne,"semAndOp");function V(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.NOT}),pe}o(V,"semNotOp");function j(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.RNM,index:{phraseIndex:ue,name:e.utils.charsToString(Me,ue,ve)}}),pe}o(j,"semRnmOp");function H(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.ABG}),pe}o(H,"semAbgOp");function he(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.AEN}),pe}o(he,"semAenOp");function L(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKA}),pe}o(L,"semBkaOp");function h(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.opcodes.push({type:t.BKN}),pe}o(h,"semBknOp");function v(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.ci=!0,W.cs=!1,W.um=!0,W.pm=!1):ie===t.SEM_POST&&W.opcodes.push({type:t.BKR,bkrCase:W.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:W.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:W.bkrname.phraseIndex,name:e.utils.charsToString(Me,W.bkrname.phraseIndex,W.bkrname.phraseLength)}}),pe}o(v,"semBkrOp");function g(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.ci=!0),pe}o(g,"semBkrCi");function l(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.cs=!0),pe}o(l,"semBkrCs");function b(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.um=!0),pe}o(b,"semBkrUm");function E(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.pm=!0),pe}o(E,"semBkrPm");function M(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.bkrname={phraseIndex:ue,phraseLength:ve}),pe}o(M,"semBkrName");function S(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!0});W.opcodes.push({type:t.UDT,empty:!0,index:ze.index})}return pe}o(S,"semUdtEmpty");function x(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST){let ke=e.utils.charsToString(Me,ue,ve),ze=W.udtNames.add(ke);if(ze===-1){if(ze=W.udtNames.get(ke),ze===-1)throw new Error("semUdtNonEmpty: name look up error")}else W.udts.push({name:ze.name,lower:ze.lower,index:ze.index,empty:!1});W.opcodes.push({type:t.UDT,empty:!1,index:ze.index,syntax:null,semantic:null})}return pe}o(x,"semUdtNonEmpty");function C(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE&&(W.tlscase=!0),pe}o(C,"semTlsOp");function N(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&ve>0&&(Me[ue+1]===83||Me[ue+1]===115)&&(W.tlscase=!1),pe}o(N,"semTlsCase");function _(ie,Me,ue,ve,W){let pe=t.SEM_OK;if(ie===t.SEM_POST)if(W.tlscase){let ke=Me.slice(ue,ue+ve);for(let ze=0;ze<ke.length;ze+=1)ke[ze]>=65&&ke[ze]<=90&&(ke[ze]+=32);W.opcodes.push({type:t.TLS,string:ke})}else W.opcodes.push({type:t.TBS,string:Me.slice(ue,ue+ve)});return pe}o(_,"semTlsString");function k(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(ve<=2?W.opcodes.push({type:t.TLS,string:[]}):W.opcodes.push({type:t.TBS,string:Me.slice(ue+1,ue+ve-1)})),pe}o(k,"semClsOp");function fe(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?W.tbsstr=[]:ie===t.SEM_POST&&W.opcodes.push({type:t.TBS,string:W.tbsstr}),pe}o(fe,"semTbsOp");function D(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_PRE?(W.min=0,W.max=0):ie===t.SEM_POST&&(W.min>W.max&&W.errors.push({line:W.findLine(W.lines,ue,W.charsLength),char:ue,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${W.min}: max: ${W.max}`}),W.opcodes.push({type:t.TRG,min:W.min,max:W.max})),pe}o(D,"semTrgOp");function Q(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=i(Me,ue,ve)),pe}o(Q,"semDmin");function se(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=i(Me,ue,ve)),pe}o(se,"semDmax");function q(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=s(Me,ue,ve)),pe}o(q,"semBmin");function z(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=s(Me,ue,ve)),pe}o(z,"semBmax");function G(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.min=f(Me,ue,ve)),pe}o(G,"semXmin");function te(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&(W.max=f(Me,ue,ve)),pe}o(te,"semXmax");function ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(i(Me,ue,ve)),pe}o(ae,"semDstring");function Ae(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(s(Me,ue,ve)),pe}o(Ae,"semBstring");function ge(ie,Me,ue,ve,W){let pe=t.SEM_OK;return ie===t.SEM_POST&&W.tbsstr.push(f(Me,ue,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=H,this.callbacks.aenop=he,this.callbacks.alternation=w,this.callbacks.andop=ne,this.callbacks.bmax=z,this.callbacks.bmin=q,this.callbacks.bkaop=L,this.callbacks.bknop=h,this.callbacks.bkrop=v,this.callbacks["bkr-name"]=M,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=g,this.callbacks.cs=l,this.callbacks.um=b,this.callbacks.pm=E,this.callbacks.concatenation=A,this.callbacks.defined=B,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=Y,this.callbacks.notop=V,this.callbacks.optionopen=R,this.callbacks["rep-max"]=ee,this.callbacks["rep-min"]=J,this.callbacks["rep-min-max"]=Z,this.callbacks.repetition=O,this.callbacks.repop=P,this.callbacks.rnmop=j,this.callbacks.rule=d,this.callbacks.rulelookup=y,this.callbacks.rulename=I,this.callbacks.tbsop=fe,this.callbacks.tlscase=N,this.callbacks.tlsstring=_,this.callbacks.tlsop=C,this.callbacks.trgop=D,this.callbacks["udt-empty"]=S,this.callbacks["udt-non-empty"]=x,this.callbacks.xmax=te,this.callbacks.xmin=G,this.callbacks.xstring=ge},"exfn")});var n8=Re((OJ,r8)=>{r8.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+=`;
366
366
  `,t+=`; ABNF for JavaScript APG 2.0 SABNF
367
367
  `,t+=`; RFC 5234 with some restrictions and additions.
368
368
  `,t+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
@@ -533,7 +533,7 @@ table.apg-attrs a:hover {
533
533
  `,t+=` / %d10
534
534
  `,t+=` / %d13
535
535
  `,t+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
536
- `,t},"toString")},"grammar")});var o8=Re((PJ,i8)=>{i8.exports=o(function(){let e="parser: ",t=ff(),n=t.ids,i=new(Q5()),s=new(t8()),f=new(n8()),u=new t.parser;u.ast=new t.ast,u.callbacks=i.callbacks,u.ast.callbacks=s.callbacks;let d=o(function(O,R,I){if(R<0||R>=I)return-1;for(let B=0;B<O.length;B+=1)if(R>=O[B].beginChar&&R<O[B].beginChar+O[B].length)return B;return-1},"findLine"),y=o(function(O,R){let I=-1;if(R<O.length){for(let B=R;B<O.length;B+=1)if(O[B]!==null){I=O[B];break}}return I},"translateIndex"),w=o(function(O){O.forEach(R=>{let I=[],B=[],Y=0;R.opcodes.forEach(P=>{P.type===n.ALT&&P.children.length===1||P.type===n.CAT&&P.children.length===1||P.type===n.REP&&P.min===1&&P.max===1?B.push(null):(B.push(Y),I.push(P),Y+=1)}),B.push(Y),I.forEach(P=>{if(P.type===n.ALT||P.type===n.CAT)for(let J=0;J<P.children.length;J+=1)P.children[J]=y(B,P.children[J])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,B,Y,P){if(P){if(P.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=P}let J={};J.errors=I,J.strict=!!B,J.lite=!!Y,J.lines=R,J.findLine=d,J.charsLength=O.length,J.ruleCount=0,u.parse(f,"file",O,J).success||I.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(O,R,I){let B={};return B.errors=I,B.lines=R,B.findLine=d,B.charsLength=O.length,u.ast.translate(B),I.length?null:(w(B.rules),{rules:B.rules,udts:B.udts,lineMap:B.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,B,Y){let P="",J=!1,ee=!1;Y&&(Y.typescript?(J=!0,ee=!1):Y.lite&&(J=!1,ee=!0));let Z,ne,V,j=0,H=1/0,he=0,L=[],h=[],v=0,g=0,l=0,b=0,E=0,M=0,S=0,x=0,C=0,N=0,_=0,k=0,fe=0,D=0,Q=0;I.forEach(q=>{L.push(q.lower),j+=q.opcodes.length,q.opcodes.forEach(z=>{switch(z.type){case n.ALT:v+=1;break;case n.CAT:g+=1;break;case n.RNM:l+=1;break;case n.UDT:b+=1;break;case n.REP:E+=1;break;case n.AND:M+=1;break;case n.NOT:S+=1;break;case n.BKA:k+=1;break;case n.BKN:fe+=1;break;case n.BKR:_+=1;break;case n.ABG:D+=1;break;case n.AEN:Q+=1;break;case n.TLS:for(x+=1,Z=0;Z<z.string.length;Z+=1)z.string[Z]<H&&(H=z.string[Z]),z.string[Z]>he&&(he=z.string[Z]);break;case n.TBS:for(C+=1,Z=0;Z<z.string.length;Z+=1)z.string[Z]<H&&(H=z.string[Z]),z.string[Z]>he&&(he=z.string[Z]);break;case n.TRG:N+=1,z.min<H&&(H=z.min),z.max>he&&(he=z.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),L.sort(),B.length>0&&(B.forEach(q=>{h.push(q.lower)}),h.sort()),P+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
536
+ `,t},"toString")},"grammar")});var o8=Re((NJ,i8)=>{i8.exports=o(function(){let e="parser: ",t=ff(),n=t.ids,i=new(Q5()),s=new(t8()),f=new(n8()),u=new t.parser;u.ast=new t.ast,u.callbacks=i.callbacks,u.ast.callbacks=s.callbacks;let d=o(function(O,R,I){if(R<0||R>=I)return-1;for(let B=0;B<O.length;B+=1)if(R>=O[B].beginChar&&R<O[B].beginChar+O[B].length)return B;return-1},"findLine"),y=o(function(O,R){let I=-1;if(R<O.length){for(let B=R;B<O.length;B+=1)if(O[B]!==null){I=O[B];break}}return I},"translateIndex"),w=o(function(O){O.forEach(R=>{let I=[],B=[],Y=0;R.opcodes.forEach(P=>{P.type===n.ALT&&P.children.length===1||P.type===n.CAT&&P.children.length===1||P.type===n.REP&&P.min===1&&P.max===1?B.push(null):(B.push(Y),I.push(P),Y+=1)}),B.push(Y),I.forEach(P=>{if(P.type===n.ALT||P.type===n.CAT)for(let J=0;J<P.children.length;J+=1)P.children[J]=y(B,P.children[J])}),R.opcodes=I})},"reduceOpcodes");this.syntax=o(function(O,R,I,B,Y,P){if(P){if(P.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=P}let J={};J.errors=I,J.strict=!!B,J.lite=!!Y,J.lines=R,J.findLine=d,J.charsLength=O.length,J.ruleCount=0,u.parse(f,"file",O,J).success||I.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(O,R,I){let B={};return B.errors=I,B.lines=R,B.findLine=d,B.charsLength=O.length,u.ast.translate(B),I.length?null:(w(B.rules),{rules:B.rules,udts:B.udts,lineMap:B.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,I,B,Y){let P="",J=!1,ee=!1;Y&&(Y.typescript?(J=!0,ee=!1):Y.lite&&(J=!1,ee=!0));let Z,ne,V,j=0,H=1/0,he=0,L=[],h=[],v=0,g=0,l=0,b=0,E=0,M=0,S=0,x=0,C=0,N=0,_=0,k=0,fe=0,D=0,Q=0;I.forEach(q=>{L.push(q.lower),j+=q.opcodes.length,q.opcodes.forEach(z=>{switch(z.type){case n.ALT:v+=1;break;case n.CAT:g+=1;break;case n.RNM:l+=1;break;case n.UDT:b+=1;break;case n.REP:E+=1;break;case n.AND:M+=1;break;case n.NOT:S+=1;break;case n.BKA:k+=1;break;case n.BKN:fe+=1;break;case n.BKR:_+=1;break;case n.ABG:D+=1;break;case n.AEN:Q+=1;break;case n.TLS:for(x+=1,Z=0;Z<z.string.length;Z+=1)z.string[Z]<H&&(H=z.string[Z]),z.string[Z]>he&&(he=z.string[Z]);break;case n.TBS:for(C+=1,Z=0;Z<z.string.length;Z+=1)z.string[Z]<H&&(H=z.string[Z]),z.string[Z]>he&&(he=z.string[Z]);break;case n.TRG:N+=1,z.min<H&&(H=z.min),z.max>he&&(he=z.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),L.sort(),B.length>0&&(B.forEach(q=>{h.push(q.lower)}),h.sort()),P+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
537
537
  `,P+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
538
538
  `,P+=`//
539
539
  `,P+=`// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
@@ -601,7 +601,7 @@ table.apg-attrs a:hover {
601
601
  `}),P+=` return str;
602
602
  `,P+=` }
603
603
  `,P+=`}
604
- `,P},"generateSource"),this.generateObject=o(function(O,R,I){let B={},Y=[],P=[],J=O.slice(0);return B.grammarObject="grammarObject",R.forEach(ee=>{Y.push(ee.lower)}),Y.sort(),I.length>0&&(I.forEach(ee=>{P.push(ee.lower)}),P.sort()),B.callbacks=[],Y.forEach(ee=>{B.callbacks[ee]=!1}),I.length>0&&P.forEach(ee=>{B.callbacks[ee]=!1}),B.rules=R,B.udts=I,B.toString=o(function(){return J},"toStringFunc"),B},"generateObject")},"exportParser")});var a8=Re((BJ,s8)=>{s8.exports=o(function(){let e=Zi(),t="rule-attributes.js",n=null;function i(L){return L.left||L.nested||L.right||L.cyclic?!1:L.empty}o(i,"isEmptyOnly");function s(L){return!!(L.left||L.nested||L.right||L.cyclic)}o(s,"isRecursive");function f(L,h){let v=0,g=0,l=0;for(v=0;v<h;v+=1)if(L[v].nested)return!0;for(v=0;v<h;v+=1)if(L[v].right&&!L[v].leaf){for(g=v+1;g<h;g+=1)if(!i(L[g]))return!0}for(v=h-1;v>=0;v-=1)if(L[v].left&&!L[v].leaf){for(g=v-1;g>=0;g-=1)if(!i(L[g]))return!0}for(v=0;v<h;v+=1)if(!L[v].empty&&!s(L[v])){for(g=v+1;g<h;g+=1)if(s(L[g])){for(l=g+1;l<h;l+=1)if(!L[l].empty&&!s(L[l]))return!0}}return!1}o(f,"isCatNested");function u(L,h){for(let v=0;v<h;v+=1)if(!L[v].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(L,h){for(let v=0;v<h;v+=1){if(L[v].left)return!0;if(!L[v].empty)return!1}return!1}o(d,"isCatLeft");function y(L,h){for(let v=h-1;v>=0;v-=1){if(L[v].right)return!0;if(!L[v].empty)return!1}return!1}o(y,"isCatRight");function w(L,h){for(let v=0;v<h;v+=1)if(!L[v].empty)return!1;return!0}o(w,"isCatEmpty");function A(L,h){for(let v=0;v<h;v+=1)if(!L[v].finite)return!1;return!0}o(A,"isCatFinite");function O(L,h,v,g){let l=0,b=h[v],E=b.children.length,M=[];for(l=0;l<E;l+=1)M.push(L.attrGen());for(l=0;l<E;l+=1)B(L,h,b.children[l],M[l]);g.left=d(M,E),g.right=y(M,E),g.nested=f(M,E),g.empty=w(M,E),g.finite=A(M,E),g.cyclic=u(M,E)}o(O,"cat");function R(L,h,v,g){let l=0,b=h[v],E=b.children.length,M=[];for(l=0;l<E;l+=1)M.push(L.attrGen());for(l=0;l<E;l+=1)B(L,h,b.children[l],M[l]);for(g.left=!1,g.right=!1,g.nested=!1,g.empty=!1,g.finite=!1,g.cyclic=!1,l=0;l<E;l+=1)M[l].left&&(g.left=!0),M[l].nested&&(g.nested=!0),M[l].right&&(g.right=!0),M[l].empty&&(g.empty=!0),M[l].finite&&(g.finite=!0),M[l].cyclic&&(g.cyclic=!0)}o(R,"alt");function I(L,h,v,g){let l=h[v];l.index>=L.ruleCount?(g.empty=L.udts[l.index-L.ruleCount].empty,g.finite=!0):(Y(L,l.index,g),g.left=!1,g.nested=!1,g.right=!1,g.cyclic=!1)}o(I,"bkr");function B(L,h,v,g){L.attrInit(g);let l=h[v];switch(l.type){case e.ALT:R(L,h,v,g);break;case e.CAT:O(L,h,v,g);break;case e.REP:B(L,h,v+1,g),l.min===0&&(g.empty=!0,g.finite=!0);break;case e.RNM:Y(L,h[v].index,g);break;case e.BKR:I(L,h,v,g);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:B(L,h,v+1,g),g.empty=!0;break;case e.TLS:g.empty=!h[v].string.length,g.finite=!0,g.cyclic=!1;break;case e.TBS:case e.TRG:g.empty=!1,g.finite=!0,g.cyclic=!1;break;case e.UDT:g.empty=l.empty,g.finite=!0,g.cyclic=!1;break;case e.ABG:case e.AEN:g.empty=!0,g.finite=!0,g.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${l}`)}}o(B,"opEval");function Y(L,h,v){let g=L.attrsWorking[h];g.isComplete?L.attrCopy(v,g):g.isOpen?h===L.startRule?h===L.startRule&&(v.left=!0,v.right=!0,v.cyclic=!0,v.leaf=!0):v.finite=!0:(g.isOpen=!0,B(L,g.rule.opcodes,0,v),g.left=v.left,g.right=v.right,g.nested=v.nested,g.empty=v.empty,g.finite=v.finite,g.cyclic=v.cyclic,g.leaf=!1,g.isOpen=!1,g.isComplete=!0)}o(Y,"ruleAttrsEval");let P=o(L=>{n=L;let h=0,v=0,g=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(v=0;v<n.ruleCount;v+=1)n.attrInit(n.attrsWorking[v]);n.startRule=h,Y(n,h,g),n.attrCopy(n.attrs[h],n.attrsWorking[h])}n.attributesComplete=!0;let l=null;for(h=0;h<n.ruleCount;h+=1)if(l=n.attrs[h],l.left||!l.finite||l.cyclic){let b=n.attrGen(l.rule);n.attrCopy(b,l),n.attrsErrors.push(b),n.attrsErrorCount+=1}},"ruleAttributes"),J=o(L=>L?"t":"f","truth"),ee=o(L=>L?"e":"f","tError"),Z=o(L=>L?"t":"e","fError"),ne=o((L,h,v,g)=>{let l=`${L}:${h}:`;return l+=`${ee(v.left)} `,l+=`${J(v.nested)} `,l+=`${J(v.right)} `,l+=`${ee(v.cyclic)} `,l+=`${Z(v.finite)} `,l+=`${J(v.empty)}:`,l+=`${n.typeToString(g.recursiveType)}:`,l+=g.recursiveType===e.ATTR_MR?g.groupNumber:"-",l+=`:${v.rule.name}
604
+ `,P},"generateSource"),this.generateObject=o(function(O,R,I){let B={},Y=[],P=[],J=O.slice(0);return B.grammarObject="grammarObject",R.forEach(ee=>{Y.push(ee.lower)}),Y.sort(),I.length>0&&(I.forEach(ee=>{P.push(ee.lower)}),P.sort()),B.callbacks=[],Y.forEach(ee=>{B.callbacks[ee]=!1}),I.length>0&&P.forEach(ee=>{B.callbacks[ee]=!1}),B.rules=R,B.udts=I,B.toString=o(function(){return J},"toStringFunc"),B},"generateObject")},"exportParser")});var a8=Re((PJ,s8)=>{s8.exports=o(function(){let e=Zi(),t="rule-attributes.js",n=null;function i(L){return L.left||L.nested||L.right||L.cyclic?!1:L.empty}o(i,"isEmptyOnly");function s(L){return!!(L.left||L.nested||L.right||L.cyclic)}o(s,"isRecursive");function f(L,h){let v=0,g=0,l=0;for(v=0;v<h;v+=1)if(L[v].nested)return!0;for(v=0;v<h;v+=1)if(L[v].right&&!L[v].leaf){for(g=v+1;g<h;g+=1)if(!i(L[g]))return!0}for(v=h-1;v>=0;v-=1)if(L[v].left&&!L[v].leaf){for(g=v-1;g>=0;g-=1)if(!i(L[g]))return!0}for(v=0;v<h;v+=1)if(!L[v].empty&&!s(L[v])){for(g=v+1;g<h;g+=1)if(s(L[g])){for(l=g+1;l<h;l+=1)if(!L[l].empty&&!s(L[l]))return!0}}return!1}o(f,"isCatNested");function u(L,h){for(let v=0;v<h;v+=1)if(!L[v].cyclic)return!1;return!0}o(u,"isCatCyclic");function d(L,h){for(let v=0;v<h;v+=1){if(L[v].left)return!0;if(!L[v].empty)return!1}return!1}o(d,"isCatLeft");function y(L,h){for(let v=h-1;v>=0;v-=1){if(L[v].right)return!0;if(!L[v].empty)return!1}return!1}o(y,"isCatRight");function w(L,h){for(let v=0;v<h;v+=1)if(!L[v].empty)return!1;return!0}o(w,"isCatEmpty");function A(L,h){for(let v=0;v<h;v+=1)if(!L[v].finite)return!1;return!0}o(A,"isCatFinite");function O(L,h,v,g){let l=0,b=h[v],E=b.children.length,M=[];for(l=0;l<E;l+=1)M.push(L.attrGen());for(l=0;l<E;l+=1)B(L,h,b.children[l],M[l]);g.left=d(M,E),g.right=y(M,E),g.nested=f(M,E),g.empty=w(M,E),g.finite=A(M,E),g.cyclic=u(M,E)}o(O,"cat");function R(L,h,v,g){let l=0,b=h[v],E=b.children.length,M=[];for(l=0;l<E;l+=1)M.push(L.attrGen());for(l=0;l<E;l+=1)B(L,h,b.children[l],M[l]);for(g.left=!1,g.right=!1,g.nested=!1,g.empty=!1,g.finite=!1,g.cyclic=!1,l=0;l<E;l+=1)M[l].left&&(g.left=!0),M[l].nested&&(g.nested=!0),M[l].right&&(g.right=!0),M[l].empty&&(g.empty=!0),M[l].finite&&(g.finite=!0),M[l].cyclic&&(g.cyclic=!0)}o(R,"alt");function I(L,h,v,g){let l=h[v];l.index>=L.ruleCount?(g.empty=L.udts[l.index-L.ruleCount].empty,g.finite=!0):(Y(L,l.index,g),g.left=!1,g.nested=!1,g.right=!1,g.cyclic=!1)}o(I,"bkr");function B(L,h,v,g){L.attrInit(g);let l=h[v];switch(l.type){case e.ALT:R(L,h,v,g);break;case e.CAT:O(L,h,v,g);break;case e.REP:B(L,h,v+1,g),l.min===0&&(g.empty=!0,g.finite=!0);break;case e.RNM:Y(L,h[v].index,g);break;case e.BKR:I(L,h,v,g);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:B(L,h,v+1,g),g.empty=!0;break;case e.TLS:g.empty=!h[v].string.length,g.finite=!0,g.cyclic=!1;break;case e.TBS:case e.TRG:g.empty=!1,g.finite=!0,g.cyclic=!1;break;case e.UDT:g.empty=l.empty,g.finite=!0,g.cyclic=!1;break;case e.ABG:case e.AEN:g.empty=!0,g.finite=!0,g.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${l}`)}}o(B,"opEval");function Y(L,h,v){let g=L.attrsWorking[h];g.isComplete?L.attrCopy(v,g):g.isOpen?h===L.startRule?h===L.startRule&&(v.left=!0,v.right=!0,v.cyclic=!0,v.leaf=!0):v.finite=!0:(g.isOpen=!0,B(L,g.rule.opcodes,0,v),g.left=v.left,g.right=v.right,g.nested=v.nested,g.empty=v.empty,g.finite=v.finite,g.cyclic=v.cyclic,g.leaf=!1,g.isOpen=!1,g.isComplete=!0)}o(Y,"ruleAttrsEval");let P=o(L=>{n=L;let h=0,v=0,g=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(v=0;v<n.ruleCount;v+=1)n.attrInit(n.attrsWorking[v]);n.startRule=h,Y(n,h,g),n.attrCopy(n.attrs[h],n.attrsWorking[h])}n.attributesComplete=!0;let l=null;for(h=0;h<n.ruleCount;h+=1)if(l=n.attrs[h],l.left||!l.finite||l.cyclic){let b=n.attrGen(l.rule);n.attrCopy(b,l),n.attrsErrors.push(b),n.attrsErrorCount+=1}},"ruleAttributes"),J=o(L=>L?"t":"f","truth"),ee=o(L=>L?"e":"f","tError"),Z=o(L=>L?"t":"e","fError"),ne=o((L,h,v,g)=>{let l=`${L}:${h}:`;return l+=`${ee(v.left)} `,l+=`${J(v.nested)} `,l+=`${J(v.right)} `,l+=`${ee(v.cyclic)} `,l+=`${Z(v.finite)} `,l+=`${J(v.empty)}:`,l+=`${n.typeToString(g.recursiveType)}:`,l+=g.recursiveType===e.ATTR_MR?g.groupNumber:"-",l+=`:${v.rule.name}
605
605
  `,l},"showAttr"),V=o(()=>{let L=`LEGEND - t=true, f=false, e=error
606
606
  `;return L+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
607
607
  `,L},"showLegend"),j=o(()=>{let L=null,h=null,v="";if(v+=`RULE ATTRIBUTES WITH ERRORS
@@ -610,7 +610,7 @@ table.apg-attrs a:hover {
610
610
  `;return L.charCodeAt(0)===97?(h+=`alphabetical by rule name
611
611
  `,h+=v,h+=V(),h+=H(97)):L.charCodeAt(0)===116?(h+=`ordered by rule type
612
612
  `,h+=v,h+=V(),h+=H(116)):(h+=`ordered by rule index
613
- `,h+=v,h+=V(),h+=H()),h},"showAttributes"),showAttributeErrors:j}},"exportRuleAttributes")()});var c8=Re((LJ,f8)=>{f8.exports=(()=>{let r=Zi(),e=null,t=o((f,u,d,y)=>{let w=0,A=0,O=u[d];y[d]=!0;let R=O.rule.opcodes;for(w=0;w<R.length;w+=1){let I=R[w];if(I.type===r.RNM)for(O.refersTo[I.index]=!0,y[I.index]||t(f,u,I.index,y),A=0;A<f;A+=1)u[I.index].refersTo[A]&&(O.refersTo[A]=!0);else I.type===r.UDT?O.refersToUdt[I.index]=!0:I.type===r.BKR&&(I.index<f?(O.refersTo[I.index]=!0,y[I.index]||t(f,u,I.index,y)):O.refersToUdt[f-I.index]=!0)}},"scan"),n=o(f=>{e=f;let u=0,d=0,y=0,w=null,A=null,O=!1;e.dependenciesComplete=!1;let R=e.falseArray(e.ruleCount);for(u=0;u<e.ruleCount;u+=1)e.falsifyArray(R),t(e.ruleCount,e.ruleDeps,u,R);for(u=0;u<e.ruleCount;u+=1)for(d=0;d<e.ruleCount;d+=1)u!==d&&e.ruleDeps[d].refersTo[u]&&(e.ruleDeps[u].referencedBy[d]=!0);for(u=0;u<e.ruleCount;u+=1)e.ruleDeps[u].recursiveType=r.ATTR_N,e.ruleDeps[u].refersTo[u]&&(e.ruleDeps[u].recursiveType=r.ATTR_R);for(y=-1,u=0;u<e.ruleCount;u+=1)if(w=e.ruleDeps[u],w.recursiveType===r.ATTR_R)for(O=!0,d=0;d<e.ruleCount;d+=1)u!==d&&(A=e.ruleDeps[d],A.recursiveType===r.ATTR_R&&w.refersTo[d]&&A.refersTo[u]&&(O&&(y+=1,w.recursiveType=r.ATTR_MR,w.groupNumber=y,O=!1),A.recursiveType=r.ATTR_MR,A.groupNumber=y));e.isMutuallyRecursive=y>-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((f=null)=>{let u=0,d=0,y=0,w=0,A=e.ruleCount-1,O=e.udtCount-1,R=100,I="",B="",Y="=> ",P="<= ",J=!1,ee=null,{ruleIndexes:Z}=e,{udtIndexes:ne}=e;for(f===97?(Z=e.ruleAlphaIndexes,ne=e.udtAlphaIndexes):f===116&&(Z=e.ruleTypeIndexes,ne=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(ee=e.ruleDeps[Z[u]],B=`${Z[u]}:${e.typeToString(ee.recursiveType)}:`,e.isMutuallyRecursive&&(B+=ee.groupNumber>-1?ee.groupNumber:"-",B+=":"),B+=" ",I+=`${B+e.rules[Z[u]].name}
613
+ `,h+=v,h+=V(),h+=H()),h},"showAttributes"),showAttributeErrors:j}},"exportRuleAttributes")()});var c8=Re((BJ,f8)=>{f8.exports=(()=>{let r=Zi(),e=null,t=o((f,u,d,y)=>{let w=0,A=0,O=u[d];y[d]=!0;let R=O.rule.opcodes;for(w=0;w<R.length;w+=1){let I=R[w];if(I.type===r.RNM)for(O.refersTo[I.index]=!0,y[I.index]||t(f,u,I.index,y),A=0;A<f;A+=1)u[I.index].refersTo[A]&&(O.refersTo[A]=!0);else I.type===r.UDT?O.refersToUdt[I.index]=!0:I.type===r.BKR&&(I.index<f?(O.refersTo[I.index]=!0,y[I.index]||t(f,u,I.index,y)):O.refersToUdt[f-I.index]=!0)}},"scan"),n=o(f=>{e=f;let u=0,d=0,y=0,w=null,A=null,O=!1;e.dependenciesComplete=!1;let R=e.falseArray(e.ruleCount);for(u=0;u<e.ruleCount;u+=1)e.falsifyArray(R),t(e.ruleCount,e.ruleDeps,u,R);for(u=0;u<e.ruleCount;u+=1)for(d=0;d<e.ruleCount;d+=1)u!==d&&e.ruleDeps[d].refersTo[u]&&(e.ruleDeps[u].referencedBy[d]=!0);for(u=0;u<e.ruleCount;u+=1)e.ruleDeps[u].recursiveType=r.ATTR_N,e.ruleDeps[u].refersTo[u]&&(e.ruleDeps[u].recursiveType=r.ATTR_R);for(y=-1,u=0;u<e.ruleCount;u+=1)if(w=e.ruleDeps[u],w.recursiveType===r.ATTR_R)for(O=!0,d=0;d<e.ruleCount;d+=1)u!==d&&(A=e.ruleDeps[d],A.recursiveType===r.ATTR_R&&w.refersTo[d]&&A.refersTo[u]&&(O&&(y+=1,w.recursiveType=r.ATTR_MR,w.groupNumber=y,O=!1),A.recursiveType=r.ATTR_MR,A.groupNumber=y));e.isMutuallyRecursive=y>-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((f=null)=>{let u=0,d=0,y=0,w=0,A=e.ruleCount-1,O=e.udtCount-1,R=100,I="",B="",Y="=> ",P="<= ",J=!1,ee=null,{ruleIndexes:Z}=e,{udtIndexes:ne}=e;for(f===97?(Z=e.ruleAlphaIndexes,ne=e.udtAlphaIndexes):f===116&&(Z=e.ruleTypeIndexes,ne=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(ee=e.ruleDeps[Z[u]],B=`${Z[u]}:${e.typeToString(ee.recursiveType)}:`,e.isMutuallyRecursive&&(B+=ee.groupNumber>-1?ee.groupNumber:"-",B+=":"),B+=" ",I+=`${B+e.rules[Z[u]].name}
614
614
  `,J=!0,y=0,w=I.length,I+=B,d=0;d<e.ruleCount;d+=1)ee.refersTo[Z[d]]&&(J?(I+=Y,J=!1,I+=e.ruleDeps[Z[d]].rule.name):I+=`, ${e.ruleDeps[Z[d]].rule.name}`,y+=1),I.length-w>R&&d!==A&&(I+=`
615
615
  ${B}${Y}`,w=I.length);if(e.udtCount)for(d=0;d<e.udtCount;d+=1)ee.refersToUdt[ne[d]]&&(J?(I+=Y,J=!1,I+=e.udts[ne[d]].name):I+=`, ${e.udts[ne[d]].name}`,y+=1),I.length-w>R&&d!==O&&(I+=`
616
616
  ${B}${Y}`,w=I.length);for(y===0&&(I+=`=> <none>
@@ -625,13 +625,13 @@ ${B}${Y}`,w=I.length);y===0&&(I+=`<= <none>
625
625
  `,e.dependenciesComplete&&(f.charCodeAt(0)===97?(u+=`alphabetical by rule name
626
626
  `,u+=i(97)):f.charCodeAt(0)===116?(u+=`ordered by rule type
627
627
  `,u+=i(116)):(u+=`ordered by rule index
628
- `,u+=i(null))),u},"showRuleDependencies")}})()});var l8=Re((UJ,u8)=>{u8.exports=o(function(){let e=Zi(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=a8(),{ruleDependencies:s,showRuleDependencies:f}=c8();class u{constructor(w,A){this.rules=w,this.udts=A,this.ruleCount=w.length,this.udtCount=A.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 O=0;O<this.ruleCount;O+=1)this.attrs.push(this.attrGen(this.rules[O])),this.attrsWorking.push(this.attrGen(this.rules[O])),this.ruleDeps.push(this.rdGen(w[O],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(w){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:w}}attrInit(w){w.left=!1,w.nested=!1,w.right=!1,w.empty=!1,w.finite=!1,w.cyclic=!1,w.leaf=!1,w.isOpen=!1,w.isComplete=!1}attrCopy(w,A){w.left=A.left,w.nested=A.nested,w.right=A.right,w.empty=A.empty,w.finite=A.finite,w.cyclic=A.cyclic,w.leaf=A.leaf,w.isOpen=A.isOpen,w.isComplete=A.isComplete,w.rule=A.rule}rdGen(w,A,O){return{rule:w,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(A),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(A)}}typeToString(w){switch(w){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(w){let A=[];if(w>0)for(let O=0;O<w;O+=1)A.push(!1);return A}falsifyArray(w){for(let A=0;A<w.length;A+=1)w[A]=!1}indexArray(w){let A=[];if(w>0)for(let O=0;O<w;O+=1)A.push(O);return A}compRulesAlpha(w,A){return this.rules[w].lower<this.rules[A].lower?-1:this.rules[w].lower>this.rules[A].lower?1:0}compUdtsAlpha(w,A){return this.udts[w].lower<this.udts[A].lower?-1:this.udts[w].lower>this.udts[A].lower?1:0}compRulesType(w,A){return this.ruleDeps[w].recursiveType<this.ruleDeps[A].recursiveType?-1:this.ruleDeps[w].recursiveType>this.ruleDeps[A].recursiveType?1:0}compRulesGroup(w,A){if(this.ruleDeps[w].recursiveType===e.ATTR_MR&&this.ruleDeps[A].recursiveType===e.ATTR_MR){if(this.ruleDeps[w].groupNumber<this.ruleDeps[A].groupNumber)return-1;if(this.ruleDeps[w].groupNumber>this.ruleDeps[A].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(w=[],A=[],O=[],R=[]){let I=new u(w,A);return s(I),t(I),I.attrsErrorCount&&R.push({line:0,char:0,msg:`${I.attrsErrorCount} attribute errors`}),I.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:f}},"exportAttributes")()});var d8=Re((FJ,h8)=>{h8.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],f="index"){let u="showRules",d=[],y=[],w=[],A=[],O=i,R=s,I=i.length,B=s.length,Y="RULE/UDT NAMES",P;function J(Z,ne){return O[Z].lower<O[ne].lower?-1:O[Z].lower>O[ne].lower?1:0}o(J,"compRulesAlpha");function ee(Z,ne){return R[Z].lower<R[ne].lower?-1:R[Z].lower>R[ne].lower?1:0}if(o(ee,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${u}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${u}: udts arg must be array`);for(P=0;P<I;P+=1)w.push(P);if(d=w.slice(0),d.sort(J),B){for(P=0;P<B;P+=1)A.push(P);y=A.slice(0),y.sort(ee)}if(f.charCodeAt(0)===97){for(Y+=` - alphabetical by rule/UDT name
628
+ `,u+=i(null))),u},"showRuleDependencies")}})()});var l8=Re((LJ,u8)=>{u8.exports=o(function(){let e=Zi(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=a8(),{ruleDependencies:s,showRuleDependencies:f}=c8();class u{constructor(w,A){this.rules=w,this.udts=A,this.ruleCount=w.length,this.udtCount=A.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 O=0;O<this.ruleCount;O+=1)this.attrs.push(this.attrGen(this.rules[O])),this.attrsWorking.push(this.attrGen(this.rules[O])),this.ruleDeps.push(this.rdGen(w[O],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(w){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:w}}attrInit(w){w.left=!1,w.nested=!1,w.right=!1,w.empty=!1,w.finite=!1,w.cyclic=!1,w.leaf=!1,w.isOpen=!1,w.isComplete=!1}attrCopy(w,A){w.left=A.left,w.nested=A.nested,w.right=A.right,w.empty=A.empty,w.finite=A.finite,w.cyclic=A.cyclic,w.leaf=A.leaf,w.isOpen=A.isOpen,w.isComplete=A.isComplete,w.rule=A.rule}rdGen(w,A,O){return{rule:w,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(A),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(A)}}typeToString(w){switch(w){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(w){let A=[];if(w>0)for(let O=0;O<w;O+=1)A.push(!1);return A}falsifyArray(w){for(let A=0;A<w.length;A+=1)w[A]=!1}indexArray(w){let A=[];if(w>0)for(let O=0;O<w;O+=1)A.push(O);return A}compRulesAlpha(w,A){return this.rules[w].lower<this.rules[A].lower?-1:this.rules[w].lower>this.rules[A].lower?1:0}compUdtsAlpha(w,A){return this.udts[w].lower<this.udts[A].lower?-1:this.udts[w].lower>this.udts[A].lower?1:0}compRulesType(w,A){return this.ruleDeps[w].recursiveType<this.ruleDeps[A].recursiveType?-1:this.ruleDeps[w].recursiveType>this.ruleDeps[A].recursiveType?1:0}compRulesGroup(w,A){if(this.ruleDeps[w].recursiveType===e.ATTR_MR&&this.ruleDeps[A].recursiveType===e.ATTR_MR){if(this.ruleDeps[w].groupNumber<this.ruleDeps[A].groupNumber)return-1;if(this.ruleDeps[w].groupNumber>this.ruleDeps[A].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(w=[],A=[],O=[],R=[]){let I=new u(w,A);return s(I),t(I),I.attrsErrorCount&&R.push({line:0,char:0,msg:`${I.attrsErrorCount} attribute errors`}),I.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:f}},"exportAttributes")()});var d8=Re((UJ,h8)=>{h8.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],f="index"){let u="showRules",d=[],y=[],w=[],A=[],O=i,R=s,I=i.length,B=s.length,Y="RULE/UDT NAMES",P;function J(Z,ne){return O[Z].lower<O[ne].lower?-1:O[Z].lower>O[ne].lower?1:0}o(J,"compRulesAlpha");function ee(Z,ne){return R[Z].lower<R[ne].lower?-1:R[Z].lower>R[ne].lower?1:0}if(o(ee,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${u}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${u}: udts arg must be array`);for(P=0;P<I;P+=1)w.push(P);if(d=w.slice(0),d.sort(J),B){for(P=0;P<B;P+=1)A.push(P);y=A.slice(0),y.sort(ee)}if(f.charCodeAt(0)===97){for(Y+=` - alphabetical by rule/UDT name
629
629
  `,P=0;P<I;P+=1)Y+=`${P}: ${d[P]}: ${O[d[P]].name}
630
630
  `;if(B)for(P=0;P<B;P+=1)Y+=`${P}: ${y[P]}: ${R[y[P]].name}
631
631
  `}else{for(Y+=` - ordered by rule/UDT index
632
632
  `,P=0;P<I;P+=1)Y+=`${P}: ${O[P].name}
633
633
  `;if(B)for(P=0;P<B;P+=1)Y+=`${P}: ${R[P].name}
634
- `}return Y},"showRules")},"exfn")()});var m8=Re(($J,p8)=>{p8.exports=o(function(e){let{Buffer:t}=f0(),n="api.js: ",i=this,s=ff(),f=Gb(),u=Z5(),d=new(o8()),{attributes:y,showAttributes:w,showAttributeErrors:A,showRuleDependencies:O}=l8(),R=d8(),I=o(function(h,v,g){let M=`<span class="${s.style.CLASS_CTRLCHAR}">`,S="</span>",x=`<span class="${s.style.CLASS_NOMATCH}">`,C="</span>",N,_="",k=!0;for(;k&&!(!Array.isArray(h)||h.length===0);){if(typeof v!="number")throw new Error("abnfToHtml: beg must be type number");if(v>=h.length)break;typeof g!="number"||v+g>=h.length?N=h.length:N=v+g;let fe=0;for(let D=v;D<N;D+=1){let Q=h[D];if(Q>=32&&Q<=126)switch(fe===1?(_+=S,fe=0):fe===2&&(_+=C,fe=0),Q){case 32:_+="&nbsp;";break;case 60:_+="&lt;";break;case 62:_+="&gt;";break;case 38:_+="&amp;";break;case 34:_+="&quot;";break;case 39:_+="&#039;";break;case 92:_+="&#092;";break;default:_+=String.fromCharCode(Q);break}else Q===9||Q===10||Q===13?(fe===0?(_+=M,fe=1):fe===2&&(_+=C+M,fe=1),Q===9&&(_+="TAB"),Q===10&&(_+="LF"),Q===13&&(_+="CR")):(fe===0?(_+=x,fe=2):fe===1&&(_+=S+x,fe=2),_+=`\\x${s.utils.charToHex(Q)}`)}fe===2&&(_+=C),fe===1&&(_+=S);break}return _},"abnfToHtml"),B=o(function(h,v,g){let l="";for(let b=v;b<v+g;b+=1){let E=h[b];if(E>=32&&E<=126)l+=String.fromCharCode(E);else switch(E){case 9:l+="\\t";break;case 10:l+="\\n";break;case 13:l+="\\r";break;default:l+="\\unknown";break}}return l},"abnfToAscii"),Y=o(function(h){let v="Annotated Input Grammar";return h.forEach(g=>{v+=`
634
+ `}return Y},"showRules")},"exfn")()});var m8=Re((FJ,p8)=>{p8.exports=o(function(e){let{Buffer:t}=f0(),n="api.js: ",i=this,s=ff(),f=Gb(),u=Z5(),d=new(o8()),{attributes:y,showAttributes:w,showAttributeErrors:A,showRuleDependencies:O}=l8(),R=d8(),I=o(function(h,v,g){let M=`<span class="${s.style.CLASS_CTRLCHAR}">`,S="</span>",x=`<span class="${s.style.CLASS_NOMATCH}">`,C="</span>",N,_="",k=!0;for(;k&&!(!Array.isArray(h)||h.length===0);){if(typeof v!="number")throw new Error("abnfToHtml: beg must be type number");if(v>=h.length)break;typeof g!="number"||v+g>=h.length?N=h.length:N=v+g;let fe=0;for(let D=v;D<N;D+=1){let Q=h[D];if(Q>=32&&Q<=126)switch(fe===1?(_+=S,fe=0):fe===2&&(_+=C,fe=0),Q){case 32:_+="&nbsp;";break;case 60:_+="&lt;";break;case 62:_+="&gt;";break;case 38:_+="&amp;";break;case 34:_+="&quot;";break;case 39:_+="&#039;";break;case 92:_+="&#092;";break;default:_+=String.fromCharCode(Q);break}else Q===9||Q===10||Q===13?(fe===0?(_+=M,fe=1):fe===2&&(_+=C+M,fe=1),Q===9&&(_+="TAB"),Q===10&&(_+="LF"),Q===13&&(_+="CR")):(fe===0?(_+=x,fe=2):fe===1&&(_+=S+x,fe=2),_+=`\\x${s.utils.charToHex(Q)}`)}fe===2&&(_+=C),fe===1&&(_+=S);break}return _},"abnfToHtml"),B=o(function(h,v,g){let l="";for(let b=v;b<v+g;b+=1){let E=h[b];if(E>=32&&E<=126)l+=String.fromCharCode(E);else switch(E){case 9:l+="\\t";break;case 10:l+="\\n";break;case 13:l+="\\r";break;default:l+="\\unknown";break}}return l},"abnfToAscii"),Y=o(function(h){let v="Annotated Input Grammar";return h.forEach(g=>{v+=`
635
635
  `,v+=`line no: ${g.lineNo}`,v+=` : char index: ${g.beginChar}`,v+=` : length: ${g.length}`,v+=` : abnf: ${B(i.chars,g.beginChar,g.length)}`}),v+=`
636
636
  `,v},"linesToAscii"),P=o(function(h){let v="";return v+=`<table class="${s.style.CLASS_GRAMMAR}">
637
637
  `,v+=`<caption>Annotated Input Grammar</caption>
@@ -646,14 +646,14 @@ ${B}${Y}`,w=I.length);y===0&&(I+=`<= <none>
646
646
  `)}),E+=`</table></p>
647
647
  `,E},"errorsToHtml"),ee=o(function(h,v,g){let l,b,E,M;return l="",h.forEach(S=>{b=v[S.line],l+=`${b.lineNo}: `,l+=`${b.beginChar}: `,l+=`${S.char-b.beginChar}: `,E=b.beginChar,M=S.char-b.beginChar,l+=B(g,E,M),l+=" >> ",E=S.char,M=b.beginChar+b.length-S.char,l+=B(g,E,M),l+=`
648
648
  `,l+=`${b.lineNo}: `,l+=`${b.beginChar}: `,l+=`${S.char-b.beginChar}: `,l+="error: ",l+=S.msg,l+=`
649
- `}),l},"errorsToAscii"),Z=!1,ne=!1,V=!1,j=!1,H=0,he;if(this.errors=[],t.isBuffer(e))this.chars=f.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=f.decode("STRING",e);else throw new Error(`${n}input source is not a string, byte Buffer or character array`);this.sabnf=f.encode("STRING",this.chars),this.scan=o(function(h,v){this.lines=u(this.chars,this.errors,h,v),Z=!0},"scan"),this.parse=o(function(h,v,g){if(!Z)throw new Error(`${n}grammar not scanned`);d.syntax(this.chars,this.lines,this.errors,h,v,g),ne=!0},"parse"),this.translate=o(function(){if(!ne)throw new Error(`${n}grammar not scanned and parsed`);let h=d.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=h.rules,this.udts=h.udts,he=h.lineMap,V=!0)},"translate"),this.attributes=o(function(){if(!V)throw new Error(`${n}grammar not scanned, parsed and translated`);return H=y(this.rules,this.udts,he,this.errors),j=!0,H},"attrs"),this.generate=o(function(h){if(this.lines=u(this.chars,this.errors,h),this.errors.length||(d.syntax(this.chars,this.lines,this.errors,h),this.errors.length))return;let v=d.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=v.rules,this.udts=v.udts,he=v.lineMap,H=y(this.rules,this.udts,he,this.errors),j=!0)},"generate"),this.displayRules=o(function(h="index"){if(!V)throw new Error(`${n}grammar not scanned, parsed and translated`);return R(this.rules,this.udts,h)},"displayRules"),this.displayRuleDependencies=o(function(h="index"){if(!j)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return O(h)},"displayRuleDependencies"),this.displayAttributes=o(function(h="index"){if(!j)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return H&&A(h),w(h)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!j)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return A()},"displayAttributeErrors"),this.toSource=o(function(h=void 0){if(!j)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${n}can't generate parser source - attributes have ${H} errors`);return d.generateSource(this.chars,this.lines,this.rules,this.udts,h)},"toSource"),this.toObject=o(function(){if(!j)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${n}can't generate parser source - attributes have ${H} errors`);return d.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return ee(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(h){return J(this.errors,this.lines,this.chars,h)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return Y(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return P(this.lines)},"linesToHtmlFunc")},"api")});var fg=Re((D8,ag)=>{(function(r,e){"use strict";function t(g,l){if(!g)throw new Error(l||"Assertion failed")}o(t,"assert");function n(g,l){g.super_=l;var b=o(function(){},"TempCtor");b.prototype=l.prototype,g.prototype=new b,g.prototype.constructor=g}o(n,"inherits");function i(g,l,b){if(i.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((l==="le"||l==="be")&&(b=l,l=10),this._init(g||0,l||10,b||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=w1().Buffer}catch{}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,b){return l.cmp(b)>0?l:b},"max"),i.min=o(function(l,b){return l.cmp(b)<0?l:b},"min"),i.prototype._init=o(function(l,b,E){if(typeof l=="number")return this._initNumber(l,b,E);if(typeof l=="object")return this._initArray(l,b,E);b==="hex"&&(b=16),t(b===(b|0)&&b>=2&&b<=36),l=l.toString().replace(/\s+/g,"");var M=0;l[0]==="-"&&(M++,this.negative=1),M<l.length&&(b===16?this._parseHex(l,M,E):(this._parseBase(l,b,M),E==="le"&&this._initArray(this.toArray(),b,E)))},"init"),i.prototype._initNumber=o(function(l,b,E){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),E==="le"&&this._initArray(this.toArray(),b,E)},"_initNumber"),i.prototype._initArray=o(function(l,b,E){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 M=0;M<this.length;M++)this.words[M]=0;var S,x,C=0;if(E==="be")for(M=l.length-1,S=0;M>=0;M-=3)x=l[M]|l[M-1]<<8|l[M-2]<<16,this.words[S]|=x<<C&67108863,this.words[S+1]=x>>>26-C&67108863,C+=24,C>=26&&(C-=26,S++);else if(E==="le")for(M=0,S=0;M<l.length;M+=3)x=l[M]|l[M+1]<<8|l[M+2]<<16,this.words[S]|=x<<C&67108863,this.words[S+1]=x>>>26-C&67108863,C+=24,C>=26&&(C-=26,S++);return this._strip()},"_initArray");function f(g,l){var b=g.charCodeAt(l);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;t(!1,"Invalid character in "+g)}o(f,"parseHex4Bits");function u(g,l,b){var E=f(g,b);return b-1>=l&&(E|=f(g,b-1)<<4),E}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,b,E){this.length=Math.ceil((l.length-b)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var S=0,x=0,C;if(E==="be")for(M=l.length-1;M>=b;M-=2)C=u(l,b,M)<<S,this.words[x]|=C&67108863,S>=18?(S-=18,x+=1,this.words[x]|=C>>>26):S+=8;else{var N=l.length-b;for(M=N%2===0?b+1:b;M<l.length;M+=2)C=u(l,b,M)<<S,this.words[x]|=C&67108863,S>=18?(S-=18,x+=1,this.words[x]|=C>>>26):S+=8}this._strip()},"_parseHex");function d(g,l,b,E){for(var M=0,S=0,x=Math.min(g.length,b),C=l;C<x;C++){var N=g.charCodeAt(C)-48;M*=E,N>=49?S=N-49+10:N>=17?S=N-17+10:S=N,t(N>=0&&S<E,"Invalid character"),M+=S}return M}o(d,"parseBase"),i.prototype._parseBase=o(function(l,b,E){this.words=[0],this.length=1;for(var M=0,S=1;S<=67108863;S*=b)M++;M--,S=S/b|0;for(var x=l.length-E,C=x%M,N=Math.min(x,x-C)+E,_=0,k=E;k<N;k+=M)_=d(l,k,k+M,b),this.imuln(S),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_);if(C!==0){var fe=1;for(_=d(l,k,l.length,b),k=0;k<C;k++)fe*=b;this.imuln(fe),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_)}this._strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var b=0;b<this.length;b++)l.words[b]=this.words[b];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy");function y(g,l){g.words=l.words,g.length=l.length,g.negative=l.negative,g.red=l.red}if(o(y,"move"),i.prototype._move=o(function(l){y(l,this)},"_move"),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"),typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{i.prototype.inspect=w}else i.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(w,"inspect");var A=["","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"],O=[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],R=[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,b){l=l||10,b=b|0||1;var E;if(l===16||l==="hex"){E="";for(var M=0,S=0,x=0;x<this.length;x++){var C=this.words[x],N=((C<<M|S)&16777215).toString(16);S=C>>>24-M&16777215,M+=2,M>=26&&(M-=26,x--),S!==0||x!==this.length-1?E=A[6-N.length]+N+E:E=N+E}for(S!==0&&(E=S.toString(16)+E);E.length%b!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(l===(l|0)&&l>=2&&l<=36){var _=O[l],k=R[l];E="";var fe=this.clone();for(fe.negative=0;!fe.isZero();){var D=fe.modrn(k).toString(l);fe=fe.idivn(k),fe.isZero()?E=D+E:E=A[_-D.length]+D+E}for(this.isZero()&&(E="0"+E);E.length%b!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}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,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(l,b){return this.toArrayLike(s,l,b)},"toBuffer")),i.prototype.toArray=o(function(l,b){return this.toArrayLike(Array,l,b)},"toArray");var I=o(function(l,b){return l.allocUnsafe?l.allocUnsafe(b):new l(b)},"allocate");i.prototype.toArrayLike=o(function(l,b,E){this._strip();var M=this.byteLength(),S=E||Math.max(1,M);t(M<=S,"byte array longer than desired length"),t(S>0,"Requested array length <= 0");var x=I(l,S),C=b==="le"?"LE":"BE";return this["_toArrayLike"+C](x,M),x},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,b){for(var E=0,M=0,S=0,x=0;S<this.length;S++){var C=this.words[S]<<x|M;l[E++]=C&255,E<l.length&&(l[E++]=C>>8&255),E<l.length&&(l[E++]=C>>16&255),x===6?(E<l.length&&(l[E++]=C>>24&255),M=0,x=0):(M=C>>>24,x+=2)}if(E<l.length)for(l[E++]=M;E<l.length;)l[E++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,b){for(var E=l.length-1,M=0,S=0,x=0;S<this.length;S++){var C=this.words[S]<<x|M;l[E--]=C&255,E>=0&&(l[E--]=C>>8&255),E>=0&&(l[E--]=C>>16&255),x===6?(E>=0&&(l[E--]=C>>24&255),M=0,x=0):(M=C>>>24,x+=2)}if(E>=0)for(l[E--]=M;E>=0;)l[E--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var b=l,E=0;return b>=4096&&(E+=13,b>>>=13),b>=64&&(E+=7,b>>>=7),b>=8&&(E+=4,b>>>=4),b>=2&&(E+=2,b>>>=2),E+b},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var b=l,E=0;return(b&8191)===0&&(E+=13,b>>>=13),(b&127)===0&&(E+=7,b>>>=7),(b&15)===0&&(E+=4,b>>>=4),(b&3)===0&&(E+=2,b>>>=2),(b&1)===0&&E++,E},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],b=this._countBits(l);return(this.length-1)*26+b},"bitLength");function B(g){for(var l=new Array(g.bitLength()),b=0;b<l.length;b++){var E=b/26|0,M=b%26;l[b]=g.words[E]>>>M&1}return l}o(B,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,b=0;b<this.length;b++){var E=this._zeroBits(this.words[b]);if(l+=E,E!==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 b=0;b<l.length;b++)this.words[b]=this.words[b]|l.words[b];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 b;this.length>l.length?b=l:b=this;for(var E=0;E<b.length;E++)this.words[E]=this.words[E]&l.words[E];return this.length=b.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 b,E;this.length>l.length?(b=this,E=l):(b=l,E=this);for(var M=0;M<E.length;M++)this.words[M]=b.words[M]^E.words[M];if(this!==b)for(;M<b.length;M++)this.words[M]=b.words[M];return this.length=b.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 b=Math.ceil(l/26)|0,E=l%26;this._expand(b),E>0&&b--;for(var M=0;M<b;M++)this.words[M]=~this.words[M]&67108863;return E>0&&(this.words[M]=~this.words[M]&67108863>>26-E),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,b){t(typeof l=="number"&&l>=0);var E=l/26|0,M=l%26;return this._expand(E+1),b?this.words[E]=this.words[E]|1<<M:this.words[E]=this.words[E]&~(1<<M),this._strip()},"setn"),i.prototype.iadd=o(function(l){var b;if(this.negative!==0&&l.negative===0)return this.negative=0,b=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,b=this.isub(l),l.negative=1,b._normSign();var E,M;this.length>l.length?(E=this,M=l):(E=l,M=this);for(var S=0,x=0;x<M.length;x++)b=(E.words[x]|0)+(M.words[x]|0)+S,this.words[x]=b&67108863,S=b>>>26;for(;S!==0&&x<E.length;x++)b=(E.words[x]|0)+S,this.words[x]=b&67108863,S=b>>>26;if(this.length=E.length,S!==0)this.words[this.length]=S,this.length++;else if(E!==this)for(;x<E.length;x++)this.words[x]=E.words[x];return this},"iadd"),i.prototype.add=o(function(l){var b;return l.negative!==0&&this.negative===0?(l.negative=0,b=this.sub(l),l.negative^=1,b):l.negative===0&&this.negative!==0?(this.negative=0,b=l.sub(this),this.negative=1,b):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 b=this.iadd(l);return l.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var E=this.cmp(l);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,S;E>0?(M=this,S=l):(M=l,S=this);for(var x=0,C=0;C<S.length;C++)b=(M.words[C]|0)-(S.words[C]|0)+x,x=b>>26,this.words[C]=b&67108863;for(;x!==0&&C<M.length;C++)b=(M.words[C]|0)+x,x=b>>26,this.words[C]=b&67108863;if(x===0&&C<M.length&&M!==this)for(;C<M.length;C++)this.words[C]=M.words[C];return this.length=Math.max(this.length,C),M!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function Y(g,l,b){b.negative=l.negative^g.negative;var E=g.length+l.length|0;b.length=E,E=E-1|0;var M=g.words[0]|0,S=l.words[0]|0,x=M*S,C=x&67108863,N=x/67108864|0;b.words[0]=C;for(var _=1;_<E;_++){for(var k=N>>>26,fe=N&67108863,D=Math.min(_,l.length-1),Q=Math.max(0,_-g.length+1);Q<=D;Q++){var se=_-Q|0;M=g.words[se]|0,S=l.words[Q]|0,x=M*S+fe,k+=x/67108864|0,fe=x&67108863}b.words[_]=fe|0,N=k|0}return N!==0?b.words[_]=N|0:b.length--,b._strip()}o(Y,"smallMulTo");var P=o(function(l,b,E){var M=l.words,S=b.words,x=E.words,C=0,N,_,k,fe=M[0]|0,D=fe&8191,Q=fe>>>13,se=M[1]|0,q=se&8191,z=se>>>13,G=M[2]|0,te=G&8191,ae=G>>>13,Ae=M[3]|0,ge=Ae&8191,ie=Ae>>>13,Me=M[4]|0,ue=Me&8191,ve=Me>>>13,W=M[5]|0,pe=W&8191,ke=W>>>13,ze=M[6]|0,Pe=ze&8191,Je=ze>>>13,gr=M[7]|0,le=gr&8191,oe=gr>>>13,F=M[8]|0,X=F&8191,me=F>>>13,ye=M[9]|0,we=ye&8191,Ie=ye>>>13,Ot=S[0]|0,Fe=Ot&8191,Ne=Ot>>>13,Ut=S[1]|0,Ve=Ut&8191,Ze=Ut>>>13,Pn=S[2]|0,st=Pn&8191,at=Pn>>>13,ii=S[3]|0,ft=ii&8191,rt=ii>>>13,oi=S[4]|0,ct=oi&8191,ut=oi>>>13,mn=S[5]|0,lt=mn&8191,Qe=mn>>>13,si=S[6]|0,ht=si&8191,dt=si>>>13,ai=S[7]|0,pt=ai&8191,mt=ai>>>13,fi=S[8]|0,bt=fi&8191,nt=fi>>>13,Bn=S[9]|0,jt=Bn&8191,Ht=Bn>>>13;E.negative=l.negative^b.negative,E.length=19,N=Math.imul(D,Fe),_=Math.imul(D,Ne),_=_+Math.imul(Q,Fe)|0,k=Math.imul(Q,Ne);var bn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(bn>>>26)|0,bn&=67108863,N=Math.imul(q,Fe),_=Math.imul(q,Ne),_=_+Math.imul(z,Fe)|0,k=Math.imul(z,Ne),N=N+Math.imul(D,Ve)|0,_=_+Math.imul(D,Ze)|0,_=_+Math.imul(Q,Ve)|0,k=k+Math.imul(Q,Ze)|0;var gn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(gn>>>26)|0,gn&=67108863,N=Math.imul(te,Fe),_=Math.imul(te,Ne),_=_+Math.imul(ae,Fe)|0,k=Math.imul(ae,Ne),N=N+Math.imul(q,Ve)|0,_=_+Math.imul(q,Ze)|0,_=_+Math.imul(z,Ve)|0,k=k+Math.imul(z,Ze)|0,N=N+Math.imul(D,st)|0,_=_+Math.imul(D,at)|0,_=_+Math.imul(Q,st)|0,k=k+Math.imul(Q,at)|0;var vn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(vn>>>26)|0,vn&=67108863,N=Math.imul(ge,Fe),_=Math.imul(ge,Ne),_=_+Math.imul(ie,Fe)|0,k=Math.imul(ie,Ne),N=N+Math.imul(te,Ve)|0,_=_+Math.imul(te,Ze)|0,_=_+Math.imul(ae,Ve)|0,k=k+Math.imul(ae,Ze)|0,N=N+Math.imul(q,st)|0,_=_+Math.imul(q,at)|0,_=_+Math.imul(z,st)|0,k=k+Math.imul(z,at)|0,N=N+Math.imul(D,ft)|0,_=_+Math.imul(D,rt)|0,_=_+Math.imul(Q,ft)|0,k=k+Math.imul(Q,rt)|0;var Fr=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,N=Math.imul(ue,Fe),_=Math.imul(ue,Ne),_=_+Math.imul(ve,Fe)|0,k=Math.imul(ve,Ne),N=N+Math.imul(ge,Ve)|0,_=_+Math.imul(ge,Ze)|0,_=_+Math.imul(ie,Ve)|0,k=k+Math.imul(ie,Ze)|0,N=N+Math.imul(te,st)|0,_=_+Math.imul(te,at)|0,_=_+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,N=N+Math.imul(q,ft)|0,_=_+Math.imul(q,rt)|0,_=_+Math.imul(z,ft)|0,k=k+Math.imul(z,rt)|0,N=N+Math.imul(D,ct)|0,_=_+Math.imul(D,ut)|0,_=_+Math.imul(Q,ct)|0,k=k+Math.imul(Q,ut)|0;var yn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(yn>>>26)|0,yn&=67108863,N=Math.imul(pe,Fe),_=Math.imul(pe,Ne),_=_+Math.imul(ke,Fe)|0,k=Math.imul(ke,Ne),N=N+Math.imul(ue,Ve)|0,_=_+Math.imul(ue,Ze)|0,_=_+Math.imul(ve,Ve)|0,k=k+Math.imul(ve,Ze)|0,N=N+Math.imul(ge,st)|0,_=_+Math.imul(ge,at)|0,_=_+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,N=N+Math.imul(te,ft)|0,_=_+Math.imul(te,rt)|0,_=_+Math.imul(ae,ft)|0,k=k+Math.imul(ae,rt)|0,N=N+Math.imul(q,ct)|0,_=_+Math.imul(q,ut)|0,_=_+Math.imul(z,ct)|0,k=k+Math.imul(z,ut)|0,N=N+Math.imul(D,lt)|0,_=_+Math.imul(D,Qe)|0,_=_+Math.imul(Q,lt)|0,k=k+Math.imul(Q,Qe)|0;var ci=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(ci>>>26)|0,ci&=67108863,N=Math.imul(Pe,Fe),_=Math.imul(Pe,Ne),_=_+Math.imul(Je,Fe)|0,k=Math.imul(Je,Ne),N=N+Math.imul(pe,Ve)|0,_=_+Math.imul(pe,Ze)|0,_=_+Math.imul(ke,Ve)|0,k=k+Math.imul(ke,Ze)|0,N=N+Math.imul(ue,st)|0,_=_+Math.imul(ue,at)|0,_=_+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,N=N+Math.imul(ge,ft)|0,_=_+Math.imul(ge,rt)|0,_=_+Math.imul(ie,ft)|0,k=k+Math.imul(ie,rt)|0,N=N+Math.imul(te,ct)|0,_=_+Math.imul(te,ut)|0,_=_+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,N=N+Math.imul(q,lt)|0,_=_+Math.imul(q,Qe)|0,_=_+Math.imul(z,lt)|0,k=k+Math.imul(z,Qe)|0,N=N+Math.imul(D,ht)|0,_=_+Math.imul(D,dt)|0,_=_+Math.imul(Q,ht)|0,k=k+Math.imul(Q,dt)|0;var Uo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,N=Math.imul(le,Fe),_=Math.imul(le,Ne),_=_+Math.imul(oe,Fe)|0,k=Math.imul(oe,Ne),N=N+Math.imul(Pe,Ve)|0,_=_+Math.imul(Pe,Ze)|0,_=_+Math.imul(Je,Ve)|0,k=k+Math.imul(Je,Ze)|0,N=N+Math.imul(pe,st)|0,_=_+Math.imul(pe,at)|0,_=_+Math.imul(ke,st)|0,k=k+Math.imul(ke,at)|0,N=N+Math.imul(ue,ft)|0,_=_+Math.imul(ue,rt)|0,_=_+Math.imul(ve,ft)|0,k=k+Math.imul(ve,rt)|0,N=N+Math.imul(ge,ct)|0,_=_+Math.imul(ge,ut)|0,_=_+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,N=N+Math.imul(te,lt)|0,_=_+Math.imul(te,Qe)|0,_=_+Math.imul(ae,lt)|0,k=k+Math.imul(ae,Qe)|0,N=N+Math.imul(q,ht)|0,_=_+Math.imul(q,dt)|0,_=_+Math.imul(z,ht)|0,k=k+Math.imul(z,dt)|0,N=N+Math.imul(D,pt)|0,_=_+Math.imul(D,mt)|0,_=_+Math.imul(Q,pt)|0,k=k+Math.imul(Q,mt)|0;var Fo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,N=Math.imul(X,Fe),_=Math.imul(X,Ne),_=_+Math.imul(me,Fe)|0,k=Math.imul(me,Ne),N=N+Math.imul(le,Ve)|0,_=_+Math.imul(le,Ze)|0,_=_+Math.imul(oe,Ve)|0,k=k+Math.imul(oe,Ze)|0,N=N+Math.imul(Pe,st)|0,_=_+Math.imul(Pe,at)|0,_=_+Math.imul(Je,st)|0,k=k+Math.imul(Je,at)|0,N=N+Math.imul(pe,ft)|0,_=_+Math.imul(pe,rt)|0,_=_+Math.imul(ke,ft)|0,k=k+Math.imul(ke,rt)|0,N=N+Math.imul(ue,ct)|0,_=_+Math.imul(ue,ut)|0,_=_+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,N=N+Math.imul(ge,lt)|0,_=_+Math.imul(ge,Qe)|0,_=_+Math.imul(ie,lt)|0,k=k+Math.imul(ie,Qe)|0,N=N+Math.imul(te,ht)|0,_=_+Math.imul(te,dt)|0,_=_+Math.imul(ae,ht)|0,k=k+Math.imul(ae,dt)|0,N=N+Math.imul(q,pt)|0,_=_+Math.imul(q,mt)|0,_=_+Math.imul(z,pt)|0,k=k+Math.imul(z,mt)|0,N=N+Math.imul(D,bt)|0,_=_+Math.imul(D,nt)|0,_=_+Math.imul(Q,bt)|0,k=k+Math.imul(Q,nt)|0;var $o=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+($o>>>26)|0,$o&=67108863,N=Math.imul(we,Fe),_=Math.imul(we,Ne),_=_+Math.imul(Ie,Fe)|0,k=Math.imul(Ie,Ne),N=N+Math.imul(X,Ve)|0,_=_+Math.imul(X,Ze)|0,_=_+Math.imul(me,Ve)|0,k=k+Math.imul(me,Ze)|0,N=N+Math.imul(le,st)|0,_=_+Math.imul(le,at)|0,_=_+Math.imul(oe,st)|0,k=k+Math.imul(oe,at)|0,N=N+Math.imul(Pe,ft)|0,_=_+Math.imul(Pe,rt)|0,_=_+Math.imul(Je,ft)|0,k=k+Math.imul(Je,rt)|0,N=N+Math.imul(pe,ct)|0,_=_+Math.imul(pe,ut)|0,_=_+Math.imul(ke,ct)|0,k=k+Math.imul(ke,ut)|0,N=N+Math.imul(ue,lt)|0,_=_+Math.imul(ue,Qe)|0,_=_+Math.imul(ve,lt)|0,k=k+Math.imul(ve,Qe)|0,N=N+Math.imul(ge,ht)|0,_=_+Math.imul(ge,dt)|0,_=_+Math.imul(ie,ht)|0,k=k+Math.imul(ie,dt)|0,N=N+Math.imul(te,pt)|0,_=_+Math.imul(te,mt)|0,_=_+Math.imul(ae,pt)|0,k=k+Math.imul(ae,mt)|0,N=N+Math.imul(q,bt)|0,_=_+Math.imul(q,nt)|0,_=_+Math.imul(z,bt)|0,k=k+Math.imul(z,nt)|0,N=N+Math.imul(D,jt)|0,_=_+Math.imul(D,Ht)|0,_=_+Math.imul(Q,jt)|0,k=k+Math.imul(Q,Ht)|0;var fo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(fo>>>26)|0,fo&=67108863,N=Math.imul(we,Ve),_=Math.imul(we,Ze),_=_+Math.imul(Ie,Ve)|0,k=Math.imul(Ie,Ze),N=N+Math.imul(X,st)|0,_=_+Math.imul(X,at)|0,_=_+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,N=N+Math.imul(le,ft)|0,_=_+Math.imul(le,rt)|0,_=_+Math.imul(oe,ft)|0,k=k+Math.imul(oe,rt)|0,N=N+Math.imul(Pe,ct)|0,_=_+Math.imul(Pe,ut)|0,_=_+Math.imul(Je,ct)|0,k=k+Math.imul(Je,ut)|0,N=N+Math.imul(pe,lt)|0,_=_+Math.imul(pe,Qe)|0,_=_+Math.imul(ke,lt)|0,k=k+Math.imul(ke,Qe)|0,N=N+Math.imul(ue,ht)|0,_=_+Math.imul(ue,dt)|0,_=_+Math.imul(ve,ht)|0,k=k+Math.imul(ve,dt)|0,N=N+Math.imul(ge,pt)|0,_=_+Math.imul(ge,mt)|0,_=_+Math.imul(ie,pt)|0,k=k+Math.imul(ie,mt)|0,N=N+Math.imul(te,bt)|0,_=_+Math.imul(te,nt)|0,_=_+Math.imul(ae,bt)|0,k=k+Math.imul(ae,nt)|0,N=N+Math.imul(q,jt)|0,_=_+Math.imul(q,Ht)|0,_=_+Math.imul(z,jt)|0,k=k+Math.imul(z,Ht)|0;var co=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(co>>>26)|0,co&=67108863,N=Math.imul(we,st),_=Math.imul(we,at),_=_+Math.imul(Ie,st)|0,k=Math.imul(Ie,at),N=N+Math.imul(X,ft)|0,_=_+Math.imul(X,rt)|0,_=_+Math.imul(me,ft)|0,k=k+Math.imul(me,rt)|0,N=N+Math.imul(le,ct)|0,_=_+Math.imul(le,ut)|0,_=_+Math.imul(oe,ct)|0,k=k+Math.imul(oe,ut)|0,N=N+Math.imul(Pe,lt)|0,_=_+Math.imul(Pe,Qe)|0,_=_+Math.imul(Je,lt)|0,k=k+Math.imul(Je,Qe)|0,N=N+Math.imul(pe,ht)|0,_=_+Math.imul(pe,dt)|0,_=_+Math.imul(ke,ht)|0,k=k+Math.imul(ke,dt)|0,N=N+Math.imul(ue,pt)|0,_=_+Math.imul(ue,mt)|0,_=_+Math.imul(ve,pt)|0,k=k+Math.imul(ve,mt)|0,N=N+Math.imul(ge,bt)|0,_=_+Math.imul(ge,nt)|0,_=_+Math.imul(ie,bt)|0,k=k+Math.imul(ie,nt)|0,N=N+Math.imul(te,jt)|0,_=_+Math.imul(te,Ht)|0,_=_+Math.imul(ae,jt)|0,k=k+Math.imul(ae,Ht)|0;var uo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(uo>>>26)|0,uo&=67108863,N=Math.imul(we,ft),_=Math.imul(we,rt),_=_+Math.imul(Ie,ft)|0,k=Math.imul(Ie,rt),N=N+Math.imul(X,ct)|0,_=_+Math.imul(X,ut)|0,_=_+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,N=N+Math.imul(le,lt)|0,_=_+Math.imul(le,Qe)|0,_=_+Math.imul(oe,lt)|0,k=k+Math.imul(oe,Qe)|0,N=N+Math.imul(Pe,ht)|0,_=_+Math.imul(Pe,dt)|0,_=_+Math.imul(Je,ht)|0,k=k+Math.imul(Je,dt)|0,N=N+Math.imul(pe,pt)|0,_=_+Math.imul(pe,mt)|0,_=_+Math.imul(ke,pt)|0,k=k+Math.imul(ke,mt)|0,N=N+Math.imul(ue,bt)|0,_=_+Math.imul(ue,nt)|0,_=_+Math.imul(ve,bt)|0,k=k+Math.imul(ve,nt)|0,N=N+Math.imul(ge,jt)|0,_=_+Math.imul(ge,Ht)|0,_=_+Math.imul(ie,jt)|0,k=k+Math.imul(ie,Ht)|0;var qo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(qo>>>26)|0,qo&=67108863,N=Math.imul(we,ct),_=Math.imul(we,ut),_=_+Math.imul(Ie,ct)|0,k=Math.imul(Ie,ut),N=N+Math.imul(X,lt)|0,_=_+Math.imul(X,Qe)|0,_=_+Math.imul(me,lt)|0,k=k+Math.imul(me,Qe)|0,N=N+Math.imul(le,ht)|0,_=_+Math.imul(le,dt)|0,_=_+Math.imul(oe,ht)|0,k=k+Math.imul(oe,dt)|0,N=N+Math.imul(Pe,pt)|0,_=_+Math.imul(Pe,mt)|0,_=_+Math.imul(Je,pt)|0,k=k+Math.imul(Je,mt)|0,N=N+Math.imul(pe,bt)|0,_=_+Math.imul(pe,nt)|0,_=_+Math.imul(ke,bt)|0,k=k+Math.imul(ke,nt)|0,N=N+Math.imul(ue,jt)|0,_=_+Math.imul(ue,Ht)|0,_=_+Math.imul(ve,jt)|0,k=k+Math.imul(ve,Ht)|0;var jo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(jo>>>26)|0,jo&=67108863,N=Math.imul(we,lt),_=Math.imul(we,Qe),_=_+Math.imul(Ie,lt)|0,k=Math.imul(Ie,Qe),N=N+Math.imul(X,ht)|0,_=_+Math.imul(X,dt)|0,_=_+Math.imul(me,ht)|0,k=k+Math.imul(me,dt)|0,N=N+Math.imul(le,pt)|0,_=_+Math.imul(le,mt)|0,_=_+Math.imul(oe,pt)|0,k=k+Math.imul(oe,mt)|0,N=N+Math.imul(Pe,bt)|0,_=_+Math.imul(Pe,nt)|0,_=_+Math.imul(Je,bt)|0,k=k+Math.imul(Je,nt)|0,N=N+Math.imul(pe,jt)|0,_=_+Math.imul(pe,Ht)|0,_=_+Math.imul(ke,jt)|0,k=k+Math.imul(ke,Ht)|0;var Ho=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,N=Math.imul(we,ht),_=Math.imul(we,dt),_=_+Math.imul(Ie,ht)|0,k=Math.imul(Ie,dt),N=N+Math.imul(X,pt)|0,_=_+Math.imul(X,mt)|0,_=_+Math.imul(me,pt)|0,k=k+Math.imul(me,mt)|0,N=N+Math.imul(le,bt)|0,_=_+Math.imul(le,nt)|0,_=_+Math.imul(oe,bt)|0,k=k+Math.imul(oe,nt)|0,N=N+Math.imul(Pe,jt)|0,_=_+Math.imul(Pe,Ht)|0,_=_+Math.imul(Je,jt)|0,k=k+Math.imul(Je,Ht)|0;var zo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(zo>>>26)|0,zo&=67108863,N=Math.imul(we,pt),_=Math.imul(we,mt),_=_+Math.imul(Ie,pt)|0,k=Math.imul(Ie,mt),N=N+Math.imul(X,bt)|0,_=_+Math.imul(X,nt)|0,_=_+Math.imul(me,bt)|0,k=k+Math.imul(me,nt)|0,N=N+Math.imul(le,jt)|0,_=_+Math.imul(le,Ht)|0,_=_+Math.imul(oe,jt)|0,k=k+Math.imul(oe,Ht)|0;var Bf=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Bf>>>26)|0,Bf&=67108863,N=Math.imul(we,bt),_=Math.imul(we,nt),_=_+Math.imul(Ie,bt)|0,k=Math.imul(Ie,nt),N=N+Math.imul(X,jt)|0,_=_+Math.imul(X,Ht)|0,_=_+Math.imul(me,jt)|0,k=k+Math.imul(me,Ht)|0;var Lf=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Lf>>>26)|0,Lf&=67108863,N=Math.imul(we,jt),_=Math.imul(we,Ht),_=_+Math.imul(Ie,jt)|0,k=Math.imul(Ie,Ht);var Uf=(C+N|0)+((_&8191)<<13)|0;return C=(k+(_>>>13)|0)+(Uf>>>26)|0,Uf&=67108863,x[0]=bn,x[1]=gn,x[2]=vn,x[3]=Fr,x[4]=yn,x[5]=ci,x[6]=Uo,x[7]=Fo,x[8]=$o,x[9]=fo,x[10]=co,x[11]=uo,x[12]=qo,x[13]=jo,x[14]=Ho,x[15]=zo,x[16]=Bf,x[17]=Lf,x[18]=Uf,C!==0&&(x[19]=C,E.length++),E},"comb10MulTo");Math.imul||(P=Y);function J(g,l,b){b.negative=l.negative^g.negative,b.length=g.length+l.length;for(var E=0,M=0,S=0;S<b.length-1;S++){var x=M;M=0;for(var C=E&67108863,N=Math.min(S,l.length-1),_=Math.max(0,S-g.length+1);_<=N;_++){var k=S-_,fe=g.words[k]|0,D=l.words[_]|0,Q=fe*D,se=Q&67108863;x=x+(Q/67108864|0)|0,se=se+C|0,C=se&67108863,x=x+(se>>>26)|0,M+=x>>>26,x&=67108863}b.words[S]=C,E=x,x=M}return E!==0?b.words[S]=E:b.length--,b._strip()}o(J,"bigMulTo");function ee(g,l,b){return J(g,l,b)}o(ee,"jumboMulTo"),i.prototype.mulTo=o(function(l,b){var E,M=this.length+l.length;return this.length===10&&l.length===10?E=P(this,l,b):M<63?E=Y(this,l,b):M<1024?E=J(this,l,b):E=ee(this,l,b),E},"mulTo");function Z(g,l){this.x=g,this.y=l}o(Z,"FFTM"),Z.prototype.makeRBT=o(function(l){for(var b=new Array(l),E=i.prototype._countBits(l)-1,M=0;M<l;M++)b[M]=this.revBin(M,E,l);return b},"makeRBT"),Z.prototype.revBin=o(function(l,b,E){if(l===0||l===E-1)return l;for(var M=0,S=0;S<b;S++)M|=(l&1)<<b-S-1,l>>=1;return M},"revBin"),Z.prototype.permute=o(function(l,b,E,M,S,x){for(var C=0;C<x;C++)M[C]=b[l[C]],S[C]=E[l[C]]},"permute"),Z.prototype.transform=o(function(l,b,E,M,S,x){this.permute(x,l,b,E,M,S);for(var C=1;C<S;C<<=1)for(var N=C<<1,_=Math.cos(2*Math.PI/N),k=Math.sin(2*Math.PI/N),fe=0;fe<S;fe+=N)for(var D=_,Q=k,se=0;se<C;se++){var q=E[fe+se],z=M[fe+se],G=E[fe+se+C],te=M[fe+se+C],ae=D*G-Q*te;te=D*te+Q*G,G=ae,E[fe+se]=q+G,M[fe+se]=z+te,E[fe+se+C]=q-G,M[fe+se+C]=z-te,se!==N&&(ae=_*D-k*Q,Q=_*Q+k*D,D=ae)}},"transform"),Z.prototype.guessLen13b=o(function(l,b){var E=Math.max(b,l)|1,M=E&1,S=0;for(E=E/2|0;E;E=E>>>1)S++;return 1<<S+1+M},"guessLen13b"),Z.prototype.conjugate=o(function(l,b,E){if(!(E<=1))for(var M=0;M<E/2;M++){var S=l[M];l[M]=l[E-M-1],l[E-M-1]=S,S=b[M],b[M]=-b[E-M-1],b[E-M-1]=-S}},"conjugate"),Z.prototype.normalize13b=o(function(l,b){for(var E=0,M=0;M<b/2;M++){var S=Math.round(l[2*M+1]/b)*8192+Math.round(l[2*M]/b)+E;l[M]=S&67108863,S<67108864?E=0:E=S/67108864|0}return l},"normalize13b"),Z.prototype.convert13b=o(function(l,b,E,M){for(var S=0,x=0;x<b;x++)S=S+(l[x]|0),E[2*x]=S&8191,S=S>>>13,E[2*x+1]=S&8191,S=S>>>13;for(x=2*b;x<M;++x)E[x]=0;t(S===0),t((S&-8192)===0)},"convert13b"),Z.prototype.stub=o(function(l){for(var b=new Array(l),E=0;E<l;E++)b[E]=0;return b},"stub"),Z.prototype.mulp=o(function(l,b,E){var M=2*this.guessLen13b(l.length,b.length),S=this.makeRBT(M),x=this.stub(M),C=new Array(M),N=new Array(M),_=new Array(M),k=new Array(M),fe=new Array(M),D=new Array(M),Q=E.words;Q.length=M,this.convert13b(l.words,l.length,C,M),this.convert13b(b.words,b.length,k,M),this.transform(C,x,N,_,M,S),this.transform(k,x,fe,D,M,S);for(var se=0;se<M;se++){var q=N[se]*fe[se]-_[se]*D[se];_[se]=N[se]*D[se]+_[se]*fe[se],N[se]=q}return this.conjugate(N,_,M),this.transform(N,_,Q,x,M,S),this.conjugate(Q,x,M),this.normalize13b(Q,M),E.negative=l.negative^b.negative,E.length=l.length+b.length,E._strip()},"mulp"),i.prototype.mul=o(function(l){var b=new i(null);return b.words=new Array(this.length+l.length),this.mulTo(l,b)},"mul"),i.prototype.mulf=o(function(l){var b=new i(null);return b.words=new Array(this.length+l.length),ee(this,l,b)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var b=l<0;b&&(l=-l),t(typeof l=="number"),t(l<67108864);for(var E=0,M=0;M<this.length;M++){var S=(this.words[M]|0)*l,x=(S&67108863)+(E&67108863);E>>=26,E+=S/67108864|0,E+=x>>>26,this.words[M]=x&67108863}return E!==0&&(this.words[M]=E,this.length++),b?this.ineg():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 b=B(l);if(b.length===0)return new i(1);for(var E=this,M=0;M<b.length&&b[M]===0;M++,E=E.sqr());if(++M<b.length)for(var S=E.sqr();M<b.length;M++,S=S.sqr())b[M]!==0&&(E=E.mul(S));return E},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var b=l%26,E=(l-b)/26,M=67108863>>>26-b<<26-b,S;if(b!==0){var x=0;for(S=0;S<this.length;S++){var C=this.words[S]&M,N=(this.words[S]|0)-C<<b;this.words[S]=N|x,x=C>>>26-b}x&&(this.words[S]=x,this.length++)}if(E!==0){for(S=this.length-1;S>=0;S--)this.words[S+E]=this.words[S];for(S=0;S<E;S++)this.words[S]=0;this.length+=E}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,b,E){t(typeof l=="number"&&l>=0);var M;b?M=(b-b%26)/26:M=0;var S=l%26,x=Math.min((l-S)/26,this.length),C=67108863^67108863>>>S<<S,N=E;if(M-=x,M=Math.max(0,M),N){for(var _=0;_<x;_++)N.words[_]=this.words[_];N.length=x}if(x!==0)if(this.length>x)for(this.length-=x,_=0;_<this.length;_++)this.words[_]=this.words[_+x];else this.words[0]=0,this.length=1;var k=0;for(_=this.length-1;_>=0&&(k!==0||_>=M);_--){var fe=this.words[_]|0;this.words[_]=k<<26-S|fe>>>S,k=fe&C}return N&&k!==0&&(N.words[N.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(l,b,E){return t(this.negative===0),this.iushrn(l,b,E)},"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 b=l%26,E=(l-b)/26,M=1<<b;if(this.length<=E)return!1;var S=this.words[E];return!!(S&M)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var b=l%26,E=(l-b)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(b!==0&&E++,this.length=Math.min(E,this.length),b!==0){var M=67108863^67108863>>>b<<b;this.words[this.length-1]&=M}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 b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+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 b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+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,b,E){var M=l.length+E,S;this._expand(M);var x,C=0;for(S=0;S<l.length;S++){x=(this.words[S+E]|0)+C;var N=(l.words[S]|0)*b;x-=N&67108863,C=(x>>26)-(N/67108864|0),this.words[S+E]=x&67108863}for(;S<this.length-E;S++)x=(this.words[S+E]|0)+C,C=x>>26,this.words[S+E]=x&67108863;if(C===0)return this._strip();for(t(C===-1),C=0,S=0;S<this.length;S++)x=-(this.words[S]|0)+C,C=x>>26,this.words[S]=x&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,b){var E=this.length-l.length,M=this.clone(),S=l,x=S.words[S.length-1]|0,C=this._countBits(x);E=26-C,E!==0&&(S=S.ushln(E),M.iushln(E),x=S.words[S.length-1]|0);var N=M.length-S.length,_;if(b!=="mod"){_=new i(null),_.length=N+1,_.words=new Array(_.length);for(var k=0;k<_.length;k++)_.words[k]=0}var fe=M.clone()._ishlnsubmul(S,1,N);fe.negative===0&&(M=fe,_&&(_.words[N]=1));for(var D=N-1;D>=0;D--){var Q=(M.words[S.length+D]|0)*67108864+(M.words[S.length+D-1]|0);for(Q=Math.min(Q/x|0,67108863),M._ishlnsubmul(S,Q,D);M.negative!==0;)Q--,M.negative=0,M._ishlnsubmul(S,1,D),M.isZero()||(M.negative^=1);_&&(_.words[D]=Q)}return _&&_._strip(),M._strip(),b!=="div"&&E!==0&&M.iushrn(E),{div:_||null,mod:M}},"_wordDiv"),i.prototype.divmod=o(function(l,b,E){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var M,S,x;return this.negative!==0&&l.negative===0?(x=this.neg().divmod(l,b),b!=="mod"&&(M=x.div.neg()),b!=="div"&&(S=x.mod.neg(),E&&S.negative!==0&&S.iadd(l)),{div:M,mod:S}):this.negative===0&&l.negative!==0?(x=this.divmod(l.neg(),b),b!=="mod"&&(M=x.div.neg()),{div:M,mod:x.mod}):(this.negative&l.negative)!==0?(x=this.neg().divmod(l.neg(),b),b!=="div"&&(S=x.mod.neg(),E&&S.negative!==0&&S.isub(l)),{div:x.div,mod:S}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?b==="div"?{div:this.divn(l.words[0]),mod:null}:b==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,b)},"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 b=this.divmod(l);if(b.mod.isZero())return b.div;var E=b.div.negative!==0?b.mod.isub(l):b.mod,M=l.ushrn(1),S=l.andln(1),x=E.cmp(M);return x<0||S===1&&x===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var b=l<0;b&&(l=-l),t(l<=67108863);for(var E=(1<<26)%l,M=0,S=this.length-1;S>=0;S--)M=(E*M+(this.words[S]|0))%l;return b?-M:M},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var b=l<0;b&&(l=-l),t(l<=67108863);for(var E=0,M=this.length-1;M>=0;M--){var S=(this.words[M]|0)+E*67108864;this.words[M]=S/l|0,E=S%l}return this._strip(),b?this.ineg():this},"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 b=this,E=l.clone();b.negative!==0?b=b.umod(l):b=b.clone();for(var M=new i(1),S=new i(0),x=new i(0),C=new i(1),N=0;b.isEven()&&E.isEven();)b.iushrn(1),E.iushrn(1),++N;for(var _=E.clone(),k=b.clone();!b.isZero();){for(var fe=0,D=1;(b.words[0]&D)===0&&fe<26;++fe,D<<=1);if(fe>0)for(b.iushrn(fe);fe-- >0;)(M.isOdd()||S.isOdd())&&(M.iadd(_),S.isub(k)),M.iushrn(1),S.iushrn(1);for(var Q=0,se=1;(E.words[0]&se)===0&&Q<26;++Q,se<<=1);if(Q>0)for(E.iushrn(Q);Q-- >0;)(x.isOdd()||C.isOdd())&&(x.iadd(_),C.isub(k)),x.iushrn(1),C.iushrn(1);b.cmp(E)>=0?(b.isub(E),M.isub(x),S.isub(C)):(E.isub(b),x.isub(M),C.isub(S))}return{a:x,b:C,gcd:E.iushln(N)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var b=this,E=l.clone();b.negative!==0?b=b.umod(l):b=b.clone();for(var M=new i(1),S=new i(0),x=E.clone();b.cmpn(1)>0&&E.cmpn(1)>0;){for(var C=0,N=1;(b.words[0]&N)===0&&C<26;++C,N<<=1);if(C>0)for(b.iushrn(C);C-- >0;)M.isOdd()&&M.iadd(x),M.iushrn(1);for(var _=0,k=1;(E.words[0]&k)===0&&_<26;++_,k<<=1);if(_>0)for(E.iushrn(_);_-- >0;)S.isOdd()&&S.iadd(x),S.iushrn(1);b.cmp(E)>=0?(b.isub(E),M.isub(S)):(E.isub(b),S.isub(M))}var fe;return b.cmpn(1)===0?fe=M:fe=S,fe.cmpn(0)<0&&fe.iadd(l),fe},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var b=this.clone(),E=l.clone();b.negative=0,E.negative=0;for(var M=0;b.isEven()&&E.isEven();M++)b.iushrn(1),E.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;E.isEven();)E.iushrn(1);var S=b.cmp(E);if(S<0){var x=b;b=E,E=x}else if(S===0||E.cmpn(1)===0)break;b.isub(E)}while(!0);return E.iushln(M)},"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 b=l%26,E=(l-b)/26,M=1<<b;if(this.length<=E)return this._expand(E+1),this.words[E]|=M,this;for(var S=M,x=E;S!==0&&x<this.length;x++){var C=this.words[x]|0;C+=S,S=C>>>26,C&=67108863,this.words[x]=C}return S!==0&&(this.words[x]=S,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 b=l<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var E;if(this.length>1)E=1;else{b&&(l=-l),t(l<=67108863,"Number is too big");var M=this.words[0]|0;E=M===l?0:M<l?-1:1}return this.negative!==0?-E|0:E},"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 b=this.ucmp(l);return this.negative!==0?-b|0:b},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var b=0,E=this.length-1;E>=0;E--){var M=this.words[E]|0,S=l.words[E]|0;if(M!==S){M<S?b=-1:M>S&&(b=1);break}}return b},"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 h(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 ne={k256:null,p224:null,p192:null,p25519:null};function V(g,l){this.name=g,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(V,"MPrime"),V.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),V.prototype.ireduce=o(function(l){var b=l,E;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),E=b.bitLength();while(E>this.n);var M=E<this.n?-1:b.ucmp(this.p);return M===0?(b.words[0]=0,b.length=1):M>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},"ireduce"),V.prototype.split=o(function(l,b){l.iushrn(this.n,0,b)},"split"),V.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function j(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(j,"K256"),n(j,V),j.prototype.split=o(function(l,b){for(var E=4194303,M=Math.min(l.length,9),S=0;S<M;S++)b.words[S]=l.words[S];if(b.length=M,l.length<=9){l.words[0]=0,l.length=1;return}var x=l.words[9];for(b.words[b.length++]=x&E,S=10;S<l.length;S++){var C=l.words[S]|0;l.words[S-10]=(C&E)<<4|x>>>22,x=C}x>>>=22,l.words[S-10]=x,x===0&&l.length>10?l.length-=10:l.length-=9},"split"),j.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var b=0,E=0;E<l.length;E++){var M=l.words[E]|0;b+=M*977,l.words[E]=b&67108863,b=M*64+(b/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function H(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(H,"P224"),n(H,V);function he(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(he,"P192"),n(he,V);function L(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,V),L.prototype.imulK=o(function(l){for(var b=0,E=0;E<l.length;E++){var M=(l.words[E]|0)*19+b,S=M&67108863;M>>>=26,l.words[E]=S,b=M}return b!==0&&(l.words[l.length++]=b),l},"imulK"),i._prime=o(function(l){if(ne[l])return ne[l];var b;if(l==="k256")b=new j;else if(l==="p224")b=new H;else if(l==="p192")b=new he;else if(l==="p25519")b=new L;else throw new Error("Unknown prime "+l);return ne[l]=b,b},"prime");function h(g){if(typeof g=="string"){var l=i._prime(g);this.m=l.p,this.prime=l}else t(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,b){t((l.negative|b.negative)===0,"red works only with positives"),t(l.red&&l.red===b.red,"red works only with red numbers")},"_verify2"),h.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(y(l,l.umod(this.m)._forceRed(this)),l)},"imod"),h.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),h.prototype.add=o(function(l,b){this._verify2(l,b);var E=l.add(b);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},"add"),h.prototype.iadd=o(function(l,b){this._verify2(l,b);var E=l.iadd(b);return E.cmp(this.m)>=0&&E.isub(this.m),E},"iadd"),h.prototype.sub=o(function(l,b){this._verify2(l,b);var E=l.sub(b);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},"sub"),h.prototype.isub=o(function(l,b){this._verify2(l,b);var E=l.isub(b);return E.cmpn(0)<0&&E.iadd(this.m),E},"isub"),h.prototype.shl=o(function(l,b){return this._verify1(l),this.imod(l.ushln(b))},"shl"),h.prototype.imul=o(function(l,b){return this._verify2(l,b),this.imod(l.imul(b))},"imul"),h.prototype.mul=o(function(l,b){return this._verify2(l,b),this.imod(l.mul(b))},"mul"),h.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),h.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),h.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var b=this.m.andln(3);if(t(b%2===1),b===3){var E=this.m.add(new i(1)).iushrn(2);return this.pow(l,E)}for(var M=this.m.subn(1),S=0;!M.isZero()&&M.andln(1)===0;)S++,M.iushrn(1);t(!M.isZero());var x=new i(1).toRed(this),C=x.redNeg(),N=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new i(2*_*_).toRed(this);this.pow(_,N).cmp(C)!==0;)_.redIAdd(C);for(var k=this.pow(_,M),fe=this.pow(l,M.addn(1).iushrn(1)),D=this.pow(l,M),Q=S;D.cmp(x)!==0;){for(var se=D,q=0;se.cmp(x)!==0;q++)se=se.redSqr();t(q<Q);var z=this.pow(k,new i(1).iushln(Q-q-1));fe=fe.redMul(z),k=z.redSqr(),D=D.redMul(k),Q=q}return fe},"sqrt"),h.prototype.invm=o(function(l){var b=l._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},"invm"),h.prototype.pow=o(function(l,b){if(b.isZero())return new i(1).toRed(this);if(b.cmpn(1)===0)return l.clone();var E=4,M=new Array(1<<E);M[0]=new i(1).toRed(this),M[1]=l;for(var S=2;S<M.length;S++)M[S]=this.mul(M[S-1],l);var x=M[0],C=0,N=0,_=b.bitLength()%26;for(_===0&&(_=26),S=b.length-1;S>=0;S--){for(var k=b.words[S],fe=_-1;fe>=0;fe--){var D=k>>fe&1;if(x!==M[0]&&(x=this.sqr(x)),D===0&&C===0){N=0;continue}C<<=1,C|=D,N++,!(N!==E&&(S!==0||fe!==0))&&(x=this.mul(x,M[C]),N=0,C=0)}_=26}return x},"pow"),h.prototype.convertTo=o(function(l){var b=l.umod(this.m);return b===l?b.clone():b},"convertTo"),h.prototype.convertFrom=o(function(l){var b=l.clone();return b.red=null,b},"convertFrom"),i.mont=o(function(l){return new v(l)},"mont");function v(g){h.call(this,g),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,h),v.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),v.prototype.convertFrom=o(function(l){var b=this.imod(l.mul(this.rinv));return b.red=null,b},"convertFrom"),v.prototype.imul=o(function(l,b){if(l.isZero()||b.isZero())return l.words[0]=0,l.length=1,l;var E=l.imul(b),M=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=E.isub(M).iushrn(this.shift),x=S;return S.cmp(this.m)>=0?x=S.isub(this.m):S.cmpn(0)<0&&(x=S.iadd(this.m)),x._forceRed(this)},"imul"),v.prototype.mul=o(function(l,b){if(l.isZero()||b.isZero())return new i(0)._forceRed(this);var E=l.mul(b),M=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=E.isub(M).iushrn(this.shift),x=S;return S.cmp(this.m)>=0?x=S.isub(this.m):S.cmpn(0)<0&&(x=S.iadd(this.m)),x._forceRed(this)},"mul"),v.prototype.invm=o(function(l){var b=this.imod(l._invmp(this.m).mul(this.r2));return b._forceRed(this)},"invm")})(typeof ag>"u"||ag,D8)});var m_=Re((PZ,p_)=>{p_.exports=_g;var d_=128,WU=127,JU=~WU,YU=Math.pow(2,31);function _g(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw _g.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=YU;)e[t++]=r&255|d_,r/=128;for(;r&JU;)e[t++]=r&255|d_,r>>>=7;return e[t]=r|0,_g.bytes=t-n+1,e}o(_g,"encode")});var v_=Re((BZ,g_)=>{g_.exports=Eg;var ZU=128,b_=127;function Eg(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u||i>49)throw Eg.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&b_)<<i:(f&b_)*Math.pow(2,i),i+=7}while(f>=ZU);return Eg.bytes=s-n,t}o(Eg,"read")});var x_=Re((LZ,y_)=>{var XU=Math.pow(2,7),QU=Math.pow(2,14),eF=Math.pow(2,21),tF=Math.pow(2,28),rF=Math.pow(2,35),nF=Math.pow(2,42),iF=Math.pow(2,49),oF=Math.pow(2,56),sF=Math.pow(2,63);y_.exports=function(r){return r<XU?1:r<QU?2:r<eF?3:r<tF?4:r<rF?5:r<nF?6:r<iF?7:r<oF?8:r<sF?9:10}});var Al=Re((UZ,w_)=>{w_.exports={encode:m_(),decode:v_(),encodingLength:x_()}});var R_=Re((HZ,D_)=>{"use strict";D_.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(f){return function(u,d){var y={key:u,value:f[u]},w={key:d,value:f[d]};return s(y,w)}}}(e.cmp),i=[];return o(function s(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var u,d;if(Array.isArray(f)){for(d="[",u=0;u<f.length;u++)u&&(d+=","),d+=s(f[u])||"null";return d+"]"}if(f===null)return"null";if(i.indexOf(f)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var y=i.push(f)-1,w=Object.keys(f).sort(n&&n(f));for(d="",u=0;u<w.length;u++){var A=w[u],O=s(f[A]);!O||(d&&(d+=","),d+=JSON.stringify(A)+":"+O)}return i.splice(y,1),"{"+d+"}"}},"stringify")(r)}});var Vc=Re((kl,jc)=>{var jF=200,Y_="__lodash_hash_undefined__",Z_=9007199254740991,Kg="[object Arguments]",HF="[object Array]",X_="[object Boolean]",Q_="[object Date]",zF="[object Error]",Vg="[object Function]",eE="[object GeneratorFunction]",F0="[object Map]",tE="[object Number]",Gg="[object Object]",F_="[object Promise]",rE="[object RegExp]",$0="[object Set]",nE="[object String]",iE="[object Symbol]",Fg="[object WeakMap]",oE="[object ArrayBuffer]",q0="[object DataView]",sE="[object Float32Array]",aE="[object Float64Array]",fE="[object Int8Array]",cE="[object Int16Array]",uE="[object Int32Array]",lE="[object Uint8Array]",hE="[object Uint8ClampedArray]",dE="[object Uint16Array]",pE="[object Uint32Array]",KF=/[\\^$.*+?()[\]{}|]/g,VF=/\w*$/,GF=/^\[object .+?Constructor\]$/,WF=/^(?:0|[1-9]\d*)$/,or={};or[Kg]=or[HF]=or[oE]=or[q0]=or[X_]=or[Q_]=or[sE]=or[aE]=or[fE]=or[cE]=or[uE]=or[F0]=or[tE]=or[Gg]=or[rE]=or[$0]=or[nE]=or[iE]=or[lE]=or[hE]=or[dE]=or[pE]=!0;or[zF]=or[Vg]=or[Fg]=!1;var JF=typeof global=="object"&&global&&global.Object===Object&&global,YF=typeof self=="object"&&self&&self.Object===Object&&self,bs=JF||YF||Function("return this")(),mE=typeof kl=="object"&&kl&&!kl.nodeType&&kl,$_=mE&&typeof jc=="object"&&jc&&!jc.nodeType&&jc,ZF=$_&&$_.exports===mE;function XF(r,e){return r.set(e[0],e[1]),r}o(XF,"addMapEntry");function QF(r,e){return r.add(e),r}o(QF,"addSetEntry");function e$(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(e$,"arrayEach");function t$(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(t$,"arrayPush");function bE(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(bE,"arrayReduce");function r$(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(r$,"baseTimes");function n$(r,e){return r?.[e]}o(n$,"getValue");function gE(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}o(gE,"isHostObject");function q_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(q_,"mapToArray");function Wg(r,e){return function(t){return r(e(t))}}o(Wg,"overArg");function j_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(j_,"setToArray");var i$=Array.prototype,o$=Function.prototype,j0=Object.prototype,Ug=bs["__core-js_shared__"],H_=function(){var r=/[^.]+$/.exec(Ug&&Ug.keys&&Ug.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),vE=o$.toString,ca=j0.hasOwnProperty,H0=j0.toString,s$=RegExp("^"+vE.call(ca).replace(KF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z_=ZF?bs.Buffer:void 0,K_=bs.Symbol,V_=bs.Uint8Array,a$=Wg(Object.getPrototypeOf,Object),f$=Object.create,c$=j0.propertyIsEnumerable,u$=i$.splice,G_=Object.getOwnPropertySymbols,l$=z_?z_.isBuffer:void 0,h$=Wg(Object.keys,Object),$g=Kc(bs,"DataView"),Il=Kc(bs,"Map"),qg=Kc(bs,"Promise"),jg=Kc(bs,"Set"),Hg=Kc(bs,"WeakMap"),Dl=Kc(Object,"create"),d$=bf($g),p$=bf(Il),m$=bf(qg),b$=bf(jg),g$=bf(Hg),W_=K_?K_.prototype:void 0,J_=W_?W_.valueOf:void 0;function mf(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(mf,"Hash");function v$(){this.__data__=Dl?Dl(null):{}}o(v$,"hashClear");function y$(r){return this.has(r)&&delete this.__data__[r]}o(y$,"hashDelete");function x$(r){var e=this.__data__;if(Dl){var t=e[r];return t===Y_?void 0:t}return ca.call(e,r)?e[r]:void 0}o(x$,"hashGet");function w$(r){var e=this.__data__;return Dl?e[r]!==void 0:ca.call(e,r)}o(w$,"hashHas");function _$(r,e){var t=this.__data__;return t[r]=Dl&&e===void 0?Y_:e,this}o(_$,"hashSet");mf.prototype.clear=v$;mf.prototype.delete=y$;mf.prototype.get=x$;mf.prototype.has=w$;mf.prototype.set=_$;function gs(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(gs,"ListCache");function E$(){this.__data__=[]}o(E$,"listCacheClear");function A$(r){var e=this.__data__,t=z0(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():u$.call(e,t,1),!0}o(A$,"listCacheDelete");function S$(r){var e=this.__data__,t=z0(e,r);return t<0?void 0:e[t][1]}o(S$,"listCacheGet");function M$(r){return z0(this.__data__,r)>-1}o(M$,"listCacheHas");function T$(r,e){var t=this.__data__,n=z0(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(T$,"listCacheSet");gs.prototype.clear=E$;gs.prototype.delete=A$;gs.prototype.get=S$;gs.prototype.has=M$;gs.prototype.set=T$;function Hc(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(Hc,"MapCache");function C$(){this.__data__={hash:new mf,map:new(Il||gs),string:new mf}}o(C$,"mapCacheClear");function k$(r){return K0(this,r).delete(r)}o(k$,"mapCacheDelete");function I$(r){return K0(this,r).get(r)}o(I$,"mapCacheGet");function D$(r){return K0(this,r).has(r)}o(D$,"mapCacheHas");function R$(r,e){return K0(this,r).set(r,e),this}o(R$,"mapCacheSet");Hc.prototype.clear=C$;Hc.prototype.delete=k$;Hc.prototype.get=I$;Hc.prototype.has=D$;Hc.prototype.set=R$;function zc(r){this.__data__=new gs(r)}o(zc,"Stack");function O$(){this.__data__=new gs}o(O$,"stackClear");function N$(r){return this.__data__.delete(r)}o(N$,"stackDelete");function P$(r){return this.__data__.get(r)}o(P$,"stackGet");function B$(r){return this.__data__.has(r)}o(B$,"stackHas");function L$(r,e){var t=this.__data__;if(t instanceof gs){var n=t.__data__;if(!Il||n.length<jF-1)return n.push([r,e]),this;t=this.__data__=new Hc(n)}return t.set(r,e),this}o(L$,"stackSet");zc.prototype.clear=O$;zc.prototype.delete=N$;zc.prototype.get=P$;zc.prototype.has=B$;zc.prototype.set=L$;function U$(r,e){var t=Yg(r)||fq(r)?r$(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||ca.call(r,s))&&!(i&&(s=="length"||iq(s,n)))&&t.push(s);return t}o(U$,"arrayLikeKeys");function yE(r,e,t){var n=r[e];(!(ca.call(r,e)&&EE(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(yE,"assignValue");function z0(r,e){for(var t=r.length;t--;)if(EE(r[t][0],e))return t;return-1}o(z0,"assocIndexOf");function F$(r,e){return r&&xE(e,Zg(e),r)}o(F$,"baseAssign");function zg(r,e,t,n,i,s,f){var u;if(n&&(u=s?n(r,i,s,f):n(r)),u!==void 0)return u;if(!V0(r))return r;var d=Yg(r);if(d){if(u=tq(r),!e)return X$(r,u)}else{var y=pf(r),w=y==Vg||y==eE;if(uq(r))return K$(r,e);if(y==Gg||y==Kg||w&&!s){if(gE(r))return s?r:{};if(u=rq(w?{}:r),!e)return Q$(r,F$(u,r))}else{if(!or[y])return s?r:{};u=nq(r,y,zg,e)}}f||(f=new zc);var A=f.get(r);if(A)return A;if(f.set(r,u),!d)var O=t?eq(r):Zg(r);return e$(O||r,function(R,I){O&&(I=R,R=r[I]),yE(u,I,zg(R,e,t,n,I,r,f))}),u}o(zg,"baseClone");function $$(r){return V0(r)?f$(r):{}}o($$,"baseCreate");function q$(r,e,t){var n=e(r);return Yg(r)?n:t$(n,t(r))}o(q$,"baseGetAllKeys");function j$(r){return H0.call(r)}o(j$,"baseGetTag");function H$(r){if(!V0(r)||sq(r))return!1;var e=SE(r)||gE(r)?s$:GF;return e.test(bf(r))}o(H$,"baseIsNative");function z$(r){if(!_E(r))return h$(r);var e=[];for(var t in Object(r))ca.call(r,t)&&t!="constructor"&&e.push(t);return e}o(z$,"baseKeys");function K$(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(K$,"cloneBuffer");function Jg(r){var e=new r.constructor(r.byteLength);return new V_(e).set(new V_(r)),e}o(Jg,"cloneArrayBuffer");function V$(r,e){var t=e?Jg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(V$,"cloneDataView");function G$(r,e,t){var n=e?t(q_(r),!0):q_(r);return bE(n,XF,new r.constructor)}o(G$,"cloneMap");function W$(r){var e=new r.constructor(r.source,VF.exec(r));return e.lastIndex=r.lastIndex,e}o(W$,"cloneRegExp");function J$(r,e,t){var n=e?t(j_(r),!0):j_(r);return bE(n,QF,new r.constructor)}o(J$,"cloneSet");function Y$(r){return J_?Object(J_.call(r)):{}}o(Y$,"cloneSymbol");function Z$(r,e){var t=e?Jg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Z$,"cloneTypedArray");function X$(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(X$,"copyArray");function xE(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var f=e[i],u=n?n(t[f],r[f],f,t,r):void 0;yE(t,f,u===void 0?r[f]:u)}return t}o(xE,"copyObject");function Q$(r,e){return xE(r,wE(r),e)}o(Q$,"copySymbols");function eq(r){return q$(r,Zg,wE)}o(eq,"getAllKeys");function K0(r,e){var t=r.__data__;return oq(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(K0,"getMapData");function Kc(r,e){var t=n$(r,e);return H$(t)?t:void 0}o(Kc,"getNative");var wE=G_?Wg(G_,Object):dq,pf=j$;($g&&pf(new $g(new ArrayBuffer(1)))!=q0||Il&&pf(new Il)!=F0||qg&&pf(qg.resolve())!=F_||jg&&pf(new jg)!=$0||Hg&&pf(new Hg)!=Fg)&&(pf=o(function(r){var e=H0.call(r),t=e==Gg?r.constructor:void 0,n=t?bf(t):void 0;if(n)switch(n){case d$:return q0;case p$:return F0;case m$:return F_;case b$:return $0;case g$:return Fg}return e},"getTag"));function tq(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&ca.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(tq,"initCloneArray");function rq(r){return typeof r.constructor=="function"&&!_E(r)?$$(a$(r)):{}}o(rq,"initCloneObject");function nq(r,e,t,n){var i=r.constructor;switch(e){case oE:return Jg(r);case X_:case Q_:return new i(+r);case q0:return V$(r,n);case sE:case aE:case fE:case cE:case uE:case lE:case hE:case dE:case pE:return Z$(r,n);case F0:return G$(r,n,t);case tE:case nE:return new i(r);case rE:return W$(r);case $0:return J$(r,n,t);case iE:return Y$(r)}}o(nq,"initCloneByTag");function iq(r,e){return e=e??Z_,!!e&&(typeof r=="number"||WF.test(r))&&r>-1&&r%1==0&&r<e}o(iq,"isIndex");function oq(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(oq,"isKeyable");function sq(r){return!!H_&&H_ in r}o(sq,"isMasked");function _E(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||j0;return r===t}o(_E,"isPrototype");function bf(r){if(r!=null){try{return vE.call(r)}catch{}try{return r+""}catch{}}return""}o(bf,"toSource");function aq(r){return zg(r,!0,!0)}o(aq,"cloneDeep");function EE(r,e){return r===e||r!==r&&e!==e}o(EE,"eq");function fq(r){return cq(r)&&ca.call(r,"callee")&&(!c$.call(r,"callee")||H0.call(r)==Kg)}o(fq,"isArguments");var Yg=Array.isArray;function AE(r){return r!=null&&lq(r.length)&&!SE(r)}o(AE,"isArrayLike");function cq(r){return hq(r)&&AE(r)}o(cq,"isArrayLikeObject");var uq=l$||pq;function SE(r){var e=V0(r)?H0.call(r):"";return e==Vg||e==eE}o(SE,"isFunction");function lq(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Z_}o(lq,"isLength");function V0(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(V0,"isObject");function hq(r){return!!r&&typeof r=="object"}o(hq,"isObjectLike");function Zg(r){return AE(r)?U$(r):z$(r)}o(Zg,"keys");function dq(){return[]}o(dq,"stubArray");function pq(){return!1}o(pq,"stubFalse");jc.exports=aq});var y9=Re((la,v9)=>{var vp=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,yp=function(){function r(){this.fetch=!1,this.DOMException=vp.DOMException}return o(r,"F"),r.prototype=vp,new r}();(function(r){var e=function(t){var n=typeof r<"u"&&r||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function s(h){return h&&DataView.prototype.isPrototypeOf(h)}if(o(s,"isDataView"),i.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function d(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}o(d,"normalizeName");function y(h){return typeof h!="string"&&(h=String(h)),h}o(y,"normalizeValue");function w(h){var v={next:function(){var g=h.shift();return{done:g===void 0,value:g}}};return i.iterable&&(v[Symbol.iterator]=function(){return v}),v}o(w,"iteratorFor");function A(h){this.map={},h instanceof A?h.forEach(function(v,g){this.append(g,v)},this):Array.isArray(h)?h.forEach(function(v){if(v.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+v.length);this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}o(A,"Headers"),A.prototype.append=function(h,v){h=d(h),v=y(v);var g=this.map[h];this.map[h]=g?g+", "+v:v},A.prototype.delete=function(h){delete this.map[d(h)]},A.prototype.get=function(h){return h=d(h),this.has(h)?this.map[h]:null},A.prototype.has=function(h){return this.map.hasOwnProperty(d(h))},A.prototype.set=function(h,v){this.map[d(h)]=y(v)},A.prototype.forEach=function(h,v){for(var g in this.map)this.map.hasOwnProperty(g)&&h.call(v,this.map[g],g,this)},A.prototype.keys=function(){var h=[];return this.forEach(function(v,g){h.push(g)}),w(h)},A.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),w(h)},A.prototype.entries=function(){var h=[];return this.forEach(function(v,g){h.push([g,v])}),w(h)},i.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function O(h){if(!h._noBody){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}}o(O,"consumed");function R(h){return new Promise(function(v,g){h.onload=function(){v(h.result)},h.onerror=function(){g(h.error)}})}o(R,"fileReaderReady");function I(h){var v=new FileReader,g=R(v);return v.readAsArrayBuffer(h),g}o(I,"readBlobAsArrayBuffer");function B(h){var v=new FileReader,g=R(v),l=/charset=([A-Za-z0-9_-]+)/.exec(h.type),b=l?l[1]:"utf-8";return v.readAsText(h,b),g}o(B,"readBlobAsText");function Y(h){for(var v=new Uint8Array(h),g=new Array(v.length),l=0;l<v.length;l++)g[l]=String.fromCharCode(v[l]);return g.join("")}o(Y,"readArrayBufferAsText");function P(h){if(h.slice)return h.slice(0);var v=new Uint8Array(h.byteLength);return v.set(new Uint8Array(h)),v.buffer}o(P,"bufferClone");function J(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:i.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:i.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():i.arrayBuffer&&i.blob&&s(h)?(this._bodyArrayBuffer=P(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||u(h))?this._bodyArrayBuffer=P(h):this._bodyText=h=Object.prototype.toString.call(h):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var h=O(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var h=O(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var h=O(this);if(h)return h;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(V)}),this.json=function(){return this.text().then(JSON.parse)},this}o(J,"Body");var ee=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Z(h){var v=h.toUpperCase();return ee.indexOf(v)>-1?v:h}o(Z,"normalizeMethod");function ne(h,v){if(!(this instanceof ne))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');v=v||{};var g=v.body;if(h instanceof ne){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new A(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!g&&h._bodyInit!=null&&(g=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new A(v.headers)),this.method=Z(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal||function(){if("AbortController"in n){var E=new AbortController;return E.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&g)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(g),(this.method==="GET"||this.method==="HEAD")&&(v.cache==="no-store"||v.cache==="no-cache")){var l=/([?&])_=[^&]*/;if(l.test(this.url))this.url=this.url.replace(l,"$1_="+new Date().getTime());else{var b=/\?/;this.url+=(b.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}o(ne,"Request"),ne.prototype.clone=function(){return new ne(this,{body:this._bodyInit})};function V(h){var v=new FormData;return h.trim().split("&").forEach(function(g){if(g){var l=g.split("="),b=l.shift().replace(/\+/g," "),E=l.join("=").replace(/\+/g," ");v.append(decodeURIComponent(b),decodeURIComponent(E))}}),v}o(V,"decode");function j(h){var v=new A,g=h.replace(/\r?\n[\t ]+/g," ");return g.split("\r").map(function(l){return l.indexOf(`
650
- `)===0?l.substr(1,l.length):l}).forEach(function(l){var b=l.split(":"),E=b.shift().trim();if(E){var M=b.join(":").trim();try{v.append(E,M)}catch(S){console.warn("Response "+S.message)}}}),v}o(j,"parseHeaders"),J.call(ne.prototype);function H(h,v){if(!(this instanceof H))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=v.statusText===void 0?"":""+v.statusText,this.headers=new A(v.headers),this.url=v.url||"",this._initBody(h)}o(H,"Response"),J.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},H.error=function(){var h=new H(null,{status:200,statusText:""});return h.ok=!1,h.status=0,h.type="error",h};var he=[301,302,303,307,308];H.redirect=function(h,v){if(he.indexOf(v)===-1)throw new RangeError("Invalid status code");return new H(null,{status:v,headers:{location:h}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(v,g){this.message=v,this.name=g;var l=Error(v);this.stack=l.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function L(h,v){return new Promise(function(g,l){var b=new ne(h,v);if(b.signal&&b.signal.aborted)return l(new t.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function M(){E.abort()}o(M,"abortXhr"),E.onload=function(){var C={statusText:E.statusText,headers:j(E.getAllResponseHeaders()||"")};b.url.indexOf("file://")===0&&(E.status<200||E.status>599)?C.status=200:C.status=E.status,C.url="responseURL"in E?E.responseURL:C.headers.get("X-Request-URL");var N="response"in E?E.response:E.responseText;setTimeout(function(){g(new H(N,C))},0)},E.onerror=function(){setTimeout(function(){l(new TypeError("Network request failed"))},0)},E.ontimeout=function(){setTimeout(function(){l(new TypeError("Network request timed out"))},0)},E.onabort=function(){setTimeout(function(){l(new t.DOMException("Aborted","AbortError"))},0)};function S(C){try{return C===""&&n.location.href?n.location.href:C}catch{return C}}if(o(S,"fixUrl"),E.open(b.method,S(b.url),!0),b.credentials==="include"?E.withCredentials=!0:b.credentials==="omit"&&(E.withCredentials=!1),"responseType"in E&&(i.blob?E.responseType="blob":i.arrayBuffer&&(E.responseType="arraybuffer")),v&&typeof v.headers=="object"&&!(v.headers instanceof A||n.Headers&&v.headers instanceof n.Headers)){var x=[];Object.getOwnPropertyNames(v.headers).forEach(function(C){x.push(d(C)),E.setRequestHeader(C,y(v.headers[C]))}),b.headers.forEach(function(C,N){x.indexOf(N)===-1&&E.setRequestHeader(N,C)})}else b.headers.forEach(function(C,N){E.setRequestHeader(N,C)});b.signal&&(b.signal.addEventListener("abort",M),E.onreadystatechange=function(){E.readyState===4&&b.signal.removeEventListener("abort",M)}),E.send(typeof b._bodyInit>"u"?null:b._bodyInit)})}return o(L,"fetch"),L.polyfill=!0,n.fetch||(n.fetch=L,n.Headers=A,n.Request=ne,n.Response=H),t.Headers=A,t.Request=ne,t.Response=H,t.fetch=L,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(yp);yp.fetch.ponyfill=!0;delete yp.fetch.polyfill;var iu=vp.fetch?vp:yp;la=iu.fetch;la.default=iu.fetch;la.fetch=iu.fetch;la.Headers=iu.Headers;la.Request=iu.Request;la.Response=iu.Response;v9.exports=la});var I9=Re((Mne,k9)=>{"use strict";var Qq=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=nj(n),this._batchScheduleFn=ij(n),this._cacheKeyFn=oj(n),this._cacheMap=sj(n),this._batch=null,this.name=aj(n)}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=tj(this),s=this._cacheMap,f;if(s){f=this._cacheKeyFn(n);var u=s.get(f);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(w){d.push(function(){w(u)})})}}i.keys.push(n);var y=new Promise(function(w,A){i.callbacks.push({resolve:w,reject:A})});return s&&s.set(f,y),y},"load"),e.loadMany=o(function(n){if(!C9(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(f){return f}));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 f=this._cacheKeyFn(n);if(s.get(f)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),s.set(f,u)}}return this},"prime"),r}(),ej=typeof process=="object"&&typeof process.nextTick=="function"?function(r){Av||(Av=Promise.resolve()),Av.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},Av;function tj(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize)return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){rj(r,t)}),t}o(tj,"getCurrentBatch");function rj(r,e){if(e.hasDispatched=!0,e.keys.length===0){Mv(e);return}var t;try{t=r._batchLoadFn(e.keys)}catch(n){return Sv(r,e,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(n)+".")))}if(!t||typeof t.then!="function")return Sv(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(!C9(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."+(`
649
+ `}),l},"errorsToAscii"),Z=!1,ne=!1,V=!1,j=!1,H=0,he;if(this.errors=[],t.isBuffer(e))this.chars=f.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=f.decode("STRING",e);else throw new Error(`${n}input source is not a string, byte Buffer or character array`);this.sabnf=f.encode("STRING",this.chars),this.scan=o(function(h,v){this.lines=u(this.chars,this.errors,h,v),Z=!0},"scan"),this.parse=o(function(h,v,g){if(!Z)throw new Error(`${n}grammar not scanned`);d.syntax(this.chars,this.lines,this.errors,h,v,g),ne=!0},"parse"),this.translate=o(function(){if(!ne)throw new Error(`${n}grammar not scanned and parsed`);let h=d.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=h.rules,this.udts=h.udts,he=h.lineMap,V=!0)},"translate"),this.attributes=o(function(){if(!V)throw new Error(`${n}grammar not scanned, parsed and translated`);return H=y(this.rules,this.udts,he,this.errors),j=!0,H},"attrs"),this.generate=o(function(h){if(this.lines=u(this.chars,this.errors,h),this.errors.length||(d.syntax(this.chars,this.lines,this.errors,h),this.errors.length))return;let v=d.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=v.rules,this.udts=v.udts,he=v.lineMap,H=y(this.rules,this.udts,he,this.errors),j=!0)},"generate"),this.displayRules=o(function(h="index"){if(!V)throw new Error(`${n}grammar not scanned, parsed and translated`);return R(this.rules,this.udts,h)},"displayRules"),this.displayRuleDependencies=o(function(h="index"){if(!j)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return O(h)},"displayRuleDependencies"),this.displayAttributes=o(function(h="index"){if(!j)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return H&&A(h),w(h)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!j)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return A()},"displayAttributeErrors"),this.toSource=o(function(h=void 0){if(!j)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${n}can't generate parser source - attributes have ${H} errors`);return d.generateSource(this.chars,this.lines,this.rules,this.udts,h)},"toSource"),this.toObject=o(function(){if(!j)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${n}can't generate parser source - attributes have ${H} errors`);return d.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return ee(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(h){return J(this.errors,this.lines,this.chars,h)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return Y(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return P(this.lines)},"linesToHtmlFunc")},"api")});var fg=Re((D8,ag)=>{(function(r,e){"use strict";function t(g,l){if(!g)throw new Error(l||"Assertion failed")}o(t,"assert");function n(g,l){g.super_=l;var b=o(function(){},"TempCtor");b.prototype=l.prototype,g.prototype=new b,g.prototype.constructor=g}o(n,"inherits");function i(g,l,b){if(i.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((l==="le"||l==="be")&&(b=l,l=10),this._init(g||0,l||10,b||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=w1().Buffer}catch{}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,b){return l.cmp(b)>0?l:b},"max"),i.min=o(function(l,b){return l.cmp(b)<0?l:b},"min"),i.prototype._init=o(function(l,b,E){if(typeof l=="number")return this._initNumber(l,b,E);if(typeof l=="object")return this._initArray(l,b,E);b==="hex"&&(b=16),t(b===(b|0)&&b>=2&&b<=36),l=l.toString().replace(/\s+/g,"");var M=0;l[0]==="-"&&(M++,this.negative=1),M<l.length&&(b===16?this._parseHex(l,M,E):(this._parseBase(l,b,M),E==="le"&&this._initArray(this.toArray(),b,E)))},"init"),i.prototype._initNumber=o(function(l,b,E){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),E==="le"&&this._initArray(this.toArray(),b,E)},"_initNumber"),i.prototype._initArray=o(function(l,b,E){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 M=0;M<this.length;M++)this.words[M]=0;var S,x,C=0;if(E==="be")for(M=l.length-1,S=0;M>=0;M-=3)x=l[M]|l[M-1]<<8|l[M-2]<<16,this.words[S]|=x<<C&67108863,this.words[S+1]=x>>>26-C&67108863,C+=24,C>=26&&(C-=26,S++);else if(E==="le")for(M=0,S=0;M<l.length;M+=3)x=l[M]|l[M+1]<<8|l[M+2]<<16,this.words[S]|=x<<C&67108863,this.words[S+1]=x>>>26-C&67108863,C+=24,C>=26&&(C-=26,S++);return this._strip()},"_initArray");function f(g,l){var b=g.charCodeAt(l);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;t(!1,"Invalid character in "+g)}o(f,"parseHex4Bits");function u(g,l,b){var E=f(g,b);return b-1>=l&&(E|=f(g,b-1)<<4),E}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,b,E){this.length=Math.ceil((l.length-b)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var S=0,x=0,C;if(E==="be")for(M=l.length-1;M>=b;M-=2)C=u(l,b,M)<<S,this.words[x]|=C&67108863,S>=18?(S-=18,x+=1,this.words[x]|=C>>>26):S+=8;else{var N=l.length-b;for(M=N%2===0?b+1:b;M<l.length;M+=2)C=u(l,b,M)<<S,this.words[x]|=C&67108863,S>=18?(S-=18,x+=1,this.words[x]|=C>>>26):S+=8}this._strip()},"_parseHex");function d(g,l,b,E){for(var M=0,S=0,x=Math.min(g.length,b),C=l;C<x;C++){var N=g.charCodeAt(C)-48;M*=E,N>=49?S=N-49+10:N>=17?S=N-17+10:S=N,t(N>=0&&S<E,"Invalid character"),M+=S}return M}o(d,"parseBase"),i.prototype._parseBase=o(function(l,b,E){this.words=[0],this.length=1;for(var M=0,S=1;S<=67108863;S*=b)M++;M--,S=S/b|0;for(var x=l.length-E,C=x%M,N=Math.min(x,x-C)+E,_=0,k=E;k<N;k+=M)_=d(l,k,k+M,b),this.imuln(S),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_);if(C!==0){var fe=1;for(_=d(l,k,l.length,b),k=0;k<C;k++)fe*=b;this.imuln(fe),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_)}this._strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var b=0;b<this.length;b++)l.words[b]=this.words[b];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy");function y(g,l){g.words=l.words,g.length=l.length,g.negative=l.negative,g.red=l.red}if(o(y,"move"),i.prototype._move=o(function(l){y(l,this)},"_move"),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"),typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{i.prototype.inspect=w}else i.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(w,"inspect");var A=["","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"],O=[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],R=[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,b){l=l||10,b=b|0||1;var E;if(l===16||l==="hex"){E="";for(var M=0,S=0,x=0;x<this.length;x++){var C=this.words[x],N=((C<<M|S)&16777215).toString(16);S=C>>>24-M&16777215,M+=2,M>=26&&(M-=26,x--),S!==0||x!==this.length-1?E=A[6-N.length]+N+E:E=N+E}for(S!==0&&(E=S.toString(16)+E);E.length%b!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(l===(l|0)&&l>=2&&l<=36){var _=O[l],k=R[l];E="";var fe=this.clone();for(fe.negative=0;!fe.isZero();){var D=fe.modrn(k).toString(l);fe=fe.idivn(k),fe.isZero()?E=D+E:E=A[_-D.length]+D+E}for(this.isZero()&&(E="0"+E);E.length%b!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}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,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(l,b){return this.toArrayLike(s,l,b)},"toBuffer")),i.prototype.toArray=o(function(l,b){return this.toArrayLike(Array,l,b)},"toArray");var I=o(function(l,b){return l.allocUnsafe?l.allocUnsafe(b):new l(b)},"allocate");i.prototype.toArrayLike=o(function(l,b,E){this._strip();var M=this.byteLength(),S=E||Math.max(1,M);t(M<=S,"byte array longer than desired length"),t(S>0,"Requested array length <= 0");var x=I(l,S),C=b==="le"?"LE":"BE";return this["_toArrayLike"+C](x,M),x},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,b){for(var E=0,M=0,S=0,x=0;S<this.length;S++){var C=this.words[S]<<x|M;l[E++]=C&255,E<l.length&&(l[E++]=C>>8&255),E<l.length&&(l[E++]=C>>16&255),x===6?(E<l.length&&(l[E++]=C>>24&255),M=0,x=0):(M=C>>>24,x+=2)}if(E<l.length)for(l[E++]=M;E<l.length;)l[E++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,b){for(var E=l.length-1,M=0,S=0,x=0;S<this.length;S++){var C=this.words[S]<<x|M;l[E--]=C&255,E>=0&&(l[E--]=C>>8&255),E>=0&&(l[E--]=C>>16&255),x===6?(E>=0&&(l[E--]=C>>24&255),M=0,x=0):(M=C>>>24,x+=2)}if(E>=0)for(l[E--]=M;E>=0;)l[E--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var b=l,E=0;return b>=4096&&(E+=13,b>>>=13),b>=64&&(E+=7,b>>>=7),b>=8&&(E+=4,b>>>=4),b>=2&&(E+=2,b>>>=2),E+b},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var b=l,E=0;return(b&8191)===0&&(E+=13,b>>>=13),(b&127)===0&&(E+=7,b>>>=7),(b&15)===0&&(E+=4,b>>>=4),(b&3)===0&&(E+=2,b>>>=2),(b&1)===0&&E++,E},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],b=this._countBits(l);return(this.length-1)*26+b},"bitLength");function B(g){for(var l=new Array(g.bitLength()),b=0;b<l.length;b++){var E=b/26|0,M=b%26;l[b]=g.words[E]>>>M&1}return l}o(B,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,b=0;b<this.length;b++){var E=this._zeroBits(this.words[b]);if(l+=E,E!==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 b=0;b<l.length;b++)this.words[b]=this.words[b]|l.words[b];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 b;this.length>l.length?b=l:b=this;for(var E=0;E<b.length;E++)this.words[E]=this.words[E]&l.words[E];return this.length=b.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 b,E;this.length>l.length?(b=this,E=l):(b=l,E=this);for(var M=0;M<E.length;M++)this.words[M]=b.words[M]^E.words[M];if(this!==b)for(;M<b.length;M++)this.words[M]=b.words[M];return this.length=b.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 b=Math.ceil(l/26)|0,E=l%26;this._expand(b),E>0&&b--;for(var M=0;M<b;M++)this.words[M]=~this.words[M]&67108863;return E>0&&(this.words[M]=~this.words[M]&67108863>>26-E),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,b){t(typeof l=="number"&&l>=0);var E=l/26|0,M=l%26;return this._expand(E+1),b?this.words[E]=this.words[E]|1<<M:this.words[E]=this.words[E]&~(1<<M),this._strip()},"setn"),i.prototype.iadd=o(function(l){var b;if(this.negative!==0&&l.negative===0)return this.negative=0,b=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,b=this.isub(l),l.negative=1,b._normSign();var E,M;this.length>l.length?(E=this,M=l):(E=l,M=this);for(var S=0,x=0;x<M.length;x++)b=(E.words[x]|0)+(M.words[x]|0)+S,this.words[x]=b&67108863,S=b>>>26;for(;S!==0&&x<E.length;x++)b=(E.words[x]|0)+S,this.words[x]=b&67108863,S=b>>>26;if(this.length=E.length,S!==0)this.words[this.length]=S,this.length++;else if(E!==this)for(;x<E.length;x++)this.words[x]=E.words[x];return this},"iadd"),i.prototype.add=o(function(l){var b;return l.negative!==0&&this.negative===0?(l.negative=0,b=this.sub(l),l.negative^=1,b):l.negative===0&&this.negative!==0?(this.negative=0,b=l.sub(this),this.negative=1,b):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 b=this.iadd(l);return l.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var E=this.cmp(l);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,S;E>0?(M=this,S=l):(M=l,S=this);for(var x=0,C=0;C<S.length;C++)b=(M.words[C]|0)-(S.words[C]|0)+x,x=b>>26,this.words[C]=b&67108863;for(;x!==0&&C<M.length;C++)b=(M.words[C]|0)+x,x=b>>26,this.words[C]=b&67108863;if(x===0&&C<M.length&&M!==this)for(;C<M.length;C++)this.words[C]=M.words[C];return this.length=Math.max(this.length,C),M!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function Y(g,l,b){b.negative=l.negative^g.negative;var E=g.length+l.length|0;b.length=E,E=E-1|0;var M=g.words[0]|0,S=l.words[0]|0,x=M*S,C=x&67108863,N=x/67108864|0;b.words[0]=C;for(var _=1;_<E;_++){for(var k=N>>>26,fe=N&67108863,D=Math.min(_,l.length-1),Q=Math.max(0,_-g.length+1);Q<=D;Q++){var se=_-Q|0;M=g.words[se]|0,S=l.words[Q]|0,x=M*S+fe,k+=x/67108864|0,fe=x&67108863}b.words[_]=fe|0,N=k|0}return N!==0?b.words[_]=N|0:b.length--,b._strip()}o(Y,"smallMulTo");var P=o(function(l,b,E){var M=l.words,S=b.words,x=E.words,C=0,N,_,k,fe=M[0]|0,D=fe&8191,Q=fe>>>13,se=M[1]|0,q=se&8191,z=se>>>13,G=M[2]|0,te=G&8191,ae=G>>>13,Ae=M[3]|0,ge=Ae&8191,ie=Ae>>>13,Me=M[4]|0,ue=Me&8191,ve=Me>>>13,W=M[5]|0,pe=W&8191,ke=W>>>13,ze=M[6]|0,Pe=ze&8191,Je=ze>>>13,gr=M[7]|0,le=gr&8191,oe=gr>>>13,F=M[8]|0,X=F&8191,me=F>>>13,ye=M[9]|0,we=ye&8191,Ie=ye>>>13,Ot=S[0]|0,Fe=Ot&8191,Ne=Ot>>>13,Ut=S[1]|0,Ve=Ut&8191,Ze=Ut>>>13,Pn=S[2]|0,st=Pn&8191,at=Pn>>>13,ii=S[3]|0,ft=ii&8191,rt=ii>>>13,oi=S[4]|0,ct=oi&8191,ut=oi>>>13,mn=S[5]|0,lt=mn&8191,Qe=mn>>>13,si=S[6]|0,ht=si&8191,dt=si>>>13,ai=S[7]|0,pt=ai&8191,mt=ai>>>13,fi=S[8]|0,bt=fi&8191,nt=fi>>>13,Bn=S[9]|0,jt=Bn&8191,Ht=Bn>>>13;E.negative=l.negative^b.negative,E.length=19,N=Math.imul(D,Fe),_=Math.imul(D,Ne),_=_+Math.imul(Q,Fe)|0,k=Math.imul(Q,Ne);var bn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(bn>>>26)|0,bn&=67108863,N=Math.imul(q,Fe),_=Math.imul(q,Ne),_=_+Math.imul(z,Fe)|0,k=Math.imul(z,Ne),N=N+Math.imul(D,Ve)|0,_=_+Math.imul(D,Ze)|0,_=_+Math.imul(Q,Ve)|0,k=k+Math.imul(Q,Ze)|0;var gn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(gn>>>26)|0,gn&=67108863,N=Math.imul(te,Fe),_=Math.imul(te,Ne),_=_+Math.imul(ae,Fe)|0,k=Math.imul(ae,Ne),N=N+Math.imul(q,Ve)|0,_=_+Math.imul(q,Ze)|0,_=_+Math.imul(z,Ve)|0,k=k+Math.imul(z,Ze)|0,N=N+Math.imul(D,st)|0,_=_+Math.imul(D,at)|0,_=_+Math.imul(Q,st)|0,k=k+Math.imul(Q,at)|0;var vn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(vn>>>26)|0,vn&=67108863,N=Math.imul(ge,Fe),_=Math.imul(ge,Ne),_=_+Math.imul(ie,Fe)|0,k=Math.imul(ie,Ne),N=N+Math.imul(te,Ve)|0,_=_+Math.imul(te,Ze)|0,_=_+Math.imul(ae,Ve)|0,k=k+Math.imul(ae,Ze)|0,N=N+Math.imul(q,st)|0,_=_+Math.imul(q,at)|0,_=_+Math.imul(z,st)|0,k=k+Math.imul(z,at)|0,N=N+Math.imul(D,ft)|0,_=_+Math.imul(D,rt)|0,_=_+Math.imul(Q,ft)|0,k=k+Math.imul(Q,rt)|0;var Fr=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,N=Math.imul(ue,Fe),_=Math.imul(ue,Ne),_=_+Math.imul(ve,Fe)|0,k=Math.imul(ve,Ne),N=N+Math.imul(ge,Ve)|0,_=_+Math.imul(ge,Ze)|0,_=_+Math.imul(ie,Ve)|0,k=k+Math.imul(ie,Ze)|0,N=N+Math.imul(te,st)|0,_=_+Math.imul(te,at)|0,_=_+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,N=N+Math.imul(q,ft)|0,_=_+Math.imul(q,rt)|0,_=_+Math.imul(z,ft)|0,k=k+Math.imul(z,rt)|0,N=N+Math.imul(D,ct)|0,_=_+Math.imul(D,ut)|0,_=_+Math.imul(Q,ct)|0,k=k+Math.imul(Q,ut)|0;var yn=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(yn>>>26)|0,yn&=67108863,N=Math.imul(pe,Fe),_=Math.imul(pe,Ne),_=_+Math.imul(ke,Fe)|0,k=Math.imul(ke,Ne),N=N+Math.imul(ue,Ve)|0,_=_+Math.imul(ue,Ze)|0,_=_+Math.imul(ve,Ve)|0,k=k+Math.imul(ve,Ze)|0,N=N+Math.imul(ge,st)|0,_=_+Math.imul(ge,at)|0,_=_+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,N=N+Math.imul(te,ft)|0,_=_+Math.imul(te,rt)|0,_=_+Math.imul(ae,ft)|0,k=k+Math.imul(ae,rt)|0,N=N+Math.imul(q,ct)|0,_=_+Math.imul(q,ut)|0,_=_+Math.imul(z,ct)|0,k=k+Math.imul(z,ut)|0,N=N+Math.imul(D,lt)|0,_=_+Math.imul(D,Qe)|0,_=_+Math.imul(Q,lt)|0,k=k+Math.imul(Q,Qe)|0;var ci=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(ci>>>26)|0,ci&=67108863,N=Math.imul(Pe,Fe),_=Math.imul(Pe,Ne),_=_+Math.imul(Je,Fe)|0,k=Math.imul(Je,Ne),N=N+Math.imul(pe,Ve)|0,_=_+Math.imul(pe,Ze)|0,_=_+Math.imul(ke,Ve)|0,k=k+Math.imul(ke,Ze)|0,N=N+Math.imul(ue,st)|0,_=_+Math.imul(ue,at)|0,_=_+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,N=N+Math.imul(ge,ft)|0,_=_+Math.imul(ge,rt)|0,_=_+Math.imul(ie,ft)|0,k=k+Math.imul(ie,rt)|0,N=N+Math.imul(te,ct)|0,_=_+Math.imul(te,ut)|0,_=_+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,N=N+Math.imul(q,lt)|0,_=_+Math.imul(q,Qe)|0,_=_+Math.imul(z,lt)|0,k=k+Math.imul(z,Qe)|0,N=N+Math.imul(D,ht)|0,_=_+Math.imul(D,dt)|0,_=_+Math.imul(Q,ht)|0,k=k+Math.imul(Q,dt)|0;var Uo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,N=Math.imul(le,Fe),_=Math.imul(le,Ne),_=_+Math.imul(oe,Fe)|0,k=Math.imul(oe,Ne),N=N+Math.imul(Pe,Ve)|0,_=_+Math.imul(Pe,Ze)|0,_=_+Math.imul(Je,Ve)|0,k=k+Math.imul(Je,Ze)|0,N=N+Math.imul(pe,st)|0,_=_+Math.imul(pe,at)|0,_=_+Math.imul(ke,st)|0,k=k+Math.imul(ke,at)|0,N=N+Math.imul(ue,ft)|0,_=_+Math.imul(ue,rt)|0,_=_+Math.imul(ve,ft)|0,k=k+Math.imul(ve,rt)|0,N=N+Math.imul(ge,ct)|0,_=_+Math.imul(ge,ut)|0,_=_+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,N=N+Math.imul(te,lt)|0,_=_+Math.imul(te,Qe)|0,_=_+Math.imul(ae,lt)|0,k=k+Math.imul(ae,Qe)|0,N=N+Math.imul(q,ht)|0,_=_+Math.imul(q,dt)|0,_=_+Math.imul(z,ht)|0,k=k+Math.imul(z,dt)|0,N=N+Math.imul(D,pt)|0,_=_+Math.imul(D,mt)|0,_=_+Math.imul(Q,pt)|0,k=k+Math.imul(Q,mt)|0;var Fo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,N=Math.imul(X,Fe),_=Math.imul(X,Ne),_=_+Math.imul(me,Fe)|0,k=Math.imul(me,Ne),N=N+Math.imul(le,Ve)|0,_=_+Math.imul(le,Ze)|0,_=_+Math.imul(oe,Ve)|0,k=k+Math.imul(oe,Ze)|0,N=N+Math.imul(Pe,st)|0,_=_+Math.imul(Pe,at)|0,_=_+Math.imul(Je,st)|0,k=k+Math.imul(Je,at)|0,N=N+Math.imul(pe,ft)|0,_=_+Math.imul(pe,rt)|0,_=_+Math.imul(ke,ft)|0,k=k+Math.imul(ke,rt)|0,N=N+Math.imul(ue,ct)|0,_=_+Math.imul(ue,ut)|0,_=_+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,N=N+Math.imul(ge,lt)|0,_=_+Math.imul(ge,Qe)|0,_=_+Math.imul(ie,lt)|0,k=k+Math.imul(ie,Qe)|0,N=N+Math.imul(te,ht)|0,_=_+Math.imul(te,dt)|0,_=_+Math.imul(ae,ht)|0,k=k+Math.imul(ae,dt)|0,N=N+Math.imul(q,pt)|0,_=_+Math.imul(q,mt)|0,_=_+Math.imul(z,pt)|0,k=k+Math.imul(z,mt)|0,N=N+Math.imul(D,bt)|0,_=_+Math.imul(D,nt)|0,_=_+Math.imul(Q,bt)|0,k=k+Math.imul(Q,nt)|0;var $o=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+($o>>>26)|0,$o&=67108863,N=Math.imul(we,Fe),_=Math.imul(we,Ne),_=_+Math.imul(Ie,Fe)|0,k=Math.imul(Ie,Ne),N=N+Math.imul(X,Ve)|0,_=_+Math.imul(X,Ze)|0,_=_+Math.imul(me,Ve)|0,k=k+Math.imul(me,Ze)|0,N=N+Math.imul(le,st)|0,_=_+Math.imul(le,at)|0,_=_+Math.imul(oe,st)|0,k=k+Math.imul(oe,at)|0,N=N+Math.imul(Pe,ft)|0,_=_+Math.imul(Pe,rt)|0,_=_+Math.imul(Je,ft)|0,k=k+Math.imul(Je,rt)|0,N=N+Math.imul(pe,ct)|0,_=_+Math.imul(pe,ut)|0,_=_+Math.imul(ke,ct)|0,k=k+Math.imul(ke,ut)|0,N=N+Math.imul(ue,lt)|0,_=_+Math.imul(ue,Qe)|0,_=_+Math.imul(ve,lt)|0,k=k+Math.imul(ve,Qe)|0,N=N+Math.imul(ge,ht)|0,_=_+Math.imul(ge,dt)|0,_=_+Math.imul(ie,ht)|0,k=k+Math.imul(ie,dt)|0,N=N+Math.imul(te,pt)|0,_=_+Math.imul(te,mt)|0,_=_+Math.imul(ae,pt)|0,k=k+Math.imul(ae,mt)|0,N=N+Math.imul(q,bt)|0,_=_+Math.imul(q,nt)|0,_=_+Math.imul(z,bt)|0,k=k+Math.imul(z,nt)|0,N=N+Math.imul(D,jt)|0,_=_+Math.imul(D,Ht)|0,_=_+Math.imul(Q,jt)|0,k=k+Math.imul(Q,Ht)|0;var fo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(fo>>>26)|0,fo&=67108863,N=Math.imul(we,Ve),_=Math.imul(we,Ze),_=_+Math.imul(Ie,Ve)|0,k=Math.imul(Ie,Ze),N=N+Math.imul(X,st)|0,_=_+Math.imul(X,at)|0,_=_+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,N=N+Math.imul(le,ft)|0,_=_+Math.imul(le,rt)|0,_=_+Math.imul(oe,ft)|0,k=k+Math.imul(oe,rt)|0,N=N+Math.imul(Pe,ct)|0,_=_+Math.imul(Pe,ut)|0,_=_+Math.imul(Je,ct)|0,k=k+Math.imul(Je,ut)|0,N=N+Math.imul(pe,lt)|0,_=_+Math.imul(pe,Qe)|0,_=_+Math.imul(ke,lt)|0,k=k+Math.imul(ke,Qe)|0,N=N+Math.imul(ue,ht)|0,_=_+Math.imul(ue,dt)|0,_=_+Math.imul(ve,ht)|0,k=k+Math.imul(ve,dt)|0,N=N+Math.imul(ge,pt)|0,_=_+Math.imul(ge,mt)|0,_=_+Math.imul(ie,pt)|0,k=k+Math.imul(ie,mt)|0,N=N+Math.imul(te,bt)|0,_=_+Math.imul(te,nt)|0,_=_+Math.imul(ae,bt)|0,k=k+Math.imul(ae,nt)|0,N=N+Math.imul(q,jt)|0,_=_+Math.imul(q,Ht)|0,_=_+Math.imul(z,jt)|0,k=k+Math.imul(z,Ht)|0;var co=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(co>>>26)|0,co&=67108863,N=Math.imul(we,st),_=Math.imul(we,at),_=_+Math.imul(Ie,st)|0,k=Math.imul(Ie,at),N=N+Math.imul(X,ft)|0,_=_+Math.imul(X,rt)|0,_=_+Math.imul(me,ft)|0,k=k+Math.imul(me,rt)|0,N=N+Math.imul(le,ct)|0,_=_+Math.imul(le,ut)|0,_=_+Math.imul(oe,ct)|0,k=k+Math.imul(oe,ut)|0,N=N+Math.imul(Pe,lt)|0,_=_+Math.imul(Pe,Qe)|0,_=_+Math.imul(Je,lt)|0,k=k+Math.imul(Je,Qe)|0,N=N+Math.imul(pe,ht)|0,_=_+Math.imul(pe,dt)|0,_=_+Math.imul(ke,ht)|0,k=k+Math.imul(ke,dt)|0,N=N+Math.imul(ue,pt)|0,_=_+Math.imul(ue,mt)|0,_=_+Math.imul(ve,pt)|0,k=k+Math.imul(ve,mt)|0,N=N+Math.imul(ge,bt)|0,_=_+Math.imul(ge,nt)|0,_=_+Math.imul(ie,bt)|0,k=k+Math.imul(ie,nt)|0,N=N+Math.imul(te,jt)|0,_=_+Math.imul(te,Ht)|0,_=_+Math.imul(ae,jt)|0,k=k+Math.imul(ae,Ht)|0;var uo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(uo>>>26)|0,uo&=67108863,N=Math.imul(we,ft),_=Math.imul(we,rt),_=_+Math.imul(Ie,ft)|0,k=Math.imul(Ie,rt),N=N+Math.imul(X,ct)|0,_=_+Math.imul(X,ut)|0,_=_+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,N=N+Math.imul(le,lt)|0,_=_+Math.imul(le,Qe)|0,_=_+Math.imul(oe,lt)|0,k=k+Math.imul(oe,Qe)|0,N=N+Math.imul(Pe,ht)|0,_=_+Math.imul(Pe,dt)|0,_=_+Math.imul(Je,ht)|0,k=k+Math.imul(Je,dt)|0,N=N+Math.imul(pe,pt)|0,_=_+Math.imul(pe,mt)|0,_=_+Math.imul(ke,pt)|0,k=k+Math.imul(ke,mt)|0,N=N+Math.imul(ue,bt)|0,_=_+Math.imul(ue,nt)|0,_=_+Math.imul(ve,bt)|0,k=k+Math.imul(ve,nt)|0,N=N+Math.imul(ge,jt)|0,_=_+Math.imul(ge,Ht)|0,_=_+Math.imul(ie,jt)|0,k=k+Math.imul(ie,Ht)|0;var qo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(qo>>>26)|0,qo&=67108863,N=Math.imul(we,ct),_=Math.imul(we,ut),_=_+Math.imul(Ie,ct)|0,k=Math.imul(Ie,ut),N=N+Math.imul(X,lt)|0,_=_+Math.imul(X,Qe)|0,_=_+Math.imul(me,lt)|0,k=k+Math.imul(me,Qe)|0,N=N+Math.imul(le,ht)|0,_=_+Math.imul(le,dt)|0,_=_+Math.imul(oe,ht)|0,k=k+Math.imul(oe,dt)|0,N=N+Math.imul(Pe,pt)|0,_=_+Math.imul(Pe,mt)|0,_=_+Math.imul(Je,pt)|0,k=k+Math.imul(Je,mt)|0,N=N+Math.imul(pe,bt)|0,_=_+Math.imul(pe,nt)|0,_=_+Math.imul(ke,bt)|0,k=k+Math.imul(ke,nt)|0,N=N+Math.imul(ue,jt)|0,_=_+Math.imul(ue,Ht)|0,_=_+Math.imul(ve,jt)|0,k=k+Math.imul(ve,Ht)|0;var jo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(jo>>>26)|0,jo&=67108863,N=Math.imul(we,lt),_=Math.imul(we,Qe),_=_+Math.imul(Ie,lt)|0,k=Math.imul(Ie,Qe),N=N+Math.imul(X,ht)|0,_=_+Math.imul(X,dt)|0,_=_+Math.imul(me,ht)|0,k=k+Math.imul(me,dt)|0,N=N+Math.imul(le,pt)|0,_=_+Math.imul(le,mt)|0,_=_+Math.imul(oe,pt)|0,k=k+Math.imul(oe,mt)|0,N=N+Math.imul(Pe,bt)|0,_=_+Math.imul(Pe,nt)|0,_=_+Math.imul(Je,bt)|0,k=k+Math.imul(Je,nt)|0,N=N+Math.imul(pe,jt)|0,_=_+Math.imul(pe,Ht)|0,_=_+Math.imul(ke,jt)|0,k=k+Math.imul(ke,Ht)|0;var Ho=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,N=Math.imul(we,ht),_=Math.imul(we,dt),_=_+Math.imul(Ie,ht)|0,k=Math.imul(Ie,dt),N=N+Math.imul(X,pt)|0,_=_+Math.imul(X,mt)|0,_=_+Math.imul(me,pt)|0,k=k+Math.imul(me,mt)|0,N=N+Math.imul(le,bt)|0,_=_+Math.imul(le,nt)|0,_=_+Math.imul(oe,bt)|0,k=k+Math.imul(oe,nt)|0,N=N+Math.imul(Pe,jt)|0,_=_+Math.imul(Pe,Ht)|0,_=_+Math.imul(Je,jt)|0,k=k+Math.imul(Je,Ht)|0;var zo=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(zo>>>26)|0,zo&=67108863,N=Math.imul(we,pt),_=Math.imul(we,mt),_=_+Math.imul(Ie,pt)|0,k=Math.imul(Ie,mt),N=N+Math.imul(X,bt)|0,_=_+Math.imul(X,nt)|0,_=_+Math.imul(me,bt)|0,k=k+Math.imul(me,nt)|0,N=N+Math.imul(le,jt)|0,_=_+Math.imul(le,Ht)|0,_=_+Math.imul(oe,jt)|0,k=k+Math.imul(oe,Ht)|0;var Bf=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Bf>>>26)|0,Bf&=67108863,N=Math.imul(we,bt),_=Math.imul(we,nt),_=_+Math.imul(Ie,bt)|0,k=Math.imul(Ie,nt),N=N+Math.imul(X,jt)|0,_=_+Math.imul(X,Ht)|0,_=_+Math.imul(me,jt)|0,k=k+Math.imul(me,Ht)|0;var Lf=(C+N|0)+((_&8191)<<13)|0;C=(k+(_>>>13)|0)+(Lf>>>26)|0,Lf&=67108863,N=Math.imul(we,jt),_=Math.imul(we,Ht),_=_+Math.imul(Ie,jt)|0,k=Math.imul(Ie,Ht);var Uf=(C+N|0)+((_&8191)<<13)|0;return C=(k+(_>>>13)|0)+(Uf>>>26)|0,Uf&=67108863,x[0]=bn,x[1]=gn,x[2]=vn,x[3]=Fr,x[4]=yn,x[5]=ci,x[6]=Uo,x[7]=Fo,x[8]=$o,x[9]=fo,x[10]=co,x[11]=uo,x[12]=qo,x[13]=jo,x[14]=Ho,x[15]=zo,x[16]=Bf,x[17]=Lf,x[18]=Uf,C!==0&&(x[19]=C,E.length++),E},"comb10MulTo");Math.imul||(P=Y);function J(g,l,b){b.negative=l.negative^g.negative,b.length=g.length+l.length;for(var E=0,M=0,S=0;S<b.length-1;S++){var x=M;M=0;for(var C=E&67108863,N=Math.min(S,l.length-1),_=Math.max(0,S-g.length+1);_<=N;_++){var k=S-_,fe=g.words[k]|0,D=l.words[_]|0,Q=fe*D,se=Q&67108863;x=x+(Q/67108864|0)|0,se=se+C|0,C=se&67108863,x=x+(se>>>26)|0,M+=x>>>26,x&=67108863}b.words[S]=C,E=x,x=M}return E!==0?b.words[S]=E:b.length--,b._strip()}o(J,"bigMulTo");function ee(g,l,b){return J(g,l,b)}o(ee,"jumboMulTo"),i.prototype.mulTo=o(function(l,b){var E,M=this.length+l.length;return this.length===10&&l.length===10?E=P(this,l,b):M<63?E=Y(this,l,b):M<1024?E=J(this,l,b):E=ee(this,l,b),E},"mulTo");function Z(g,l){this.x=g,this.y=l}o(Z,"FFTM"),Z.prototype.makeRBT=o(function(l){for(var b=new Array(l),E=i.prototype._countBits(l)-1,M=0;M<l;M++)b[M]=this.revBin(M,E,l);return b},"makeRBT"),Z.prototype.revBin=o(function(l,b,E){if(l===0||l===E-1)return l;for(var M=0,S=0;S<b;S++)M|=(l&1)<<b-S-1,l>>=1;return M},"revBin"),Z.prototype.permute=o(function(l,b,E,M,S,x){for(var C=0;C<x;C++)M[C]=b[l[C]],S[C]=E[l[C]]},"permute"),Z.prototype.transform=o(function(l,b,E,M,S,x){this.permute(x,l,b,E,M,S);for(var C=1;C<S;C<<=1)for(var N=C<<1,_=Math.cos(2*Math.PI/N),k=Math.sin(2*Math.PI/N),fe=0;fe<S;fe+=N)for(var D=_,Q=k,se=0;se<C;se++){var q=E[fe+se],z=M[fe+se],G=E[fe+se+C],te=M[fe+se+C],ae=D*G-Q*te;te=D*te+Q*G,G=ae,E[fe+se]=q+G,M[fe+se]=z+te,E[fe+se+C]=q-G,M[fe+se+C]=z-te,se!==N&&(ae=_*D-k*Q,Q=_*Q+k*D,D=ae)}},"transform"),Z.prototype.guessLen13b=o(function(l,b){var E=Math.max(b,l)|1,M=E&1,S=0;for(E=E/2|0;E;E=E>>>1)S++;return 1<<S+1+M},"guessLen13b"),Z.prototype.conjugate=o(function(l,b,E){if(!(E<=1))for(var M=0;M<E/2;M++){var S=l[M];l[M]=l[E-M-1],l[E-M-1]=S,S=b[M],b[M]=-b[E-M-1],b[E-M-1]=-S}},"conjugate"),Z.prototype.normalize13b=o(function(l,b){for(var E=0,M=0;M<b/2;M++){var S=Math.round(l[2*M+1]/b)*8192+Math.round(l[2*M]/b)+E;l[M]=S&67108863,S<67108864?E=0:E=S/67108864|0}return l},"normalize13b"),Z.prototype.convert13b=o(function(l,b,E,M){for(var S=0,x=0;x<b;x++)S=S+(l[x]|0),E[2*x]=S&8191,S=S>>>13,E[2*x+1]=S&8191,S=S>>>13;for(x=2*b;x<M;++x)E[x]=0;t(S===0),t((S&-8192)===0)},"convert13b"),Z.prototype.stub=o(function(l){for(var b=new Array(l),E=0;E<l;E++)b[E]=0;return b},"stub"),Z.prototype.mulp=o(function(l,b,E){var M=2*this.guessLen13b(l.length,b.length),S=this.makeRBT(M),x=this.stub(M),C=new Array(M),N=new Array(M),_=new Array(M),k=new Array(M),fe=new Array(M),D=new Array(M),Q=E.words;Q.length=M,this.convert13b(l.words,l.length,C,M),this.convert13b(b.words,b.length,k,M),this.transform(C,x,N,_,M,S),this.transform(k,x,fe,D,M,S);for(var se=0;se<M;se++){var q=N[se]*fe[se]-_[se]*D[se];_[se]=N[se]*D[se]+_[se]*fe[se],N[se]=q}return this.conjugate(N,_,M),this.transform(N,_,Q,x,M,S),this.conjugate(Q,x,M),this.normalize13b(Q,M),E.negative=l.negative^b.negative,E.length=l.length+b.length,E._strip()},"mulp"),i.prototype.mul=o(function(l){var b=new i(null);return b.words=new Array(this.length+l.length),this.mulTo(l,b)},"mul"),i.prototype.mulf=o(function(l){var b=new i(null);return b.words=new Array(this.length+l.length),ee(this,l,b)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var b=l<0;b&&(l=-l),t(typeof l=="number"),t(l<67108864);for(var E=0,M=0;M<this.length;M++){var S=(this.words[M]|0)*l,x=(S&67108863)+(E&67108863);E>>=26,E+=S/67108864|0,E+=x>>>26,this.words[M]=x&67108863}return E!==0&&(this.words[M]=E,this.length++),b?this.ineg():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 b=B(l);if(b.length===0)return new i(1);for(var E=this,M=0;M<b.length&&b[M]===0;M++,E=E.sqr());if(++M<b.length)for(var S=E.sqr();M<b.length;M++,S=S.sqr())b[M]!==0&&(E=E.mul(S));return E},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var b=l%26,E=(l-b)/26,M=67108863>>>26-b<<26-b,S;if(b!==0){var x=0;for(S=0;S<this.length;S++){var C=this.words[S]&M,N=(this.words[S]|0)-C<<b;this.words[S]=N|x,x=C>>>26-b}x&&(this.words[S]=x,this.length++)}if(E!==0){for(S=this.length-1;S>=0;S--)this.words[S+E]=this.words[S];for(S=0;S<E;S++)this.words[S]=0;this.length+=E}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,b,E){t(typeof l=="number"&&l>=0);var M;b?M=(b-b%26)/26:M=0;var S=l%26,x=Math.min((l-S)/26,this.length),C=67108863^67108863>>>S<<S,N=E;if(M-=x,M=Math.max(0,M),N){for(var _=0;_<x;_++)N.words[_]=this.words[_];N.length=x}if(x!==0)if(this.length>x)for(this.length-=x,_=0;_<this.length;_++)this.words[_]=this.words[_+x];else this.words[0]=0,this.length=1;var k=0;for(_=this.length-1;_>=0&&(k!==0||_>=M);_--){var fe=this.words[_]|0;this.words[_]=k<<26-S|fe>>>S,k=fe&C}return N&&k!==0&&(N.words[N.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(l,b,E){return t(this.negative===0),this.iushrn(l,b,E)},"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 b=l%26,E=(l-b)/26,M=1<<b;if(this.length<=E)return!1;var S=this.words[E];return!!(S&M)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var b=l%26,E=(l-b)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(b!==0&&E++,this.length=Math.min(E,this.length),b!==0){var M=67108863^67108863>>>b<<b;this.words[this.length-1]&=M}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 b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+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 b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+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,b,E){var M=l.length+E,S;this._expand(M);var x,C=0;for(S=0;S<l.length;S++){x=(this.words[S+E]|0)+C;var N=(l.words[S]|0)*b;x-=N&67108863,C=(x>>26)-(N/67108864|0),this.words[S+E]=x&67108863}for(;S<this.length-E;S++)x=(this.words[S+E]|0)+C,C=x>>26,this.words[S+E]=x&67108863;if(C===0)return this._strip();for(t(C===-1),C=0,S=0;S<this.length;S++)x=-(this.words[S]|0)+C,C=x>>26,this.words[S]=x&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,b){var E=this.length-l.length,M=this.clone(),S=l,x=S.words[S.length-1]|0,C=this._countBits(x);E=26-C,E!==0&&(S=S.ushln(E),M.iushln(E),x=S.words[S.length-1]|0);var N=M.length-S.length,_;if(b!=="mod"){_=new i(null),_.length=N+1,_.words=new Array(_.length);for(var k=0;k<_.length;k++)_.words[k]=0}var fe=M.clone()._ishlnsubmul(S,1,N);fe.negative===0&&(M=fe,_&&(_.words[N]=1));for(var D=N-1;D>=0;D--){var Q=(M.words[S.length+D]|0)*67108864+(M.words[S.length+D-1]|0);for(Q=Math.min(Q/x|0,67108863),M._ishlnsubmul(S,Q,D);M.negative!==0;)Q--,M.negative=0,M._ishlnsubmul(S,1,D),M.isZero()||(M.negative^=1);_&&(_.words[D]=Q)}return _&&_._strip(),M._strip(),b!=="div"&&E!==0&&M.iushrn(E),{div:_||null,mod:M}},"_wordDiv"),i.prototype.divmod=o(function(l,b,E){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var M,S,x;return this.negative!==0&&l.negative===0?(x=this.neg().divmod(l,b),b!=="mod"&&(M=x.div.neg()),b!=="div"&&(S=x.mod.neg(),E&&S.negative!==0&&S.iadd(l)),{div:M,mod:S}):this.negative===0&&l.negative!==0?(x=this.divmod(l.neg(),b),b!=="mod"&&(M=x.div.neg()),{div:M,mod:x.mod}):(this.negative&l.negative)!==0?(x=this.neg().divmod(l.neg(),b),b!=="div"&&(S=x.mod.neg(),E&&S.negative!==0&&S.isub(l)),{div:x.div,mod:S}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?b==="div"?{div:this.divn(l.words[0]),mod:null}:b==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,b)},"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 b=this.divmod(l);if(b.mod.isZero())return b.div;var E=b.div.negative!==0?b.mod.isub(l):b.mod,M=l.ushrn(1),S=l.andln(1),x=E.cmp(M);return x<0||S===1&&x===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var b=l<0;b&&(l=-l),t(l<=67108863);for(var E=(1<<26)%l,M=0,S=this.length-1;S>=0;S--)M=(E*M+(this.words[S]|0))%l;return b?-M:M},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var b=l<0;b&&(l=-l),t(l<=67108863);for(var E=0,M=this.length-1;M>=0;M--){var S=(this.words[M]|0)+E*67108864;this.words[M]=S/l|0,E=S%l}return this._strip(),b?this.ineg():this},"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 b=this,E=l.clone();b.negative!==0?b=b.umod(l):b=b.clone();for(var M=new i(1),S=new i(0),x=new i(0),C=new i(1),N=0;b.isEven()&&E.isEven();)b.iushrn(1),E.iushrn(1),++N;for(var _=E.clone(),k=b.clone();!b.isZero();){for(var fe=0,D=1;(b.words[0]&D)===0&&fe<26;++fe,D<<=1);if(fe>0)for(b.iushrn(fe);fe-- >0;)(M.isOdd()||S.isOdd())&&(M.iadd(_),S.isub(k)),M.iushrn(1),S.iushrn(1);for(var Q=0,se=1;(E.words[0]&se)===0&&Q<26;++Q,se<<=1);if(Q>0)for(E.iushrn(Q);Q-- >0;)(x.isOdd()||C.isOdd())&&(x.iadd(_),C.isub(k)),x.iushrn(1),C.iushrn(1);b.cmp(E)>=0?(b.isub(E),M.isub(x),S.isub(C)):(E.isub(b),x.isub(M),C.isub(S))}return{a:x,b:C,gcd:E.iushln(N)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var b=this,E=l.clone();b.negative!==0?b=b.umod(l):b=b.clone();for(var M=new i(1),S=new i(0),x=E.clone();b.cmpn(1)>0&&E.cmpn(1)>0;){for(var C=0,N=1;(b.words[0]&N)===0&&C<26;++C,N<<=1);if(C>0)for(b.iushrn(C);C-- >0;)M.isOdd()&&M.iadd(x),M.iushrn(1);for(var _=0,k=1;(E.words[0]&k)===0&&_<26;++_,k<<=1);if(_>0)for(E.iushrn(_);_-- >0;)S.isOdd()&&S.iadd(x),S.iushrn(1);b.cmp(E)>=0?(b.isub(E),M.isub(S)):(E.isub(b),S.isub(M))}var fe;return b.cmpn(1)===0?fe=M:fe=S,fe.cmpn(0)<0&&fe.iadd(l),fe},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var b=this.clone(),E=l.clone();b.negative=0,E.negative=0;for(var M=0;b.isEven()&&E.isEven();M++)b.iushrn(1),E.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;E.isEven();)E.iushrn(1);var S=b.cmp(E);if(S<0){var x=b;b=E,E=x}else if(S===0||E.cmpn(1)===0)break;b.isub(E)}while(!0);return E.iushln(M)},"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 b=l%26,E=(l-b)/26,M=1<<b;if(this.length<=E)return this._expand(E+1),this.words[E]|=M,this;for(var S=M,x=E;S!==0&&x<this.length;x++){var C=this.words[x]|0;C+=S,S=C>>>26,C&=67108863,this.words[x]=C}return S!==0&&(this.words[x]=S,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 b=l<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var E;if(this.length>1)E=1;else{b&&(l=-l),t(l<=67108863,"Number is too big");var M=this.words[0]|0;E=M===l?0:M<l?-1:1}return this.negative!==0?-E|0:E},"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 b=this.ucmp(l);return this.negative!==0?-b|0:b},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var b=0,E=this.length-1;E>=0;E--){var M=this.words[E]|0,S=l.words[E]|0;if(M!==S){M<S?b=-1:M>S&&(b=1);break}}return b},"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 h(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 ne={k256:null,p224:null,p192:null,p25519:null};function V(g,l){this.name=g,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(V,"MPrime"),V.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),V.prototype.ireduce=o(function(l){var b=l,E;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),E=b.bitLength();while(E>this.n);var M=E<this.n?-1:b.ucmp(this.p);return M===0?(b.words[0]=0,b.length=1):M>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},"ireduce"),V.prototype.split=o(function(l,b){l.iushrn(this.n,0,b)},"split"),V.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function j(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(j,"K256"),n(j,V),j.prototype.split=o(function(l,b){for(var E=4194303,M=Math.min(l.length,9),S=0;S<M;S++)b.words[S]=l.words[S];if(b.length=M,l.length<=9){l.words[0]=0,l.length=1;return}var x=l.words[9];for(b.words[b.length++]=x&E,S=10;S<l.length;S++){var C=l.words[S]|0;l.words[S-10]=(C&E)<<4|x>>>22,x=C}x>>>=22,l.words[S-10]=x,x===0&&l.length>10?l.length-=10:l.length-=9},"split"),j.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var b=0,E=0;E<l.length;E++){var M=l.words[E]|0;b+=M*977,l.words[E]=b&67108863,b=M*64+(b/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function H(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(H,"P224"),n(H,V);function he(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(he,"P192"),n(he,V);function L(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,V),L.prototype.imulK=o(function(l){for(var b=0,E=0;E<l.length;E++){var M=(l.words[E]|0)*19+b,S=M&67108863;M>>>=26,l.words[E]=S,b=M}return b!==0&&(l.words[l.length++]=b),l},"imulK"),i._prime=o(function(l){if(ne[l])return ne[l];var b;if(l==="k256")b=new j;else if(l==="p224")b=new H;else if(l==="p192")b=new he;else if(l==="p25519")b=new L;else throw new Error("Unknown prime "+l);return ne[l]=b,b},"prime");function h(g){if(typeof g=="string"){var l=i._prime(g);this.m=l.p,this.prime=l}else t(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,b){t((l.negative|b.negative)===0,"red works only with positives"),t(l.red&&l.red===b.red,"red works only with red numbers")},"_verify2"),h.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(y(l,l.umod(this.m)._forceRed(this)),l)},"imod"),h.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),h.prototype.add=o(function(l,b){this._verify2(l,b);var E=l.add(b);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},"add"),h.prototype.iadd=o(function(l,b){this._verify2(l,b);var E=l.iadd(b);return E.cmp(this.m)>=0&&E.isub(this.m),E},"iadd"),h.prototype.sub=o(function(l,b){this._verify2(l,b);var E=l.sub(b);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},"sub"),h.prototype.isub=o(function(l,b){this._verify2(l,b);var E=l.isub(b);return E.cmpn(0)<0&&E.iadd(this.m),E},"isub"),h.prototype.shl=o(function(l,b){return this._verify1(l),this.imod(l.ushln(b))},"shl"),h.prototype.imul=o(function(l,b){return this._verify2(l,b),this.imod(l.imul(b))},"imul"),h.prototype.mul=o(function(l,b){return this._verify2(l,b),this.imod(l.mul(b))},"mul"),h.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),h.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),h.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var b=this.m.andln(3);if(t(b%2===1),b===3){var E=this.m.add(new i(1)).iushrn(2);return this.pow(l,E)}for(var M=this.m.subn(1),S=0;!M.isZero()&&M.andln(1)===0;)S++,M.iushrn(1);t(!M.isZero());var x=new i(1).toRed(this),C=x.redNeg(),N=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new i(2*_*_).toRed(this);this.pow(_,N).cmp(C)!==0;)_.redIAdd(C);for(var k=this.pow(_,M),fe=this.pow(l,M.addn(1).iushrn(1)),D=this.pow(l,M),Q=S;D.cmp(x)!==0;){for(var se=D,q=0;se.cmp(x)!==0;q++)se=se.redSqr();t(q<Q);var z=this.pow(k,new i(1).iushln(Q-q-1));fe=fe.redMul(z),k=z.redSqr(),D=D.redMul(k),Q=q}return fe},"sqrt"),h.prototype.invm=o(function(l){var b=l._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},"invm"),h.prototype.pow=o(function(l,b){if(b.isZero())return new i(1).toRed(this);if(b.cmpn(1)===0)return l.clone();var E=4,M=new Array(1<<E);M[0]=new i(1).toRed(this),M[1]=l;for(var S=2;S<M.length;S++)M[S]=this.mul(M[S-1],l);var x=M[0],C=0,N=0,_=b.bitLength()%26;for(_===0&&(_=26),S=b.length-1;S>=0;S--){for(var k=b.words[S],fe=_-1;fe>=0;fe--){var D=k>>fe&1;if(x!==M[0]&&(x=this.sqr(x)),D===0&&C===0){N=0;continue}C<<=1,C|=D,N++,!(N!==E&&(S!==0||fe!==0))&&(x=this.mul(x,M[C]),N=0,C=0)}_=26}return x},"pow"),h.prototype.convertTo=o(function(l){var b=l.umod(this.m);return b===l?b.clone():b},"convertTo"),h.prototype.convertFrom=o(function(l){var b=l.clone();return b.red=null,b},"convertFrom"),i.mont=o(function(l){return new v(l)},"mont");function v(g){h.call(this,g),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,h),v.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),v.prototype.convertFrom=o(function(l){var b=this.imod(l.mul(this.rinv));return b.red=null,b},"convertFrom"),v.prototype.imul=o(function(l,b){if(l.isZero()||b.isZero())return l.words[0]=0,l.length=1,l;var E=l.imul(b),M=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=E.isub(M).iushrn(this.shift),x=S;return S.cmp(this.m)>=0?x=S.isub(this.m):S.cmpn(0)<0&&(x=S.iadd(this.m)),x._forceRed(this)},"imul"),v.prototype.mul=o(function(l,b){if(l.isZero()||b.isZero())return new i(0)._forceRed(this);var E=l.mul(b),M=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=E.isub(M).iushrn(this.shift),x=S;return S.cmp(this.m)>=0?x=S.isub(this.m):S.cmpn(0)<0&&(x=S.iadd(this.m)),x._forceRed(this)},"mul"),v.prototype.invm=o(function(l){var b=this.imod(l._invmp(this.m).mul(this.r2));return b._forceRed(this)},"invm")})(typeof ag>"u"||ag,D8)});var m_=Re((NZ,p_)=>{p_.exports=_g;var d_=128,WU=127,JU=~WU,YU=Math.pow(2,31);function _g(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw _g.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=YU;)e[t++]=r&255|d_,r/=128;for(;r&JU;)e[t++]=r&255|d_,r>>>=7;return e[t]=r|0,_g.bytes=t-n+1,e}o(_g,"encode")});var v_=Re((PZ,g_)=>{g_.exports=Eg;var ZU=128,b_=127;function Eg(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u||i>49)throw Eg.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&b_)<<i:(f&b_)*Math.pow(2,i),i+=7}while(f>=ZU);return Eg.bytes=s-n,t}o(Eg,"read")});var x_=Re((BZ,y_)=>{var XU=Math.pow(2,7),QU=Math.pow(2,14),eF=Math.pow(2,21),tF=Math.pow(2,28),rF=Math.pow(2,35),nF=Math.pow(2,42),iF=Math.pow(2,49),oF=Math.pow(2,56),sF=Math.pow(2,63);y_.exports=function(r){return r<XU?1:r<QU?2:r<eF?3:r<tF?4:r<rF?5:r<nF?6:r<iF?7:r<oF?8:r<sF?9:10}});var Al=Re((LZ,w_)=>{w_.exports={encode:m_(),decode:v_(),encodingLength:x_()}});var R_=Re((jZ,D_)=>{"use strict";D_.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(f){return function(u,d){var y={key:u,value:f[u]},w={key:d,value:f[d]};return s(y,w)}}}(e.cmp),i=[];return o(function s(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var u,d;if(Array.isArray(f)){for(d="[",u=0;u<f.length;u++)u&&(d+=","),d+=s(f[u])||"null";return d+"]"}if(f===null)return"null";if(i.indexOf(f)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var y=i.push(f)-1,w=Object.keys(f).sort(n&&n(f));for(d="",u=0;u<w.length;u++){var A=w[u],O=s(f[A]);!O||(d&&(d+=","),d+=JSON.stringify(A)+":"+O)}return i.splice(y,1),"{"+d+"}"}},"stringify")(r)}});var Vc=Re((kl,jc)=>{var jF=200,Y_="__lodash_hash_undefined__",Z_=9007199254740991,Kg="[object Arguments]",HF="[object Array]",X_="[object Boolean]",Q_="[object Date]",zF="[object Error]",Vg="[object Function]",eE="[object GeneratorFunction]",F0="[object Map]",tE="[object Number]",Gg="[object Object]",F_="[object Promise]",rE="[object RegExp]",$0="[object Set]",nE="[object String]",iE="[object Symbol]",Fg="[object WeakMap]",oE="[object ArrayBuffer]",q0="[object DataView]",sE="[object Float32Array]",aE="[object Float64Array]",fE="[object Int8Array]",cE="[object Int16Array]",uE="[object Int32Array]",lE="[object Uint8Array]",hE="[object Uint8ClampedArray]",dE="[object Uint16Array]",pE="[object Uint32Array]",KF=/[\\^$.*+?()[\]{}|]/g,VF=/\w*$/,GF=/^\[object .+?Constructor\]$/,WF=/^(?:0|[1-9]\d*)$/,or={};or[Kg]=or[HF]=or[oE]=or[q0]=or[X_]=or[Q_]=or[sE]=or[aE]=or[fE]=or[cE]=or[uE]=or[F0]=or[tE]=or[Gg]=or[rE]=or[$0]=or[nE]=or[iE]=or[lE]=or[hE]=or[dE]=or[pE]=!0;or[zF]=or[Vg]=or[Fg]=!1;var JF=typeof global=="object"&&global&&global.Object===Object&&global,YF=typeof self=="object"&&self&&self.Object===Object&&self,bs=JF||YF||Function("return this")(),mE=typeof kl=="object"&&kl&&!kl.nodeType&&kl,$_=mE&&typeof jc=="object"&&jc&&!jc.nodeType&&jc,ZF=$_&&$_.exports===mE;function XF(r,e){return r.set(e[0],e[1]),r}o(XF,"addMapEntry");function QF(r,e){return r.add(e),r}o(QF,"addSetEntry");function e$(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(e$,"arrayEach");function t$(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(t$,"arrayPush");function bE(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(bE,"arrayReduce");function r$(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(r$,"baseTimes");function n$(r,e){return r?.[e]}o(n$,"getValue");function gE(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}o(gE,"isHostObject");function q_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(q_,"mapToArray");function Wg(r,e){return function(t){return r(e(t))}}o(Wg,"overArg");function j_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(j_,"setToArray");var i$=Array.prototype,o$=Function.prototype,j0=Object.prototype,Ug=bs["__core-js_shared__"],H_=function(){var r=/[^.]+$/.exec(Ug&&Ug.keys&&Ug.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),vE=o$.toString,ca=j0.hasOwnProperty,H0=j0.toString,s$=RegExp("^"+vE.call(ca).replace(KF,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z_=ZF?bs.Buffer:void 0,K_=bs.Symbol,V_=bs.Uint8Array,a$=Wg(Object.getPrototypeOf,Object),f$=Object.create,c$=j0.propertyIsEnumerable,u$=i$.splice,G_=Object.getOwnPropertySymbols,l$=z_?z_.isBuffer:void 0,h$=Wg(Object.keys,Object),$g=Kc(bs,"DataView"),Il=Kc(bs,"Map"),qg=Kc(bs,"Promise"),jg=Kc(bs,"Set"),Hg=Kc(bs,"WeakMap"),Dl=Kc(Object,"create"),d$=bf($g),p$=bf(Il),m$=bf(qg),b$=bf(jg),g$=bf(Hg),W_=K_?K_.prototype:void 0,J_=W_?W_.valueOf:void 0;function mf(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(mf,"Hash");function v$(){this.__data__=Dl?Dl(null):{}}o(v$,"hashClear");function y$(r){return this.has(r)&&delete this.__data__[r]}o(y$,"hashDelete");function x$(r){var e=this.__data__;if(Dl){var t=e[r];return t===Y_?void 0:t}return ca.call(e,r)?e[r]:void 0}o(x$,"hashGet");function w$(r){var e=this.__data__;return Dl?e[r]!==void 0:ca.call(e,r)}o(w$,"hashHas");function _$(r,e){var t=this.__data__;return t[r]=Dl&&e===void 0?Y_:e,this}o(_$,"hashSet");mf.prototype.clear=v$;mf.prototype.delete=y$;mf.prototype.get=x$;mf.prototype.has=w$;mf.prototype.set=_$;function gs(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(gs,"ListCache");function E$(){this.__data__=[]}o(E$,"listCacheClear");function A$(r){var e=this.__data__,t=z0(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():u$.call(e,t,1),!0}o(A$,"listCacheDelete");function S$(r){var e=this.__data__,t=z0(e,r);return t<0?void 0:e[t][1]}o(S$,"listCacheGet");function M$(r){return z0(this.__data__,r)>-1}o(M$,"listCacheHas");function T$(r,e){var t=this.__data__,n=z0(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(T$,"listCacheSet");gs.prototype.clear=E$;gs.prototype.delete=A$;gs.prototype.get=S$;gs.prototype.has=M$;gs.prototype.set=T$;function Hc(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(Hc,"MapCache");function C$(){this.__data__={hash:new mf,map:new(Il||gs),string:new mf}}o(C$,"mapCacheClear");function k$(r){return K0(this,r).delete(r)}o(k$,"mapCacheDelete");function I$(r){return K0(this,r).get(r)}o(I$,"mapCacheGet");function D$(r){return K0(this,r).has(r)}o(D$,"mapCacheHas");function R$(r,e){return K0(this,r).set(r,e),this}o(R$,"mapCacheSet");Hc.prototype.clear=C$;Hc.prototype.delete=k$;Hc.prototype.get=I$;Hc.prototype.has=D$;Hc.prototype.set=R$;function zc(r){this.__data__=new gs(r)}o(zc,"Stack");function O$(){this.__data__=new gs}o(O$,"stackClear");function N$(r){return this.__data__.delete(r)}o(N$,"stackDelete");function P$(r){return this.__data__.get(r)}o(P$,"stackGet");function B$(r){return this.__data__.has(r)}o(B$,"stackHas");function L$(r,e){var t=this.__data__;if(t instanceof gs){var n=t.__data__;if(!Il||n.length<jF-1)return n.push([r,e]),this;t=this.__data__=new Hc(n)}return t.set(r,e),this}o(L$,"stackSet");zc.prototype.clear=O$;zc.prototype.delete=N$;zc.prototype.get=P$;zc.prototype.has=B$;zc.prototype.set=L$;function U$(r,e){var t=Yg(r)||fq(r)?r$(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||ca.call(r,s))&&!(i&&(s=="length"||iq(s,n)))&&t.push(s);return t}o(U$,"arrayLikeKeys");function yE(r,e,t){var n=r[e];(!(ca.call(r,e)&&EE(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(yE,"assignValue");function z0(r,e){for(var t=r.length;t--;)if(EE(r[t][0],e))return t;return-1}o(z0,"assocIndexOf");function F$(r,e){return r&&xE(e,Zg(e),r)}o(F$,"baseAssign");function zg(r,e,t,n,i,s,f){var u;if(n&&(u=s?n(r,i,s,f):n(r)),u!==void 0)return u;if(!V0(r))return r;var d=Yg(r);if(d){if(u=tq(r),!e)return X$(r,u)}else{var y=pf(r),w=y==Vg||y==eE;if(uq(r))return K$(r,e);if(y==Gg||y==Kg||w&&!s){if(gE(r))return s?r:{};if(u=rq(w?{}:r),!e)return Q$(r,F$(u,r))}else{if(!or[y])return s?r:{};u=nq(r,y,zg,e)}}f||(f=new zc);var A=f.get(r);if(A)return A;if(f.set(r,u),!d)var O=t?eq(r):Zg(r);return e$(O||r,function(R,I){O&&(I=R,R=r[I]),yE(u,I,zg(R,e,t,n,I,r,f))}),u}o(zg,"baseClone");function $$(r){return V0(r)?f$(r):{}}o($$,"baseCreate");function q$(r,e,t){var n=e(r);return Yg(r)?n:t$(n,t(r))}o(q$,"baseGetAllKeys");function j$(r){return H0.call(r)}o(j$,"baseGetTag");function H$(r){if(!V0(r)||sq(r))return!1;var e=SE(r)||gE(r)?s$:GF;return e.test(bf(r))}o(H$,"baseIsNative");function z$(r){if(!_E(r))return h$(r);var e=[];for(var t in Object(r))ca.call(r,t)&&t!="constructor"&&e.push(t);return e}o(z$,"baseKeys");function K$(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(K$,"cloneBuffer");function Jg(r){var e=new r.constructor(r.byteLength);return new V_(e).set(new V_(r)),e}o(Jg,"cloneArrayBuffer");function V$(r,e){var t=e?Jg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(V$,"cloneDataView");function G$(r,e,t){var n=e?t(q_(r),!0):q_(r);return bE(n,XF,new r.constructor)}o(G$,"cloneMap");function W$(r){var e=new r.constructor(r.source,VF.exec(r));return e.lastIndex=r.lastIndex,e}o(W$,"cloneRegExp");function J$(r,e,t){var n=e?t(j_(r),!0):j_(r);return bE(n,QF,new r.constructor)}o(J$,"cloneSet");function Y$(r){return J_?Object(J_.call(r)):{}}o(Y$,"cloneSymbol");function Z$(r,e){var t=e?Jg(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Z$,"cloneTypedArray");function X$(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(X$,"copyArray");function xE(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var f=e[i],u=n?n(t[f],r[f],f,t,r):void 0;yE(t,f,u===void 0?r[f]:u)}return t}o(xE,"copyObject");function Q$(r,e){return xE(r,wE(r),e)}o(Q$,"copySymbols");function eq(r){return q$(r,Zg,wE)}o(eq,"getAllKeys");function K0(r,e){var t=r.__data__;return oq(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(K0,"getMapData");function Kc(r,e){var t=n$(r,e);return H$(t)?t:void 0}o(Kc,"getNative");var wE=G_?Wg(G_,Object):dq,pf=j$;($g&&pf(new $g(new ArrayBuffer(1)))!=q0||Il&&pf(new Il)!=F0||qg&&pf(qg.resolve())!=F_||jg&&pf(new jg)!=$0||Hg&&pf(new Hg)!=Fg)&&(pf=o(function(r){var e=H0.call(r),t=e==Gg?r.constructor:void 0,n=t?bf(t):void 0;if(n)switch(n){case d$:return q0;case p$:return F0;case m$:return F_;case b$:return $0;case g$:return Fg}return e},"getTag"));function tq(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&ca.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(tq,"initCloneArray");function rq(r){return typeof r.constructor=="function"&&!_E(r)?$$(a$(r)):{}}o(rq,"initCloneObject");function nq(r,e,t,n){var i=r.constructor;switch(e){case oE:return Jg(r);case X_:case Q_:return new i(+r);case q0:return V$(r,n);case sE:case aE:case fE:case cE:case uE:case lE:case hE:case dE:case pE:return Z$(r,n);case F0:return G$(r,n,t);case tE:case nE:return new i(r);case rE:return W$(r);case $0:return J$(r,n,t);case iE:return Y$(r)}}o(nq,"initCloneByTag");function iq(r,e){return e=e??Z_,!!e&&(typeof r=="number"||WF.test(r))&&r>-1&&r%1==0&&r<e}o(iq,"isIndex");function oq(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(oq,"isKeyable");function sq(r){return!!H_&&H_ in r}o(sq,"isMasked");function _E(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||j0;return r===t}o(_E,"isPrototype");function bf(r){if(r!=null){try{return vE.call(r)}catch{}try{return r+""}catch{}}return""}o(bf,"toSource");function aq(r){return zg(r,!0,!0)}o(aq,"cloneDeep");function EE(r,e){return r===e||r!==r&&e!==e}o(EE,"eq");function fq(r){return cq(r)&&ca.call(r,"callee")&&(!c$.call(r,"callee")||H0.call(r)==Kg)}o(fq,"isArguments");var Yg=Array.isArray;function AE(r){return r!=null&&lq(r.length)&&!SE(r)}o(AE,"isArrayLike");function cq(r){return hq(r)&&AE(r)}o(cq,"isArrayLikeObject");var uq=l$||pq;function SE(r){var e=V0(r)?H0.call(r):"";return e==Vg||e==eE}o(SE,"isFunction");function lq(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Z_}o(lq,"isLength");function V0(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(V0,"isObject");function hq(r){return!!r&&typeof r=="object"}o(hq,"isObjectLike");function Zg(r){return AE(r)?U$(r):z$(r)}o(Zg,"keys");function dq(){return[]}o(dq,"stubArray");function pq(){return!1}o(pq,"stubFalse");jc.exports=aq});var y9=Re((la,v9)=>{var vp=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,yp=function(){function r(){this.fetch=!1,this.DOMException=vp.DOMException}return o(r,"F"),r.prototype=vp,new r}();(function(r){var e=function(t){var n=typeof r<"u"&&r||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function s(h){return h&&DataView.prototype.isPrototypeOf(h)}if(o(s,"isDataView"),i.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(h){return h&&f.indexOf(Object.prototype.toString.call(h))>-1};function d(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}o(d,"normalizeName");function y(h){return typeof h!="string"&&(h=String(h)),h}o(y,"normalizeValue");function w(h){var v={next:function(){var g=h.shift();return{done:g===void 0,value:g}}};return i.iterable&&(v[Symbol.iterator]=function(){return v}),v}o(w,"iteratorFor");function A(h){this.map={},h instanceof A?h.forEach(function(v,g){this.append(g,v)},this):Array.isArray(h)?h.forEach(function(v){if(v.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+v.length);this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}o(A,"Headers"),A.prototype.append=function(h,v){h=d(h),v=y(v);var g=this.map[h];this.map[h]=g?g+", "+v:v},A.prototype.delete=function(h){delete this.map[d(h)]},A.prototype.get=function(h){return h=d(h),this.has(h)?this.map[h]:null},A.prototype.has=function(h){return this.map.hasOwnProperty(d(h))},A.prototype.set=function(h,v){this.map[d(h)]=y(v)},A.prototype.forEach=function(h,v){for(var g in this.map)this.map.hasOwnProperty(g)&&h.call(v,this.map[g],g,this)},A.prototype.keys=function(){var h=[];return this.forEach(function(v,g){h.push(g)}),w(h)},A.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),w(h)},A.prototype.entries=function(){var h=[];return this.forEach(function(v,g){h.push([g,v])}),w(h)},i.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function O(h){if(!h._noBody){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}}o(O,"consumed");function R(h){return new Promise(function(v,g){h.onload=function(){v(h.result)},h.onerror=function(){g(h.error)}})}o(R,"fileReaderReady");function I(h){var v=new FileReader,g=R(v);return v.readAsArrayBuffer(h),g}o(I,"readBlobAsArrayBuffer");function B(h){var v=new FileReader,g=R(v),l=/charset=([A-Za-z0-9_-]+)/.exec(h.type),b=l?l[1]:"utf-8";return v.readAsText(h,b),g}o(B,"readBlobAsText");function Y(h){for(var v=new Uint8Array(h),g=new Array(v.length),l=0;l<v.length;l++)g[l]=String.fromCharCode(v[l]);return g.join("")}o(Y,"readArrayBufferAsText");function P(h){if(h.slice)return h.slice(0);var v=new Uint8Array(h.byteLength);return v.set(new Uint8Array(h)),v.buffer}o(P,"bufferClone");function J(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:i.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:i.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():i.arrayBuffer&&i.blob&&s(h)?(this._bodyArrayBuffer=P(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||u(h))?this._bodyArrayBuffer=P(h):this._bodyText=h=Object.prototype.toString.call(h):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var h=O(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var h=O(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var h=O(this);if(h)return h;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(V)}),this.json=function(){return this.text().then(JSON.parse)},this}o(J,"Body");var ee=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Z(h){var v=h.toUpperCase();return ee.indexOf(v)>-1?v:h}o(Z,"normalizeMethod");function ne(h,v){if(!(this instanceof ne))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');v=v||{};var g=v.body;if(h instanceof ne){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new A(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!g&&h._bodyInit!=null&&(g=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new A(v.headers)),this.method=Z(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal||function(){if("AbortController"in n){var E=new AbortController;return E.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&g)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(g),(this.method==="GET"||this.method==="HEAD")&&(v.cache==="no-store"||v.cache==="no-cache")){var l=/([?&])_=[^&]*/;if(l.test(this.url))this.url=this.url.replace(l,"$1_="+new Date().getTime());else{var b=/\?/;this.url+=(b.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}o(ne,"Request"),ne.prototype.clone=function(){return new ne(this,{body:this._bodyInit})};function V(h){var v=new FormData;return h.trim().split("&").forEach(function(g){if(g){var l=g.split("="),b=l.shift().replace(/\+/g," "),E=l.join("=").replace(/\+/g," ");v.append(decodeURIComponent(b),decodeURIComponent(E))}}),v}o(V,"decode");function j(h){var v=new A,g=h.replace(/\r?\n[\t ]+/g," ");return g.split("\r").map(function(l){return l.indexOf(`
650
+ `)===0?l.substr(1,l.length):l}).forEach(function(l){var b=l.split(":"),E=b.shift().trim();if(E){var M=b.join(":").trim();try{v.append(E,M)}catch(S){console.warn("Response "+S.message)}}}),v}o(j,"parseHeaders"),J.call(ne.prototype);function H(h,v){if(!(this instanceof H))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=v.statusText===void 0?"":""+v.statusText,this.headers=new A(v.headers),this.url=v.url||"",this._initBody(h)}o(H,"Response"),J.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},H.error=function(){var h=new H(null,{status:200,statusText:""});return h.ok=!1,h.status=0,h.type="error",h};var he=[301,302,303,307,308];H.redirect=function(h,v){if(he.indexOf(v)===-1)throw new RangeError("Invalid status code");return new H(null,{status:v,headers:{location:h}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(v,g){this.message=v,this.name=g;var l=Error(v);this.stack=l.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function L(h,v){return new Promise(function(g,l){var b=new ne(h,v);if(b.signal&&b.signal.aborted)return l(new t.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function M(){E.abort()}o(M,"abortXhr"),E.onload=function(){var C={statusText:E.statusText,headers:j(E.getAllResponseHeaders()||"")};b.url.indexOf("file://")===0&&(E.status<200||E.status>599)?C.status=200:C.status=E.status,C.url="responseURL"in E?E.responseURL:C.headers.get("X-Request-URL");var N="response"in E?E.response:E.responseText;setTimeout(function(){g(new H(N,C))},0)},E.onerror=function(){setTimeout(function(){l(new TypeError("Network request failed"))},0)},E.ontimeout=function(){setTimeout(function(){l(new TypeError("Network request timed out"))},0)},E.onabort=function(){setTimeout(function(){l(new t.DOMException("Aborted","AbortError"))},0)};function S(C){try{return C===""&&n.location.href?n.location.href:C}catch{return C}}if(o(S,"fixUrl"),E.open(b.method,S(b.url),!0),b.credentials==="include"?E.withCredentials=!0:b.credentials==="omit"&&(E.withCredentials=!1),"responseType"in E&&(i.blob?E.responseType="blob":i.arrayBuffer&&(E.responseType="arraybuffer")),v&&typeof v.headers=="object"&&!(v.headers instanceof A||n.Headers&&v.headers instanceof n.Headers)){var x=[];Object.getOwnPropertyNames(v.headers).forEach(function(C){x.push(d(C)),E.setRequestHeader(C,y(v.headers[C]))}),b.headers.forEach(function(C,N){x.indexOf(N)===-1&&E.setRequestHeader(N,C)})}else b.headers.forEach(function(C,N){E.setRequestHeader(N,C)});b.signal&&(b.signal.addEventListener("abort",M),E.onreadystatechange=function(){E.readyState===4&&b.signal.removeEventListener("abort",M)}),E.send(typeof b._bodyInit>"u"?null:b._bodyInit)})}return o(L,"fetch"),L.polyfill=!0,n.fetch||(n.fetch=L,n.Headers=A,n.Request=ne,n.Response=H),t.Headers=A,t.Request=ne,t.Response=H,t.fetch=L,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(yp);yp.fetch.ponyfill=!0;delete yp.fetch.polyfill;var iu=vp.fetch?vp:yp;la=iu.fetch;la.default=iu.fetch;la.fetch=iu.fetch;la.Headers=iu.Headers;la.Request=iu.Request;la.Response=iu.Response;v9.exports=la});var I9=Re((Sne,k9)=>{"use strict";var Qq=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=nj(n),this._batchScheduleFn=ij(n),this._cacheKeyFn=oj(n),this._cacheMap=sj(n),this._batch=null,this.name=aj(n)}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=tj(this),s=this._cacheMap,f;if(s){f=this._cacheKeyFn(n);var u=s.get(f);if(u){var d=i.cacheHits||(i.cacheHits=[]);return new Promise(function(w){d.push(function(){w(u)})})}}i.keys.push(n);var y=new Promise(function(w,A){i.callbacks.push({resolve:w,reject:A})});return s&&s.set(f,y),y},"load"),e.loadMany=o(function(n){if(!C9(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(f){return f}));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 f=this._cacheKeyFn(n);if(s.get(f)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),s.set(f,u)}}return this},"prime"),r}(),ej=typeof process=="object"&&typeof process.nextTick=="function"?function(r){Av||(Av=Promise.resolve()),Av.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},Av;function tj(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize)return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){rj(r,t)}),t}o(tj,"getCurrentBatch");function rj(r,e){if(e.hasDispatched=!0,e.keys.length===0){Mv(e);return}var t;try{t=r._batchLoadFn(e.keys)}catch(n){return Sv(r,e,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(n)+".")))}if(!t||typeof t.then!="function")return Sv(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(!C9(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."+(`
651
651
 
652
652
  Keys:
653
653
  `+String(e.keys))+(`
654
654
 
655
655
  Values:
656
- `+String(n)));Mv(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){Sv(r,e,n)})}o(rj,"dispatchBatch");function Sv(r,e,t){Mv(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(Sv,"failedDispatch");function Mv(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Mv,"resolveCacheHits");function nj(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(nj,"getValidMaxBatchSize");function ij(r){var e=r&&r.batchScheduleFn;if(e===void 0)return ej;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(ij,"getValidBatchScheduleFn");function oj(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(oj,"getValidCacheKeyFn");function sj(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(sj,"getValidCacheMap");function aj(r){return r&&r.name?r.name:null}o(aj,"getValidName");function C9(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(C9,"isArrayLike");k9.exports=Qq});var K9=Re((Qne,z9)=>{"use strict";function Sj(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 f=r.length,u=r.charAt(0),d=Math.log(f)/Math.log(256),y=Math.log(256)/Math.log(f);function w(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var I=0,B=0,Y=0,P=R.length;Y!==P&&R[Y]===0;)Y++,I++;for(var J=(P-Y)*y+1>>>0,ee=new Uint8Array(J);Y!==P;){for(var Z=R[Y],ne=0,V=J-1;(Z!==0||ne<B)&&V!==-1;V--,ne++)Z+=256*ee[V]>>>0,ee[V]=Z%f>>>0,Z=Z/f>>>0;if(Z!==0)throw new Error("Non-zero carry");B=ne,Y++}for(var j=J-B;j!==J&&ee[j]===0;)j++;for(var H=u.repeat(I);j<J;++j)H+=r.charAt(ee[j]);return H}o(w,"encode");function A(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var I=0;if(R[I]!==" "){for(var B=0,Y=0;R[I]===u;)B++,I++;for(var P=(R.length-I)*d+1>>>0,J=new Uint8Array(P);R[I];){var ee=e[R.charCodeAt(I)];if(ee===255)return;for(var Z=0,ne=P-1;(ee!==0||Z<Y)&&ne!==-1;ne--,Z++)ee+=f*J[ne]>>>0,J[ne]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");Y=Z,I++}if(R[I]!==" "){for(var V=P-Y;V!==P&&J[V]===0;)V++;for(var j=new Uint8Array(B+(P-V)),H=B;V!==P;)j[H++]=J[V++];return j}}}o(A,"decodeUnsafe");function O(R){var I=A(R);if(I)return I;throw new Error("Non-base"+f+" character")}return o(O,"decode"),{encode:w,decodeUnsafe:A,decode:O}}o(Sj,"base");z9.exports=Sj});var wp=Re((eie,V9)=>{"use strict";var Mj=new TextDecoder,Tj=o(r=>Mj.decode(r),"decodeText"),Cj=new TextEncoder,kj=o(r=>Cj.encode(r),"encodeText");function Ij(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(Ij,"concat");V9.exports={decodeText:Tj,encodeText:kj,concat:Ij}});var W9=Re((tie,G9)=>{"use strict";var{encodeText:Dj}=wp(),_p=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=Dj(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(_p,"Base");G9.exports=_p});var Y9=Re((rie,J9)=>{"use strict";var Rj=o((r,e,t)=>{let n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),f=0,u=0,d=0;for(let y=0;y<i;++y){let w=n[r[y]];if(w===void 0)throw new SyntaxError("Invalid character "+r[y]);u=u<<t|w,f+=t,f>=8&&(f-=8,s[d++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return s},"decode"),Oj=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Nj=o(r=>e=>({encode(t){return Oj(t,e,r)},decode(t){return Rj(t,e,r)}}),"rfc4648");J9.exports={rfc4648:Nj}});var eA=Re((nie,Q9)=>{"use strict";var Kl=K9(),Pj=W9(),{rfc4648:Gr}=Y9(),{decodeText:Bj,encodeText:Lj}=wp(),Uj=o(()=>({encode:Bj,decode:Lj}),"identity"),Z9=[["identity","\0",Uj,""],["base2","0",Gr(1),"01"],["base8","7",Gr(3),"01234567"],["base10","9",Kl,"0123456789"],["base16","f",Gr(4),"0123456789abcdef"],["base16upper","F",Gr(4),"0123456789ABCDEF"],["base32hex","v",Gr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",Gr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",Gr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",Gr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",Gr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Kl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Kl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Kl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Kl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],X9=Z9.reduce((r,e)=>(r[e[0]]=new Pj(e[0],e[1],e[2],e[3]),r),{}),Fj=Z9.reduce((r,e)=>(r[e[1]]=X9[e[0]],r),{});Q9.exports={names:X9,codes:Fj}});var nA=Re((_s,rA)=>{"use strict";var ou=eA(),{encodeText:$j,decodeText:Ep,concat:tA}=wp();function qj(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=Mf(r);return Kj(t,e),tA([n,e],n.length+e.length)}o(qj,"multibase");function jj(r,e){let t=Mf(r),n=$j(t.encode(e));return tA([t.codeBuf,n],t.codeBuf.length+n.length)}o(jj,"encode");function Hj(r){r instanceof Uint8Array&&(r=Ep(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),Mf(r[0]).decode(r.substring(1))}o(Hj,"decode");function zj(r){if(r instanceof Uint8Array&&(r=Ep(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return Mf(r[0]).name}catch{return!1}}o(zj,"isEncoded");function Kj(r,e){Mf(r).decode(Ep(e))}o(Kj,"validEncode");function Mf(r){if(Object.prototype.hasOwnProperty.call(ou.names,r))return ou.names[r];if(Object.prototype.hasOwnProperty.call(ou.codes,r))return ou.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(Mf,"encoding");function Vj(r){return r instanceof Uint8Array&&(r=Ep(r)),Mf(r[0])}o(Vj,"encodingFromData");_s=rA.exports=qj;_s.encode=jj;_s.decode=Hj;_s.isEncoded=zj;_s.encoding=Mf;_s.encodingFromData=Vj;var Gj=Object.freeze(ou.names),Wj=Object.freeze(ou.codes);_s.names=Gj;_s.codes=Wj});var aA=Re((iie,sA)=>{sA.exports=oA;var iA=128,Jj=127,Yj=~Jj,Zj=Math.pow(2,31);function oA(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Zj;)e[t++]=r&255|iA,r/=128;for(;r&Yj;)e[t++]=r&255|iA,r>>>=7;return e[t]=r|0,oA.bytes=t-n+1,e}o(oA,"encode")});var uA=Re((oie,cA)=>{cA.exports=Bv;var Xj=128,fA=127;function Bv(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw Bv.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&fA)<<i:(f&fA)*Math.pow(2,i),i+=7}while(f>=Xj);return Bv.bytes=s-n,t}o(Bv,"read")});var hA=Re((sie,lA)=>{var Qj=Math.pow(2,7),eH=Math.pow(2,14),tH=Math.pow(2,21),rH=Math.pow(2,28),nH=Math.pow(2,35),iH=Math.pow(2,42),oH=Math.pow(2,49),sH=Math.pow(2,56),aH=Math.pow(2,63);lA.exports=function(r){return r<Qj?1:r<eH?2:r<tH?3:r<rH?4:r<nH?5:r<iH?6:r<oH?7:r<sH?8:r<aH?9:10}});var pA=Re((aie,dA)=>{dA.exports={encode:aA(),decode:uA(),encodingLength:hA()}});var bA=Re((fie,mA)=>{"use strict";var fH=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});mA.exports={names:fH}});var EA=Re((cie,_A)=>{"use strict";var gA=nA(),su=pA(),{names:Vl}=bA(),{toString:Ap}=(ic(),Vh(X3)),{fromString:cH}=(cd(),Vh(Z3)),{concat:uH}=(Km(),Vh(_3)),au={};for(let r in Vl){let e=r;au[Vl[e]]=e}Object.freeze(au);function lH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ap(r,"base16")}o(lH,"toHexString");function hH(r){return cH(r,"base16")}o(hH,"fromHexString");function dH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ap(gA.encode("base58btc",r)).slice(1)}o(dH,"toB58String");function pH(r){let e=r instanceof Uint8Array?Ap(r):r;return gA.decode("z"+e)}o(pH,"fromB58String");function vA(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=su.decode(r);if(!xA(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(su.decode.bytes);let t=su.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(su.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${Ap(r,"base16")}`);return{code:e,name:au[e],length:t,digest:r}}o(vA,"decode");function mH(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=yA(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=su.encode(n),s=su.encode(t);return uH([i,s,r],i.length+s.length+r.length)}o(mH,"encode");function yA(r){let e=r;if(typeof r=="string"){if(Vl[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=Vl[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(au[e]===void 0&&!Lv(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(yA,"coerceCode");function Lv(r){return r>0&&r<16}o(Lv,"isAppCode");function xA(r){return!!(Lv(r)||au[r])}o(xA,"isValidCode");function wA(r){vA(r)}o(wA,"validate");function bH(r){return wA(r),r.subarray(0,2)}o(bH,"prefix");_A.exports={names:Vl,codes:au,toHexString:lH,fromHexString:hH,toB58String:dH,fromB58String:pH,decode:vA,encode:mH,coerceCode:yA,isAppCode:Lv,validate:wA,prefix:bH,isValidCode:xA}});var NK={};Zt(NK,{CeramicURIValidator:()=>Xv,default:()=>OK,getCeramicPlugin:()=>Np,streamIdToCeramicURI:()=>Op});module.exports=Vh(NK);var d7=Ft(y3());function yD(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(yD,"_catch");function xD(){let r=new Map;return function(e,t){try{let i=function(f){if(n)return f;let u=r.get(e.didUrl);return u!==void 0?u:Promise.resolve(t()).then(function(d){var y;return((y=d.didResolutionMetadata)==null?void 0:y.error)!=="notFound"&&r.set(e.didUrl,d),d})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(f){return n=1,f})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(xD,"inMemoryCache");function wD(r,e){return e()}o(wD,"noCache");var _D="(?:%[0-9a-fA-F]{2})",x3=`(?:[a-zA-Z0-9._-]|${_D})`,ED="([a-z0-9]+)",AD=`((?:${x3}*:)*(${x3}+))`,w3="[a-zA-Z0-9_.:%-]",SD=`;${w3}+=${w3}*`,MD=`((${SD})*)`,TD="(/[^#?]*)?",CD="([?][^#]*)?",kD="(#.*)?",ID=new RegExp(`^did:${ED}:${AD}${MD}${TD}${CD}${kD}$`);function DD(r){if(r===""||!r)return null;let e=r.match(ID);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(DD,"parse");var Gh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function RD(r){return function(e,t,n){try{return Promise.resolve(yD(function(){return Promise.resolve(r(e,t,n)).then(function(i){return{...Gh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...Gh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(RD,"wrapLegacyResolver");var Ru=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?xD():t.cache||wD,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=RD(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=DD(e);if(i===null)return Promise.resolve({...Gh,didResolutionMetadata:{error:"invalidDid"}});let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve({...Gh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(Ru,"Resolver");Km();cd();ic();Wh();Ou();l1();var hb=Ft(sx()),Iw=Ft(x1()),db=Ft(O6()),Hd=Ft(Bd()),Dw=Ft(iw()),tl=Ft(fw()),pb=Ft(_w()),mb=Ft(Ga());function Ai(r){return Rt(r,"base64url")}o(Ai,"bytesToBase64url");function Mn(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return $t(e,"base64url")}o(Mn,"base64ToBytes");function bb(r){return $t(r,"base58btc")}o(bb,"base58ToBytes");function cb(r){let e=r.startsWith("0x")?r.substring(2):r;return $t(e.toLowerCase(),"base16")}o(cb,"hexToBytes");function ub(r){return Ai($t(r))}o(ub,"encodeBase64url");function Rw(r){return Rt(Mn(r))}o(Rw,"decodeBase64url");function Za(r){return Rt(r,"base16")}o(Za,"bytesToHex");function Ow(r){return $t(r)}o(Ow,"stringToBytes");function rB({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set($t(r,"base16"),0),i.set($t(e,"base16"),32),n){if(typeof t>"u")throw new Error("Signer did not return a recoveryParam");i[64]=t}return Ai(i)}o(rB,"toJose");function nB(r){let e=Mn(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=Za(e.slice(0,32)),n=Za(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(nB,"fromJose");function Nw(r,e){return Fi([Mn(r),Mn(e)])}o(Nw,"toSealed");var iB=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,oB=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,sB=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function aB(r){if(typeof r=="string"){if(iB.test(r))return cb(r);if(oB.test(r))return bb(r);if(sB.test(r))return Mn(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(aB,"parseKey");function Pw(r){let e=typeof r=="string"?$t(r):r;return(0,hb.hash)(e)}o(Pw,"sha256");function fB(r){return new Uint8Array(Iw.keccak_256.arrayBuffer(r))}o(fB,"keccak");function cB(r){let e=$t(r.slice(2),"base16");return`0x${Rt(fB(e).slice(-20),"base16")}`}o(cB,"toEthereumAddress");function lb(r,e=new Uint8Array(4)){let t=$t(r.toString(),"base10");return e.set(t,4-t.length),e}o(lb,"writeUint32BE");var fb=o(r=>Fi([lb(r.length),r]),"lengthAndInput");function Bw(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=Fi([fb($t(t)),fb(typeof n>"u"?new Uint8Array(0):n),fb(typeof i>"u"?new Uint8Array(0):i),lb(e)]);return(0,hb.hash)(Fi([lb(1),r,s]))}o(Bw,"concatKDF");var jG=new db.ec("secp256k1");function Lw(r){let e=aB(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"?Ow(t):t,i=(0,Hd.sign)(e,n);return Promise.resolve(Ai(i))}catch(n){return Promise.reject(n)}}}o(Lw,"EdDSASigner");function Uw(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Uw,"instanceOfEcdsaSignature");function Ew(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Uw(i))return rB(i,r);if(r&&typeof nB(i).recoveryParam>"u")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(Ew,"ES256KSignerAlg");function Aw(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Uw(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(Aw,"Ed25519SignerAlg");var uB={ES256K:Ew(),"ES256K-R":Ew(!0),Ed25519:Aw(),EdDSA:Aw()};function lB(r){let e=uB[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(lB,"SignerAlg");var gb=new db.ec("secp256k1");function jd(r,e=!1){let t=Mn(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=Za(t.slice(0,32)),i=Za(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(jd,"toSignatureObject");function vb(r){if(r.publicKeyBase58)return bb(r.publicKeyBase58);if(r.publicKeyBase64)return Mn(r.publicKeyBase64);if(r.publicKeyHex)return cb(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return cb(gb.keyFromPublic({x:Za(Mn(r.publicKeyJwk.x)),y:Za(Mn(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=$u;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(vb,"extractPublicKeyBytes");function hB(r,e,t){let n=Pw(r),i=jd(e),s=t.filter(({ethereumAddress:d,blockchainAccountId:y})=>typeof d>"u"&&typeof y>"u"),f=t.filter(({ethereumAddress:d,blockchainAccountId:y})=>typeof d<"u"||typeof y!==void 0),u=s.find(d=>{try{let y=vb(d);return gb.keyFromPublic(y).verify(n,i)}catch{return!1}});if(!u&&f.length>0&&(u=Fw(r,e,f)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(hB,"verifyES256K");function Fw(r,e,t){let n;if(e.length>86)n=[jd(e,!0)];else{let f=jd(e,!1);n=[{...f,recoveryParam:0},{...f,recoveryParam:1}]}let i=o(f=>{let u=Pw(r),d=gb.recoverPubKey(u,f,f.recoveryParam),y=d.encode("hex"),w=d.encode("hex",!0),A=cB(y);return t.find(R=>{var I,B,Y;let P=Za(vb(R));return P===y||P===w||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===A||((B=R.blockchainAccountId)==null||(Y=B.split("@eip155"))==null?void 0:Y[0].toLowerCase())===A})},"checkSignatureAgainstSigner"),s=n.map(i).filter(f=>typeof f<"u");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(Fw,"verifyRecoverableES256K");function Sw(r,e,t){let n=Ow(r),i=Mn(e),s=t.find(f=>(0,Hd.verify)(vb(f),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Sw,"verifyEd25519");var dB={ES256K:hB,"ES256K-R":Fw,Ed25519:Sw,EdDSA:Sw};function $w(r){let e=dB[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o($w,"VerifierAlgorithm");$w.toSignatureObject=jd;var qw=o(function(r,e,t={},n={}){try{t.alg||(t.alg=pB);let i=typeof r=="string"?r:Mw(r,n.canonicalize),s=[Mw(t,n.canonicalize),i].join("."),f=lB(t.alg);return Promise.resolve(f(s,e)).then(function(u){return[s,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var pB="ES256K";function Mw(r,e=!1){return ub(e?(0,Dw.default)(r):JSON.stringify(r))}o(Mw,"encodeSection");function mB(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Rw(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(mB,"decodeJWS");function bB({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),$w(r.alg)(e,t,n)}o(bB,"verifyJWSDecoded");function jw(r,e){let t=mB(r);return bB(t,e)}o(jw,"verifyJWS");function gB(r,e,t){for(var n;;){var i=r();if(Ys(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(Ys(s))s=s.s;else{n=1;break}if(e){var f=e();if(f&&f.then&&!Ys(f)){n=2;break}}}var u=new Xa,d=Sr.bind(null,u,2);return(n===0?i.then(w):n===1?s.then(y):f.then(A)).then(void 0,d),u;function y(O){s=O;do{if(e&&(f=e(),f&&f.then&&!Ys(f))){f.then(A).then(void 0,d);return}if(i=r(),!i||Ys(i)&&!i.v){Sr(u,1,s);return}if(i.then){i.then(w).then(void 0,d);return}s=t(),Ys(s)&&(s=s.v)}while(!s||!s.then);s.then(y).then(void 0,d)}o(y,"_resumeAfterBody");function w(O){O?(s=t(),s&&s.then?s.then(y).then(void 0,d):y(s)):Sr(u,1,s)}o(w,"_resumeAfterTest");function A(){(i=r())?i.then?i.then(w).then(void 0,d):w(i):Sr(u,1,s)}o(A,"_resumeAfterUpdate")}o(gB,"_for");var Hw=o(function(r,e){try{let n=function(y){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let t;xB(r);let i=JSON.parse(Rw(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Nw(r.ciphertext,r.tag),f=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),u=null,d=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,Mn(r.iv),f)).then(function(y){u=y}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let y=0;return gB(function(){return!u&&y<r.recipients.length},function(){return y++},function(){let w=r.recipients[y];Object.assign(w.header,i);let A=function(){if(w.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Mn(r.iv),f,w)).then(function(O){u=O})}();if(A&&A.then)return A.then(function(){})})}}()}();return Promise.resolve(d&&d.then?d.then(n):n(d))}catch(t){return Promise.reject(t)}},"decryptJWE"),Tw=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Sr(r,e,t){if(!r.s){if(t instanceof Xa)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=Sr.bind(null,r,e);return}if(t&&t.then){t.then(Sr.bind(null,r,e),Sr.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(Sr,"_settle");var Xa=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{Sr(n,1,s(this.v))}catch(f){Sr(n,2,f)}return n}else return this}return this.o=function(s){try{let f=s.v;s.s&1?Sr(n,1,e?e(f):f):t?Sr(n,1,t(f)):Sr(n,2,f)}catch(f){Sr(n,2,f)}},n},r}();function Ys(r){return r instanceof Xa&&r.s&1}o(Ys,"_isSettledPact");function vB(r,e,t){var n=-1,i,s;function f(u){try{for(;++n<r.length&&(!t||!t());)if(u=e(n),u&&u.then)if(Ys(u))u=u.v;else{u.then(f,s||(s=Sr.bind(null,i=new Xa,2)));return}i?Sr(i,1,u):i=u}catch(d){Sr(i||(i=new Xa),2,d)}}return o(f,"_cycle"),f(),i}o(vB,"_forTo");function yB(r,e,t){if(typeof r[Tw]=="function"){let w=function(A){try{for(;!(i=n.next()).done&&(!t||!t());)if(A=e(i.value),A&&A.then)if(Ys(A))A=A.v;else{A.then(w,f||(f=Sr.bind(null,s=new Xa,2)));return}s?Sr(s,1,A):s=A}catch(O){Sr(s||(s=new Xa),2,O)}};o(w,"_cycle");var n=r[Tw](),i,s,f;if(w(),n.return){var u=o(function(A){try{i.done||n.return()}catch{}return A},"_fixup");if(s&&s.then)return s.then(u,function(A){throw u(A)});u()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var d=[],y=0;y<r.length;y++)d.push(r[y]);return vB(d,function(w){return e(d[w])},t)}o(yB,"_forOf");function xB(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(xB,"validateJWE");function Cw({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let f={protected:n,iv:Ai(t),ciphertext:Ai(r),tag:Ai(e)};return s&&(f.aad=Ai(s)),i&&(f.recipients=[i]),f}o(Cw,"encodeJWE");var zw=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 Cw(i,n)})}else{let i=e[0].enc;if(!e.reduce((d,y)=>d&&y.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,f,u=yB(e,function(d){let y=function(){return s?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(s)).then(function(w){if(w){var A,O;(A=f)==null||(O=A.recipients)==null||O.push(w)}}):Promise.resolve(d.encrypt(r,t,n)).then(function(w){s=w.cek,f=Cw(w,n)})}();if(y&&y.then)return y.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return f}):f)}}catch(i){return Promise.reject(i)}},"createJWE");var Kw=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:f}){var u;if(s!=null&&s.error||f==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!f.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let y=((u=f.keyAgreement)==null?void 0:u.map(w=>typeof w=="string"?[...f.publicKey||[],...f.verificationMethod||[]].find(A=>A.id===w):w).filter(w=>typeof w<"u")).filter(w=>w.type==="X25519KeyAgreementKey2019"&&Boolean(w.publicKeyBase58));if(!y.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return y.map(w=>_B(bb(w.publicKeyBase58),w.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 Vw(r){let e=new pb.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,mb.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(Vw,"xc20pEncrypter");function wB(r){let e=o(function(s,f={},u){try{let d=ub(JSON.stringify(Object.assign({alg:i},f,{enc:n}))),y=new Uint8Array(Buffer.from(u?`${d}.${Ai(u)}`:d));return Promise.resolve({...t(s,y),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),t=Vw(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(wB,"xc20pDirEncrypter");function kw(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(f){return Promise.reject(f)}},"decrypt"),t=new pb.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(kw,"xc20pDirDecrypter");function _B(r,e){let t=o(function(u,d={},y){try{Object.assign(d,{alg:void 0});let w=(0,mb.randomBytes)(32);return Promise.resolve(wB(w).encrypt(u,d,y)).then(function(A){return Promise.resolve(n(w)).then(function(O){return{...A,recipient:O,cek:w}})})}catch(w){return Promise.reject(w)}},"encrypt"),n=o(function(u){try{let d=(0,tl.generateKeyPair)(),y=(0,tl.sharedKey)(d.secretKey,r),w=Bw(y,s,i),A=Vw(w)(u),O={encrypted_key:Ai(A.ciphertext),header:{alg:i,iv:Ai(A.iv),tag:Ai(A.tag),epk:{kty:"OKP",crv:f,x:Ai(d.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(d){return Promise.reject(d)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,f="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(_B,"x25519Encrypter");function EB(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(EB,"validateHeader");function Gw(r){let e=o(function(s,f,u,d){try{let A=function(){let B=Bw(R,n,t),Y=Nw(d.encrypted_key,d.header.tag);return Promise.resolve(kw(B).decrypt(Y,Mn(d.header.iv))).then(function(P){return P===null?null:kw(P).decrypt(s,f,u)})};o(A,"_temp4");var y,w;if(EB((y=d)==null?void 0:y.header),d=d,((w=d.header.epk)==null?void 0:w.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=Mn(d.header.epk.x),R,I=function(){if(r instanceof Uint8Array)R=(0,tl.sharedKey)(r,O);else return Promise.resolve(r(O)).then(function(B){R=B})}();return Promise.resolve(I&&I.then?I.then(A):A(I))}catch(A){return Promise.reject(A)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(Gw,"x25519Decrypter");u1();var zd=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),yb=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,f]of n.entries()){let u=[...i,s],d=Ye.asCID(f);d?yield[u.join("/"),d]:typeof f=="object"&&(yield*yb(f,u))}else{let s=Ye.asCID(n);s?yield[i.join("/"),s]:yield*yb(n,i)}}},"links"),xb=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"&&!Ye.asCID(n))if(Array.isArray(n))for(let[s,f]of n.entries()){let u=[...i,s];yield u.join("/"),typeof f=="object"&&!Ye.asCID(f)&&(yield*xb(f,u))}else yield*xb(n,i)}},"tree"),AB=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(f=>`[${JSON.stringify(f)}]`).join("")}`);let s=Ye.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),rl=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:zd(),bytes:zd(),value:zd(),asBlock:zd()})}links(){return yb(this.value,[])}tree(){return xb(this.value,[])}get(e="/"){return AB(this.value,e.split("/").filter(Boolean))}};o(rl,"Block");var Qa=o(async({value:r,codec:e,hasher:t})=>{if(typeof r>"u")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.encode(r),i=await t.digest(n),s=Ye.create(1,e.code,i);return new rl({value:r,bytes:n,cid:s})},"encode"),Ww=o(async({bytes:r,codec:e,hasher:t})=>{if(!r)throw new Error('Missing required argument "bytes"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.decode(r),i=await t.digest(r),s=Ye.create(1,e.code,i);return new rl({value:n,bytes:r,cid:s})},"decode");ji();Uu();c1();ed();var Yi={};Zt(Yi,{code:()=>Mc,decode:()=>Db,encode:()=>rf,name:()=>sL});var SB=["string","number","bigint","symbol"],MB=["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 Jw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(SB.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(TB(r))return"Buffer";let t=CB(r);return t||"Object"}o(Jw,"is");function TB(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(TB,"isBuffer");function CB(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(MB.includes(e))return e}o(CB,"getObjectType");var _e=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(_e,"Type");_e.uint=new _e(0,"uint",!0);_e.negint=new _e(1,"negint",!0);_e.bytes=new _e(2,"bytes",!0);_e.string=new _e(3,"string",!0);_e.array=new _e(4,"array",!1);_e.map=new _e(5,"map",!1);_e.tag=new _e(6,"tag",!1);_e.float=new _e(7,"float",!0);_e.false=new _e(7,"false",!0);_e.true=new _e(7,"true",!0);_e.null=new _e(7,"null",!0);_e.undefined=new _e(7,"undefined",!0);_e.break=new _e(7,"break",!0);var qe=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(qe,"Token");var xc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",kB=new TextDecoder,IB=new TextEncoder;function Kd(r){return xc&&globalThis.Buffer.isBuffer(r)}o(Kd,"isBuffer");function _b(r){return r instanceof Uint8Array?Kd(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(_b,"asU8A");var Qw=xc?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):Zw(r,e,t):(r,e,t)=>t-e>64?kB.decode(r.subarray(e,t)):Zw(r,e,t),e4=xc?r=>r.length>64?globalThis.Buffer.from(r):Yw(r):r=>r.length>64?IB.encode(r):Yw(r),Ao=o(r=>Uint8Array.from(r),"fromArray"),wc=xc?(r,e,t)=>Kd(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),t4=xc?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),_b(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},r4=xc?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function n4(r,e){if(Kd(r)&&Kd(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(n4,"compare");function Yw(r,e=1/0){let t,n=r.length,i=null,s=[];for(let f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(Yw,"utf8ToBytes");function Zw(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,f=i>239?4:i>223?3:i>191?2:1;if(e+f<=t){let u,d,y,w;switch(f){case 1:i<128&&(s=i);break;case 2:u=r[e+1],(u&192)===128&&(w=(i&31)<<6|u&63,w>127&&(s=w));break;case 3:u=r[e+1],d=r[e+2],(u&192)===128&&(d&192)===128&&(w=(i&15)<<12|(u&63)<<6|d&63,w>2047&&(w<55296||w>57343)&&(s=w));break;case 4:u=r[e+1],d=r[e+2],y=r[e+3],(u&192)===128&&(d&192)===128&&(y&192)===128&&(w=(i&15)<<18|(u&63)<<12|(d&63)<<6|y&63,w>65535&&w<1114112&&(s=w))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=f}return DB(n)}o(Zw,"utf8Slice");var Xw=4096;function DB(r){let e=r.length;if(e<=Xw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Xw));return t}o(DB,"decodeCodePointsArray");var RB=256,_c=class{constructor(e=RB){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=r4(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=wc(n,0,this.cursor)}else t=t4(this.chunks,this.cursor);return e&&this.reset(),t}};o(_c,"Bl");var yt="CBOR decode error:",Eb="CBOR encode error:",nl=[];nl[23]=1;nl[24]=2;nl[25]=3;nl[26]=5;nl[27]=9;function ls(r,e,t){if(r.length-e<t)throw new Error(`${yt} not enough data for type`)}o(ls,"assertEnoughData");var Or=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Kn(r,e,t){ls(r,e,1);let n=r[e];if(t.strict===!0&&n<Or[0])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Kn,"readUint8");function Vn(r,e,t){ls(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Or[1])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Vn,"readUint16");function Gn(r,e,t){ls(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Or[2])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Gn,"readUint32");function Wn(r,e,t){ls(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<Or[3])throw new Error(`${yt} 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(`${yt} integers outside of the safe integer range are not supported`)}o(Wn,"readUint64");function i4(r,e,t,n){return new qe(_e.uint,Kn(r,e+1,n),2)}o(i4,"decodeUint8");function o4(r,e,t,n){return new qe(_e.uint,Vn(r,e+1,n),3)}o(o4,"decodeUint16");function s4(r,e,t,n){return new qe(_e.uint,Gn(r,e+1,n),5)}o(s4,"decodeUint32");function a4(r,e,t,n){return new qe(_e.uint,Wn(r,e+1,n),9)}o(a4,"decodeUint64");function Si(r,e){return Hr(r,0,e.value)}o(Si,"encodeUint");function Hr(r,e,t){if(t<Or[0]){let n=Number(t);r.push([e|n])}else if(t<Or[1]){let n=Number(t);r.push([e|24,n])}else if(t<Or[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Or[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<Or[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),f=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]=f&255,f=f>>8,i[3]=f&255,f=f>>8,i[2]=f&255,f=f>>8,i[1]=f&255,r.push(i)}else throw new Error(`${yt} encountered BigInt larger than allowable range`)}}o(Hr,"encodeUintValue");Si.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");Hr.encodedSize=o(function(e){return e<Or[0]?1:e<Or[1]?2:e<Or[2]?3:e<Or[3]?5:9},"encodedSize");Si.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function f4(r,e,t,n){return new qe(_e.negint,-1-Kn(r,e+1,n),2)}o(f4,"decodeNegint8");function c4(r,e,t,n){return new qe(_e.negint,-1-Vn(r,e+1,n),3)}o(c4,"decodeNegint16");function u4(r,e,t,n){return new qe(_e.negint,-1-Gn(r,e+1,n),5)}o(u4,"decodeNegint32");var Ab=BigInt(-1),l4=BigInt(1);function h4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new qe(_e.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${yt} integers outside of the safe integer range are not supported`);return new qe(_e.negint,Ab-BigInt(i),9)}o(h4,"decodeNegint64");function Vd(r,e){let t=e.value,n=typeof t=="bigint"?t*Ab-l4:t*-1-1;Hr(r,e.type.majorEncoded,n)}o(Vd,"encodeNegint");Vd.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*Ab-l4:t*-1-1;return n<Or[0]?1:n<Or[1]?2:n<Or[2]?3:n<Or[3]?5:9},"encodedSize");Vd.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function il(r,e,t,n){ls(r,e,t+n);let i=wc(r,e+t,e+t+n);return new qe(_e.bytes,i,t+n)}o(il,"toToken");function d4(r,e,t,n){return il(r,e,1,t)}o(d4,"decodeBytesCompact");function p4(r,e,t,n){return il(r,e,2,Kn(r,e+1,n))}o(p4,"decodeBytes8");function m4(r,e,t,n){return il(r,e,3,Vn(r,e+1,n))}o(m4,"decodeBytes16");function b4(r,e,t,n){return il(r,e,5,Gn(r,e+1,n))}o(b4,"decodeBytes32");function g4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer bytes lengths not supported`);return il(r,e,9,i)}o(g4,"decodeBytes64");function Gd(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===_e.string?e4(r.value):r.value),r.encodedBytes}o(Gd,"tokenBytes");function Ec(r,e){let t=Gd(e);Hr(r,e.type.majorEncoded,t.length),r.push(t)}o(Ec,"encodeBytes");Ec.encodedSize=o(function(e){let t=Gd(e);return Hr.encodedSize(t.length)+t.length},"encodedSize");Ec.compareTokens=o(function(e,t){return NB(Gd(e),Gd(t))},"compareTokens");function NB(r,e){return r.length<e.length?-1:r.length>e.length?1:n4(r,e)}o(NB,"compareBytes");function ol(r,e,t,n,i){let s=t+n;ls(r,e,s);let f=new qe(_e.string,Qw(r,e+t,e+s),s);return i.retainStringBytes===!0&&(f.byteValue=wc(r,e+t,e+s)),f}o(ol,"toToken");function v4(r,e,t,n){return ol(r,e,1,t,n)}o(v4,"decodeStringCompact");function y4(r,e,t,n){return ol(r,e,2,Kn(r,e+1,n),n)}o(y4,"decodeString8");function x4(r,e,t,n){return ol(r,e,3,Vn(r,e+1,n),n)}o(x4,"decodeString16");function w4(r,e,t,n){return ol(r,e,5,Gn(r,e+1,n),n)}o(w4,"decodeString32");function _4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer string lengths not supported`);return ol(r,e,9,i,n)}o(_4,"decodeString64");var E4=Ec;function Ac(r,e,t,n){return new qe(_e.array,n,t)}o(Ac,"toToken");function A4(r,e,t,n){return Ac(r,e,1,t)}o(A4,"decodeArrayCompact");function S4(r,e,t,n){return Ac(r,e,2,Kn(r,e+1,n))}o(S4,"decodeArray8");function M4(r,e,t,n){return Ac(r,e,3,Vn(r,e+1,n))}o(M4,"decodeArray16");function T4(r,e,t,n){return Ac(r,e,5,Gn(r,e+1,n))}o(T4,"decodeArray32");function C4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer array lengths not supported`);return Ac(r,e,9,i)}o(C4,"decodeArray64");function k4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Ac(r,e,1,1/0)}o(k4,"decodeArrayIndefinite");function Wd(r,e){Hr(r,_e.array.majorEncoded,e.value)}o(Wd,"encodeArray");Wd.compareTokens=Si.compareTokens;Wd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function Sc(r,e,t,n){return new qe(_e.map,n,t)}o(Sc,"toToken");function I4(r,e,t,n){return Sc(r,e,1,t)}o(I4,"decodeMapCompact");function D4(r,e,t,n){return Sc(r,e,2,Kn(r,e+1,n))}o(D4,"decodeMap8");function R4(r,e,t,n){return Sc(r,e,3,Vn(r,e+1,n))}o(R4,"decodeMap16");function O4(r,e,t,n){return Sc(r,e,5,Gn(r,e+1,n))}o(O4,"decodeMap32");function N4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer map lengths not supported`);return Sc(r,e,9,i)}o(N4,"decodeMap64");function P4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Sc(r,e,1,1/0)}o(P4,"decodeMapIndefinite");function Jd(r,e){Hr(r,_e.map.majorEncoded,e.value)}o(Jd,"encodeMap");Jd.compareTokens=Si.compareTokens;Jd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function B4(r,e,t,n){return new qe(_e.tag,t,1)}o(B4,"decodeTagCompact");function L4(r,e,t,n){return new qe(_e.tag,Kn(r,e+1,n),2)}o(L4,"decodeTag8");function U4(r,e,t,n){return new qe(_e.tag,Vn(r,e+1,n),3)}o(U4,"decodeTag16");function F4(r,e,t,n){return new qe(_e.tag,Gn(r,e+1,n),5)}o(F4,"decodeTag32");function $4(r,e,t,n){return new qe(_e.tag,Wn(r,e+1,n),9)}o($4,"decodeTag64");function Yd(r,e){Hr(r,_e.tag.majorEncoded,e.value)}o(Yd,"encodeTag");Yd.compareTokens=Si.compareTokens;Yd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");var $B=20,qB=21,jB=22,HB=23;function q4(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${yt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new qe(_e.null,null,1):new qe(_e.undefined,void 0,1)}o(q4,"decodeUndefined");function j4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return new qe(_e.break,void 0,1)}o(j4,"decodeBreak");function Sb(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${yt} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${yt} Infinity values are not supported`)}return new qe(_e.float,r,e)}o(Sb,"createToken");function H4(r,e,t,n){return Sb(Mb(r,e+1),3,n)}o(H4,"decodeFloat16");function z4(r,e,t,n){return Sb(Tb(r,e+1),5,n)}o(z4,"decodeFloat32");function K4(r,e,t,n){return Sb(J4(r,e+1),9,n)}o(K4,"decodeFloat64");function Zd(r,e,t){let n=e.value;if(n===!1)r.push([_e.float.majorEncoded|$B]);else if(n===!0)r.push([_e.float.majorEncoded|qB]);else if(n===null)r.push([_e.float.majorEncoded|jB]);else if(n===void 0)r.push([_e.float.majorEncoded|HB]);else{let i,s=!1;(!t||t.float64!==!0)&&(G4(n),i=Mb(Wi,1),n===i||Number.isNaN(n)?(Wi[0]=249,r.push(Wi.slice(0,3)),s=!0):(W4(n),i=Tb(Wi,1),n===i&&(Wi[0]=250,r.push(Wi.slice(0,5)),s=!0))),s||(zB(n),i=J4(Wi,1),Wi[0]=251,r.push(Wi.slice(0,9)))}}o(Zd,"encodeFloat");Zd.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){G4(n);let i=Mb(Wi,1);if(n===i||Number.isNaN(n))return 3;if(W4(n),i=Tb(Wi,1),n===i)return 5}return 9},"encodedSize");var V4=new ArrayBuffer(9),Mi=new DataView(V4,1),Wi=new Uint8Array(V4,0);function G4(r){if(r===1/0)Mi.setUint16(0,31744,!1);else if(r===-1/0)Mi.setUint16(0,64512,!1);else if(Number.isNaN(r))Mi.setUint16(0,32256,!1);else{Mi.setFloat32(0,r);let e=Mi.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)Mi.setUint16(0,31744,!1);else if(t===0)Mi.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?Mi.setUint16(0,0):i<-14?Mi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Mi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(G4,"encodeFloat16");function Mb(r,e){if(r.length-e<2)throw new Error(`${yt} 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*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(Mb,"readFloat16");function W4(r){Mi.setFloat32(0,r,!1)}o(W4,"encodeFloat32");function Tb(r,e){if(r.length-e<4)throw new Error(`${yt} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(Tb,"readFloat32");function zB(r){Mi.setFloat64(0,r,!1)}o(zB,"encodeFloat64");function J4(r,e){if(r.length-e<8)throw new Error(`${yt} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(J4,"readFloat64");Zd.compareTokens=Si.compareTokens;function qt(r,e,t){throw new Error(`${yt} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(qt,"invalidMinor");function Xd(r){return()=>{throw new Error(`${yt} ${r}`)}}o(Xd,"errorer");var Be=[];for(let r=0;r<=23;r++)Be[r]=qt;Be[24]=i4;Be[25]=o4;Be[26]=s4;Be[27]=a4;Be[28]=qt;Be[29]=qt;Be[30]=qt;Be[31]=qt;for(let r=32;r<=55;r++)Be[r]=qt;Be[56]=f4;Be[57]=c4;Be[58]=u4;Be[59]=h4;Be[60]=qt;Be[61]=qt;Be[62]=qt;Be[63]=qt;for(let r=64;r<=87;r++)Be[r]=d4;Be[88]=p4;Be[89]=m4;Be[90]=b4;Be[91]=g4;Be[92]=qt;Be[93]=qt;Be[94]=qt;Be[95]=Xd("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)Be[r]=v4;Be[120]=y4;Be[121]=x4;Be[122]=w4;Be[123]=_4;Be[124]=qt;Be[125]=qt;Be[126]=qt;Be[127]=Xd("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)Be[r]=A4;Be[152]=S4;Be[153]=M4;Be[154]=T4;Be[155]=C4;Be[156]=qt;Be[157]=qt;Be[158]=qt;Be[159]=k4;for(let r=160;r<=183;r++)Be[r]=I4;Be[184]=D4;Be[185]=R4;Be[186]=O4;Be[187]=N4;Be[188]=qt;Be[189]=qt;Be[190]=qt;Be[191]=P4;for(let r=192;r<=215;r++)Be[r]=B4;Be[216]=L4;Be[217]=U4;Be[218]=F4;Be[219]=$4;Be[220]=qt;Be[221]=qt;Be[222]=qt;Be[223]=qt;for(let r=224;r<=243;r++)Be[r]=Xd("simple values are not supported");Be[244]=qt;Be[245]=qt;Be[246]=qt;Be[247]=q4;Be[248]=Xd("simple values are not supported");Be[249]=H4;Be[250]=z4;Be[251]=K4;Be[252]=qt;Be[253]=qt;Be[254]=qt;Be[255]=j4;var Ji=[];for(let r=0;r<24;r++)Ji[r]=new qe(_e.uint,r,1);for(let r=-1;r>=-24;r--)Ji[31-r]=new qe(_e.negint,r,1);Ji[64]=new qe(_e.bytes,new Uint8Array(0),1);Ji[96]=new qe(_e.string,"",1);Ji[128]=new qe(_e.array,0,1);Ji[160]=new qe(_e.map,0,1);Ji[244]=new qe(_e.false,!1,1);Ji[245]=new qe(_e.true,!0,1);Ji[246]=new qe(_e.null,null,1);function Y4(r){switch(r.type){case _e.false:return Ao([244]);case _e.true:return Ao([245]);case _e.null:return Ao([246]);case _e.bytes:return r.value.length?void 0:Ao([64]);case _e.string:return r.value===""?Ao([96]):void 0;case _e.array:return r.value===0?Ao([128]):void 0;case _e.map:return r.value===0?Ao([160]):void 0;case _e.uint:return r.value<24?Ao([Number(r.value)]):void 0;case _e.negint:if(r.value>=-24)return Ao([31-Number(r.value)])}}o(Y4,"quickEncodeToken");var VB={float64:!1,mapSorter:JB,quickEncodeToken:Y4};function GB(){let r=[];return r[_e.uint.major]=Si,r[_e.negint.major]=Vd,r[_e.bytes.major]=Ec,r[_e.string.major]=E4,r[_e.array.major]=Wd,r[_e.map.major]=Jd,r[_e.tag.major]=Yd,r[_e.float.major]=Zd,r}o(GB,"makeCborEncoders");var Z4=GB(),Cb=new _c,tf=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(`${Eb} object contains circular references`);return new tf(t,e)}};o(tf,"Ref");var Zs={null:new qe(_e.null,null),undefined:new qe(_e.undefined,void 0),true:new qe(_e.true,!0),false:new qe(_e.false,!1),emptyArray:new qe(_e.array,0),emptyMap:new qe(_e.map,0)},Xs={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new qe(_e.float,r):r>=0?new qe(_e.uint,r):new qe(_e.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new qe(_e.uint,r):new qe(_e.negint,r)},Uint8Array(r,e,t,n){return new qe(_e.bytes,r)},string(r,e,t,n){return new qe(_e.string,r)},boolean(r,e,t,n){return r?Zs.true:Zs.false},null(r,e,t,n){return Zs.null},undefined(r,e,t,n){return Zs.undefined},ArrayBuffer(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[Zs.emptyArray,new qe(_e.break)]:Zs.emptyArray;n=tf.createCheck(n,r);let i=[],s=0;for(let f of r)i[s++]=Qd(f,t,n);return t.addBreakTokens?[new qe(_e.array,r.length),i,new qe(_e.break)]:[new qe(_e.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),f=i?r.size:s.length;if(!f)return t.addBreakTokens===!0?[Zs.emptyMap,new qe(_e.break)]:Zs.emptyMap;n=tf.createCheck(n,r);let u=[],d=0;for(let y of s)u[d++]=[Qd(y,t,n),Qd(i?r.get(y):r[y],t,n)];return WB(u,t),t.addBreakTokens?[new qe(_e.map,f),u,new qe(_e.break)]:[new qe(_e.map,f),u]}};Xs.Map=Xs.Object;Xs.Buffer=Xs.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Xs[`${r}Array`]=Xs.DataView;function Qd(r,e={},t){let n=Jw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||Xs[n];if(typeof i=="function"){let f=i(r,n,e,t);if(f!=null)return f}let s=Xs[n];if(!s)throw new Error(`${Eb} unsupported type: ${n}`);return s(r,n,e,t)}o(Qd,"objectToTokens");function WB(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(WB,"sortMapEntries");function JB(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=Z4[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(JB,"mapSorter");function X4(r,e,t,n){if(Array.isArray(e))for(let i of e)X4(r,i,t,n);else t[e.type.major](r,e,n)}o(X4,"tokensToEncoded");function YB(r,e,t){let n=Qd(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 f=s.encodedSize(n,t),u=new _c(f);if(s(u,n,t),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return _b(u.chunks[0])}}return Cb.reset(),X4(Cb,n,e,t),Cb.toBytes(!0)}o(YB,"encodeCustom");function kb(r,e){return e=Object.assign({},VB,e),YB(r,Z4,e)}o(kb,"encode");var ZB={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},e0=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=Ji[e];if(t===void 0){let n=Be[e];if(!n)throw new Error(`${yt} 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(e0,"Tokeniser");var sl=Symbol.for("DONE"),t0=Symbol.for("BREAK");function XB(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=al(e,t);if(s===t0){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed array`)}if(s===sl)throw new Error(`${yt} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(XB,"tokenToArray");function QB(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let f=0;f<r.value;f++){let u=al(e,t);if(u===t0){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed map`)}if(u===sl)throw new Error(`${yt} found map but not enough entries (got ${f} [no key], expected ${r.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${yt} non-string keys not supported (got ${typeof u})`);if(t.rejectDuplicateMapKeys===!0&&(n&&s.has(u)||!n&&u in i))throw new Error(`${yt} found repeat map key "${u}"`);let d=al(e,t);if(d===sl)throw new Error(`${yt} found map but not enough entries (got ${f} [no value], expected ${r.value})`);n?s.set(u,d):i[u]=d}return n?s:i}o(QB,"tokenToMap");function al(r,e){if(r.done())return sl;let t=r.next();if(t.type===_e.break)return t0;if(t.type.terminal)return t.value;if(t.type===_e.array)return XB(t,r,e);if(t.type===_e.map)return QB(t,r,e);if(t.type===_e.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=al(r,e);return e.tags[t.value](n)}throw new Error(`${yt} tag not supported (${t.value})`)}throw new Error("unsupported")}o(al,"tokensToObject");function Ib(r,e){if(!(r instanceof Uint8Array))throw new Error(`${yt} data to decode must be a Uint8Array`);e=Object.assign({},ZB,e);let t=e.tokenizer||new e0(r,e),n=al(t,e);if(n===sl)throw new Error(`${yt} did not find any content to decode`);if(n===t0)throw new Error(`${yt} got unexpected break`);if(!t.done())throw new Error(`${yt} too many terminals, data makes no sense`);return n}o(Ib,"decode");ji();var Q4=42;function tL(r){if(r.asCID!==r)return null;let e=Ye.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new qe(_e.tag,Q4),new qe(_e.bytes,t)]}o(tL,"cidEncoder");function rL(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(rL,"undefinedEncoder");function nL(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(nL,"numberEncoder");var iL={float64:!0,typeEncoders:{Object:tL,undefined:rL,number:nL}};function oL(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ye.decode(r.subarray(1))}o(oL,"cidDecoder");var e5={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};e5.tags[Q4]=oL;var sL="dag-cbor",Mc=113,rf=o(r=>kb(r,iL),"encode"),Db=o(r=>Ib(r,e5),"decode");var aL=24;async function t5(r){let e=await Qa({value:r,codec:Yi,hasher:Fs});return{cid:e.cid,linkedBlock:e.bytes}}o(t5,"encodePayload");function fL(r,e=aL){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(fL,"pad");async function cL(r){return(await Qa({value:r,codec:Yi,hasher:od})).cid}o(cL,"encodeIdentityCID");function uL(r){if(r=Ye.asCID(r),r.code!==Mc)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==od.code)throw new Error("CID must use identity multihash");return Db(r.multihash.digest)}o(uL,"decodeIdentityCID");async function r5(r,e){return fL((await cL(r)).bytes,e)}o(r5,"prepareCleartext");function n5(r){return uL(Ye.decodeFirst(r)[0])}o(n5,"decodeCleartext");var i5=Symbol("abortable"),r0=Symbol("aborted");function o5(r,e){if(e.aborted)return Promise.reject(r0);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(r0)}),Promise.race([r,n])}o(o5,"abortable");var s5=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 n0="utils_abort_request";var hn;(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"})(hn||(hn={}));var a5={[hn.PARSE_ERROR]:"Parse error",[hn.INVALID_REQUEST]:"Invalid request",[hn.METHOD_NOT_FOUND]:"Method not found",[hn.INVALID_PARAMS]:"Invalid params",[hn.INTERNAL_ERROR]:"Internal error"};function lL(r){return-32e3>=r&&r>=-32099}o(lL,"isServerError");function i0(r){return a5[r.toString()]??(lL(r)?"Server error":"Application error")}o(i0,"getErrorMessage");var Tn=class extends Error{static fromObject(e){return new Tn(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,Tn.prototype),this.code=e,this.data=n,this.message=t??i0(e)}};o(Tn,"RPCError");function fl(r){let e=a5[r];return o(function(n){return new Tn(r,e,n)},"createError")}o(fl,"createErrorFactory");var hL=fl(hn.PARSE_ERROR),eJ=fl(hn.INVALID_REQUEST),tJ=fl(hn.METHOD_NOT_FOUND),rJ=fl(hn.INVALID_PARAMS),nJ=fl(hn.INTERNAL_ERROR);function dL(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(dL,"_checkPrivateRedeclaration");function pL(r,e){return e.get?e.get.call(r):e.value}o(pL,"_classApplyDescriptorGet");function mL(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(mL,"_classApplyDescriptorSet");function f5(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(f5,"_classExtractFieldDescriptor");function Rb(r,e){var t=f5(r,e,"get");return pL(r,t)}o(Rb,"_classPrivateFieldGet");function bL(r,e,t){dL(r,e),e.set(r,t)}o(bL,"_classPrivateFieldInit");function gL(r,e,t){var n=f5(r,e,"set");return mL(r,n,t),t}o(gL,"_classPrivateFieldSet");var cl=new WeakMap,Tc=class{get connection(){return Rb(this,cl)}createID(){return s5()}request(e,t=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(r0);let s=this.createID(),f=Rb(this,cl).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw Tn.fromObject(u.error);return u.result});return i==null?f:(i.addEventListener("abort",()=>{this.notify(n0,{id:s})}),o5(f,i))}async notify(e,t=void 0){await Rb(this,cl).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){bL(this,cl,{writable:!0,value:void 0}),gL(this,cl,e)}};o(Tc,"RPCClient");function c5(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:i0(e)}}}o(c5,"createErrorResponse");function vL(r,e,t){console.warn("Unhandled handler error",e,t)}o(vL,"fallbackOnHandlerError");function yL(r,e){console.warn("Unhandled invalid message",e)}o(yL,"fallbackOnInvalidMessage");function xL(r,e){console.warn("Unhandled notification",e)}o(xL,"fallbackOnNotification");function u5(r,e={}){let t=e.onHandlerError??vL,n=e.onInvalidMessage??yL,i=e.onNotification??xL,s={};function f(u,d){if(d.method===n0){let y=d.params?.id;y!=null&&s[y]?.abort()}else i(u,d)}return o(f,"handleNotification"),o(async function(d,y){let w=y.id;if(y.jsonrpc!=="2.0"||y.method==null)return w==null?(n(d,y),null):c5(w,hn.INVALID_REQUEST);let A=r[y.method];if(A==null)return w==null?(f(d,y),null):c5(w,hn.METHOD_NOT_FOUND);try{let O;if(w!=null&&A[i5]){let I=new AbortController;s[w]=I,O=A(d,y.params,{signal:I.signal})}else O=A(d,y.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return w==null||s[w]?.signal.aborted?null:{jsonrpc:"2.0",id:w,result:R}}catch(O){if(w==null||s[w]?.signal.aborted)return t(d,y,O),null;let R;if(O instanceof Tn)R=O.toObject();else{t(d,y,O);let I=O.code??-32e3;R={code:I,message:O.message||i0(I)}}return{jsonrpc:"2.0",id:w,error:R}}finally{w!=null&&delete s[w]}},"handleRequest")}o(u5,"createHandler");ji();var b8=Ft(m8(),1),tn=Ft(ff(),1);var bU=`
656
+ `+String(n)));Mv(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){Sv(r,e,n)})}o(rj,"dispatchBatch");function Sv(r,e,t){Mv(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(Sv,"failedDispatch");function Mv(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Mv,"resolveCacheHits");function nj(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(nj,"getValidMaxBatchSize");function ij(r){var e=r&&r.batchScheduleFn;if(e===void 0)return ej;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(ij,"getValidBatchScheduleFn");function oj(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(oj,"getValidCacheKeyFn");function sj(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(sj,"getValidCacheMap");function aj(r){return r&&r.name?r.name:null}o(aj,"getValidName");function C9(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(C9,"isArrayLike");k9.exports=Qq});var K9=Re((Xne,z9)=>{"use strict";function Sj(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 f=r.length,u=r.charAt(0),d=Math.log(f)/Math.log(256),y=Math.log(256)/Math.log(f);function w(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var I=0,B=0,Y=0,P=R.length;Y!==P&&R[Y]===0;)Y++,I++;for(var J=(P-Y)*y+1>>>0,ee=new Uint8Array(J);Y!==P;){for(var Z=R[Y],ne=0,V=J-1;(Z!==0||ne<B)&&V!==-1;V--,ne++)Z+=256*ee[V]>>>0,ee[V]=Z%f>>>0,Z=Z/f>>>0;if(Z!==0)throw new Error("Non-zero carry");B=ne,Y++}for(var j=J-B;j!==J&&ee[j]===0;)j++;for(var H=u.repeat(I);j<J;++j)H+=r.charAt(ee[j]);return H}o(w,"encode");function A(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var I=0;if(R[I]!==" "){for(var B=0,Y=0;R[I]===u;)B++,I++;for(var P=(R.length-I)*d+1>>>0,J=new Uint8Array(P);R[I];){var ee=e[R.charCodeAt(I)];if(ee===255)return;for(var Z=0,ne=P-1;(ee!==0||Z<Y)&&ne!==-1;ne--,Z++)ee+=f*J[ne]>>>0,J[ne]=ee%256>>>0,ee=ee/256>>>0;if(ee!==0)throw new Error("Non-zero carry");Y=Z,I++}if(R[I]!==" "){for(var V=P-Y;V!==P&&J[V]===0;)V++;for(var j=new Uint8Array(B+(P-V)),H=B;V!==P;)j[H++]=J[V++];return j}}}o(A,"decodeUnsafe");function O(R){var I=A(R);if(I)return I;throw new Error("Non-base"+f+" character")}return o(O,"decode"),{encode:w,decodeUnsafe:A,decode:O}}o(Sj,"base");z9.exports=Sj});var wp=Re((Qne,V9)=>{"use strict";var Mj=new TextDecoder,Tj=o(r=>Mj.decode(r),"decodeText"),Cj=new TextEncoder,kj=o(r=>Cj.encode(r),"encodeText");function Ij(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(Ij,"concat");V9.exports={decodeText:Tj,encodeText:kj,concat:Ij}});var W9=Re((eie,G9)=>{"use strict";var{encodeText:Dj}=wp(),_p=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=Dj(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(_p,"Base");G9.exports=_p});var Y9=Re((tie,J9)=>{"use strict";var Rj=o((r,e,t)=>{let n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),f=0,u=0,d=0;for(let y=0;y<i;++y){let w=n[r[y]];if(w===void 0)throw new SyntaxError("Invalid character "+r[y]);u=u<<t|w,f+=t,f>=8&&(f-=8,s[d++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return s},"decode"),Oj=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",f=0,u=0;for(let d=0;d<r.length;++d)for(u=u<<8|r[d],f+=8;f>t;)f-=t,s+=e[i&u>>f];if(f&&(s+=e[i&u<<t-f]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Nj=o(r=>e=>({encode(t){return Oj(t,e,r)},decode(t){return Rj(t,e,r)}}),"rfc4648");J9.exports={rfc4648:Nj}});var eA=Re((rie,Q9)=>{"use strict";var Kl=K9(),Pj=W9(),{rfc4648:Gr}=Y9(),{decodeText:Bj,encodeText:Lj}=wp(),Uj=o(()=>({encode:Bj,decode:Lj}),"identity"),Z9=[["identity","\0",Uj,""],["base2","0",Gr(1),"01"],["base8","7",Gr(3),"01234567"],["base10","9",Kl,"0123456789"],["base16","f",Gr(4),"0123456789abcdef"],["base16upper","F",Gr(4),"0123456789ABCDEF"],["base32hex","v",Gr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",Gr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",Gr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",Gr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",Gr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",Gr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",Gr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Kl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Kl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Kl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Kl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",Gr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],X9=Z9.reduce((r,e)=>(r[e[0]]=new Pj(e[0],e[1],e[2],e[3]),r),{}),Fj=Z9.reduce((r,e)=>(r[e[1]]=X9[e[0]],r),{});Q9.exports={names:X9,codes:Fj}});var nA=Re((_s,rA)=>{"use strict";var ou=eA(),{encodeText:$j,decodeText:Ep,concat:tA}=wp();function qj(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=Mf(r);return Kj(t,e),tA([n,e],n.length+e.length)}o(qj,"multibase");function jj(r,e){let t=Mf(r),n=$j(t.encode(e));return tA([t.codeBuf,n],t.codeBuf.length+n.length)}o(jj,"encode");function Hj(r){r instanceof Uint8Array&&(r=Ep(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),Mf(r[0]).decode(r.substring(1))}o(Hj,"decode");function zj(r){if(r instanceof Uint8Array&&(r=Ep(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return Mf(r[0]).name}catch{return!1}}o(zj,"isEncoded");function Kj(r,e){Mf(r).decode(Ep(e))}o(Kj,"validEncode");function Mf(r){if(Object.prototype.hasOwnProperty.call(ou.names,r))return ou.names[r];if(Object.prototype.hasOwnProperty.call(ou.codes,r))return ou.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(Mf,"encoding");function Vj(r){return r instanceof Uint8Array&&(r=Ep(r)),Mf(r[0])}o(Vj,"encodingFromData");_s=rA.exports=qj;_s.encode=jj;_s.decode=Hj;_s.isEncoded=zj;_s.encoding=Mf;_s.encodingFromData=Vj;var Gj=Object.freeze(ou.names),Wj=Object.freeze(ou.codes);_s.names=Gj;_s.codes=Wj});var aA=Re((nie,sA)=>{sA.exports=oA;var iA=128,Jj=127,Yj=~Jj,Zj=Math.pow(2,31);function oA(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Zj;)e[t++]=r&255|iA,r/=128;for(;r&Yj;)e[t++]=r&255|iA,r>>>=7;return e[t]=r|0,oA.bytes=t-n+1,e}o(oA,"encode")});var uA=Re((iie,cA)=>{cA.exports=Bv;var Xj=128,fA=127;function Bv(r,n){var t=0,n=n||0,i=0,s=n,f,u=r.length;do{if(s>=u)throw Bv.bytes=0,new RangeError("Could not decode varint");f=r[s++],t+=i<28?(f&fA)<<i:(f&fA)*Math.pow(2,i),i+=7}while(f>=Xj);return Bv.bytes=s-n,t}o(Bv,"read")});var hA=Re((oie,lA)=>{var Qj=Math.pow(2,7),eH=Math.pow(2,14),tH=Math.pow(2,21),rH=Math.pow(2,28),nH=Math.pow(2,35),iH=Math.pow(2,42),oH=Math.pow(2,49),sH=Math.pow(2,56),aH=Math.pow(2,63);lA.exports=function(r){return r<Qj?1:r<eH?2:r<tH?3:r<rH?4:r<nH?5:r<iH?6:r<oH?7:r<sH?8:r<aH?9:10}});var pA=Re((sie,dA)=>{dA.exports={encode:aA(),decode:uA(),encodingLength:hA()}});var bA=Re((aie,mA)=>{"use strict";var fH=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});mA.exports={names:fH}});var EA=Re((fie,_A)=>{"use strict";var gA=nA(),su=pA(),{names:Vl}=bA(),{toString:Ap}=(ic(),Vh(X3)),{fromString:cH}=(cd(),Vh(Z3)),{concat:uH}=(Km(),Vh(_3)),au={};for(let r in Vl){let e=r;au[Vl[e]]=e}Object.freeze(au);function lH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ap(r,"base16")}o(lH,"toHexString");function hH(r){return cH(r,"base16")}o(hH,"fromHexString");function dH(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ap(gA.encode("base58btc",r)).slice(1)}o(dH,"toB58String");function pH(r){let e=r instanceof Uint8Array?Ap(r):r;return gA.decode("z"+e)}o(pH,"fromB58String");function vA(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=su.decode(r);if(!xA(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(su.decode.bytes);let t=su.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(su.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${Ap(r,"base16")}`);return{code:e,name:au[e],length:t,digest:r}}o(vA,"decode");function mH(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=yA(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=su.encode(n),s=su.encode(t);return uH([i,s,r],i.length+s.length+r.length)}o(mH,"encode");function yA(r){let e=r;if(typeof r=="string"){if(Vl[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=Vl[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(au[e]===void 0&&!Lv(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(yA,"coerceCode");function Lv(r){return r>0&&r<16}o(Lv,"isAppCode");function xA(r){return!!(Lv(r)||au[r])}o(xA,"isValidCode");function wA(r){vA(r)}o(wA,"validate");function bH(r){return wA(r),r.subarray(0,2)}o(bH,"prefix");_A.exports={names:Vl,codes:au,toHexString:lH,fromHexString:hH,toB58String:dH,fromB58String:pH,decode:vA,encode:mH,coerceCode:yA,isAppCode:Lv,validate:wA,prefix:bH,isValidCode:xA}});var OK={};Zt(OK,{CeramicURIValidator:()=>Xv,default:()=>RK,getCeramicPlugin:()=>Np,streamIdToCeramicURI:()=>Op});module.exports=Vh(OK);var d7=Ft(y3());function yD(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(yD,"_catch");function xD(){let r=new Map;return function(e,t){try{let i=function(f){if(n)return f;let u=r.get(e.didUrl);return u!==void 0?u:Promise.resolve(t()).then(function(d){var y;return((y=d.didResolutionMetadata)==null?void 0:y.error)!=="notFound"&&r.set(e.didUrl,d),d})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(f){return n=1,f})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(xD,"inMemoryCache");function wD(r,e){return e()}o(wD,"noCache");var _D="(?:%[0-9a-fA-F]{2})",x3=`(?:[a-zA-Z0-9._-]|${_D})`,ED="([a-z0-9]+)",AD=`((?:${x3}*:)*(${x3}+))`,w3="[a-zA-Z0-9_.:%-]",SD=`;${w3}+=${w3}*`,MD=`((${SD})*)`,TD="(/[^#?]*)?",CD="([?][^#]*)?",kD="(#.*)?",ID=new RegExp(`^did:${ED}:${AD}${MD}${TD}${CD}${kD}$`);function DD(r){if(r===""||!r)return null;let e=r.match(ID);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(DD,"parse");var Gh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function RD(r){return function(e,t,n){try{return Promise.resolve(yD(function(){return Promise.resolve(r(e,t,n)).then(function(i){return{...Gh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...Gh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(RD,"wrapLegacyResolver");var Ru=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?xD():t.cache||wD,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=RD(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=DD(e);if(i===null)return Promise.resolve({...Gh,didResolutionMetadata:{error:"invalidDid"}});let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve({...Gh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(Ru,"Resolver");Km();cd();ic();Wh();Ou();l1();var hb=Ft(sx()),Iw=Ft(x1()),db=Ft(O6()),Hd=Ft(Bd()),Dw=Ft(iw()),tl=Ft(fw()),pb=Ft(_w()),mb=Ft(Ga());function Ai(r){return Rt(r,"base64url")}o(Ai,"bytesToBase64url");function Mn(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return $t(e,"base64url")}o(Mn,"base64ToBytes");function bb(r){return $t(r,"base58btc")}o(bb,"base58ToBytes");function cb(r){let e=r.startsWith("0x")?r.substring(2):r;return $t(e.toLowerCase(),"base16")}o(cb,"hexToBytes");function ub(r){return Ai($t(r))}o(ub,"encodeBase64url");function Rw(r){return Rt(Mn(r))}o(Rw,"decodeBase64url");function Za(r){return Rt(r,"base16")}o(Za,"bytesToHex");function Ow(r){return $t(r)}o(Ow,"stringToBytes");function rB({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set($t(r,"base16"),0),i.set($t(e,"base16"),32),n){if(typeof t>"u")throw new Error("Signer did not return a recoveryParam");i[64]=t}return Ai(i)}o(rB,"toJose");function nB(r){let e=Mn(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=Za(e.slice(0,32)),n=Za(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(nB,"fromJose");function Nw(r,e){return Fi([Mn(r),Mn(e)])}o(Nw,"toSealed");var iB=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,oB=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,sB=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function aB(r){if(typeof r=="string"){if(iB.test(r))return cb(r);if(oB.test(r))return bb(r);if(sB.test(r))return Mn(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(aB,"parseKey");function Pw(r){let e=typeof r=="string"?$t(r):r;return(0,hb.hash)(e)}o(Pw,"sha256");function fB(r){return new Uint8Array(Iw.keccak_256.arrayBuffer(r))}o(fB,"keccak");function cB(r){let e=$t(r.slice(2),"base16");return`0x${Rt(fB(e).slice(-20),"base16")}`}o(cB,"toEthereumAddress");function lb(r,e=new Uint8Array(4)){let t=$t(r.toString(),"base10");return e.set(t,4-t.length),e}o(lb,"writeUint32BE");var fb=o(r=>Fi([lb(r.length),r]),"lengthAndInput");function Bw(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=Fi([fb($t(t)),fb(typeof n>"u"?new Uint8Array(0):n),fb(typeof i>"u"?new Uint8Array(0):i),lb(e)]);return(0,hb.hash)(Fi([lb(1),r,s]))}o(Bw,"concatKDF");var qG=new db.ec("secp256k1");function Lw(r){let e=aB(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"?Ow(t):t,i=(0,Hd.sign)(e,n);return Promise.resolve(Ai(i))}catch(n){return Promise.reject(n)}}}o(Lw,"EdDSASigner");function Uw(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Uw,"instanceOfEcdsaSignature");function Ew(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Uw(i))return rB(i,r);if(r&&typeof nB(i).recoveryParam>"u")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(Ew,"ES256KSignerAlg");function Aw(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Uw(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(Aw,"Ed25519SignerAlg");var uB={ES256K:Ew(),"ES256K-R":Ew(!0),Ed25519:Aw(),EdDSA:Aw()};function lB(r){let e=uB[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(lB,"SignerAlg");var gb=new db.ec("secp256k1");function jd(r,e=!1){let t=Mn(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=Za(t.slice(0,32)),i=Za(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(jd,"toSignatureObject");function vb(r){if(r.publicKeyBase58)return bb(r.publicKeyBase58);if(r.publicKeyBase64)return Mn(r.publicKeyBase64);if(r.publicKeyHex)return cb(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return cb(gb.keyFromPublic({x:Za(Mn(r.publicKeyJwk.x)),y:Za(Mn(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=$u;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(vb,"extractPublicKeyBytes");function hB(r,e,t){let n=Pw(r),i=jd(e),s=t.filter(({ethereumAddress:d,blockchainAccountId:y})=>typeof d>"u"&&typeof y>"u"),f=t.filter(({ethereumAddress:d,blockchainAccountId:y})=>typeof d<"u"||typeof y!==void 0),u=s.find(d=>{try{let y=vb(d);return gb.keyFromPublic(y).verify(n,i)}catch{return!1}});if(!u&&f.length>0&&(u=Fw(r,e,f)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(hB,"verifyES256K");function Fw(r,e,t){let n;if(e.length>86)n=[jd(e,!0)];else{let f=jd(e,!1);n=[{...f,recoveryParam:0},{...f,recoveryParam:1}]}let i=o(f=>{let u=Pw(r),d=gb.recoverPubKey(u,f,f.recoveryParam),y=d.encode("hex"),w=d.encode("hex",!0),A=cB(y);return t.find(R=>{var I,B,Y;let P=Za(vb(R));return P===y||P===w||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===A||((B=R.blockchainAccountId)==null||(Y=B.split("@eip155"))==null?void 0:Y[0].toLowerCase())===A})},"checkSignatureAgainstSigner"),s=n.map(i).filter(f=>typeof f<"u");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(Fw,"verifyRecoverableES256K");function Sw(r,e,t){let n=Ow(r),i=Mn(e),s=t.find(f=>(0,Hd.verify)(vb(f),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Sw,"verifyEd25519");var dB={ES256K:hB,"ES256K-R":Fw,Ed25519:Sw,EdDSA:Sw};function $w(r){let e=dB[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o($w,"VerifierAlgorithm");$w.toSignatureObject=jd;var qw=o(function(r,e,t={},n={}){try{t.alg||(t.alg=pB);let i=typeof r=="string"?r:Mw(r,n.canonicalize),s=[Mw(t,n.canonicalize),i].join("."),f=lB(t.alg);return Promise.resolve(f(s,e)).then(function(u){return[s,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var pB="ES256K";function Mw(r,e=!1){return ub(e?(0,Dw.default)(r):JSON.stringify(r))}o(Mw,"encodeSection");function mB(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Rw(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(mB,"decodeJWS");function bB({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),$w(r.alg)(e,t,n)}o(bB,"verifyJWSDecoded");function jw(r,e){let t=mB(r);return bB(t,e)}o(jw,"verifyJWS");function gB(r,e,t){for(var n;;){var i=r();if(Ys(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(Ys(s))s=s.s;else{n=1;break}if(e){var f=e();if(f&&f.then&&!Ys(f)){n=2;break}}}var u=new Xa,d=Sr.bind(null,u,2);return(n===0?i.then(w):n===1?s.then(y):f.then(A)).then(void 0,d),u;function y(O){s=O;do{if(e&&(f=e(),f&&f.then&&!Ys(f))){f.then(A).then(void 0,d);return}if(i=r(),!i||Ys(i)&&!i.v){Sr(u,1,s);return}if(i.then){i.then(w).then(void 0,d);return}s=t(),Ys(s)&&(s=s.v)}while(!s||!s.then);s.then(y).then(void 0,d)}o(y,"_resumeAfterBody");function w(O){O?(s=t(),s&&s.then?s.then(y).then(void 0,d):y(s)):Sr(u,1,s)}o(w,"_resumeAfterTest");function A(){(i=r())?i.then?i.then(w).then(void 0,d):w(i):Sr(u,1,s)}o(A,"_resumeAfterUpdate")}o(gB,"_for");var Hw=o(function(r,e){try{let n=function(y){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let t;xB(r);let i=JSON.parse(Rw(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Nw(r.ciphertext,r.tag),f=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),u=null,d=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,Mn(r.iv),f)).then(function(y){u=y}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let y=0;return gB(function(){return!u&&y<r.recipients.length},function(){return y++},function(){let w=r.recipients[y];Object.assign(w.header,i);let A=function(){if(w.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Mn(r.iv),f,w)).then(function(O){u=O})}();if(A&&A.then)return A.then(function(){})})}}()}();return Promise.resolve(d&&d.then?d.then(n):n(d))}catch(t){return Promise.reject(t)}},"decryptJWE"),Tw=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Sr(r,e,t){if(!r.s){if(t instanceof Xa)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=Sr.bind(null,r,e);return}if(t&&t.then){t.then(Sr.bind(null,r,e),Sr.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(Sr,"_settle");var Xa=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{Sr(n,1,s(this.v))}catch(f){Sr(n,2,f)}return n}else return this}return this.o=function(s){try{let f=s.v;s.s&1?Sr(n,1,e?e(f):f):t?Sr(n,1,t(f)):Sr(n,2,f)}catch(f){Sr(n,2,f)}},n},r}();function Ys(r){return r instanceof Xa&&r.s&1}o(Ys,"_isSettledPact");function vB(r,e,t){var n=-1,i,s;function f(u){try{for(;++n<r.length&&(!t||!t());)if(u=e(n),u&&u.then)if(Ys(u))u=u.v;else{u.then(f,s||(s=Sr.bind(null,i=new Xa,2)));return}i?Sr(i,1,u):i=u}catch(d){Sr(i||(i=new Xa),2,d)}}return o(f,"_cycle"),f(),i}o(vB,"_forTo");function yB(r,e,t){if(typeof r[Tw]=="function"){let w=function(A){try{for(;!(i=n.next()).done&&(!t||!t());)if(A=e(i.value),A&&A.then)if(Ys(A))A=A.v;else{A.then(w,f||(f=Sr.bind(null,s=new Xa,2)));return}s?Sr(s,1,A):s=A}catch(O){Sr(s||(s=new Xa),2,O)}};o(w,"_cycle");var n=r[Tw](),i,s,f;if(w(),n.return){var u=o(function(A){try{i.done||n.return()}catch{}return A},"_fixup");if(s&&s.then)return s.then(u,function(A){throw u(A)});u()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var d=[],y=0;y<r.length;y++)d.push(r[y]);return vB(d,function(w){return e(d[w])},t)}o(yB,"_forOf");function xB(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(xB,"validateJWE");function Cw({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let f={protected:n,iv:Ai(t),ciphertext:Ai(r),tag:Ai(e)};return s&&(f.aad=Ai(s)),i&&(f.recipients=[i]),f}o(Cw,"encodeJWE");var zw=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 Cw(i,n)})}else{let i=e[0].enc;if(!e.reduce((d,y)=>d&&y.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,f,u=yB(e,function(d){let y=function(){return s?Promise.resolve(d.encryptCek==null?void 0:d.encryptCek(s)).then(function(w){if(w){var A,O;(A=f)==null||(O=A.recipients)==null||O.push(w)}}):Promise.resolve(d.encrypt(r,t,n)).then(function(w){s=w.cek,f=Cw(w,n)})}();if(y&&y.then)return y.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return f}):f)}}catch(i){return Promise.reject(i)}},"createJWE");var Kw=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:f}){var u;if(s!=null&&s.error||f==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!f.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let y=((u=f.keyAgreement)==null?void 0:u.map(w=>typeof w=="string"?[...f.publicKey||[],...f.verificationMethod||[]].find(A=>A.id===w):w).filter(w=>typeof w<"u")).filter(w=>w.type==="X25519KeyAgreementKey2019"&&Boolean(w.publicKeyBase58));if(!y.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return y.map(w=>_B(bb(w.publicKeyBase58),w.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 Vw(r){let e=new pb.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,mb.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(Vw,"xc20pEncrypter");function wB(r){let e=o(function(s,f={},u){try{let d=ub(JSON.stringify(Object.assign({alg:i},f,{enc:n}))),y=new Uint8Array(Buffer.from(u?`${d}.${Ai(u)}`:d));return Promise.resolve({...t(s,y),protectedHeader:d})}catch(d){return Promise.reject(d)}},"encrypt"),t=Vw(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(wB,"xc20pDirEncrypter");function kw(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(f){return Promise.reject(f)}},"decrypt"),t=new pb.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(kw,"xc20pDirDecrypter");function _B(r,e){let t=o(function(u,d={},y){try{Object.assign(d,{alg:void 0});let w=(0,mb.randomBytes)(32);return Promise.resolve(wB(w).encrypt(u,d,y)).then(function(A){return Promise.resolve(n(w)).then(function(O){return{...A,recipient:O,cek:w}})})}catch(w){return Promise.reject(w)}},"encrypt"),n=o(function(u){try{let d=(0,tl.generateKeyPair)(),y=(0,tl.sharedKey)(d.secretKey,r),w=Bw(y,s,i),A=Vw(w)(u),O={encrypted_key:Ai(A.ciphertext),header:{alg:i,iv:Ai(A.iv),tag:Ai(A.tag),epk:{kty:"OKP",crv:f,x:Ai(d.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(d){return Promise.reject(d)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,f="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(_B,"x25519Encrypter");function EB(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(EB,"validateHeader");function Gw(r){let e=o(function(s,f,u,d){try{let A=function(){let B=Bw(R,n,t),Y=Nw(d.encrypted_key,d.header.tag);return Promise.resolve(kw(B).decrypt(Y,Mn(d.header.iv))).then(function(P){return P===null?null:kw(P).decrypt(s,f,u)})};o(A,"_temp4");var y,w;if(EB((y=d)==null?void 0:y.header),d=d,((w=d.header.epk)==null?void 0:w.crv)!==i||typeof d.header.epk.x>"u")return Promise.resolve(null);let O=Mn(d.header.epk.x),R,I=function(){if(r instanceof Uint8Array)R=(0,tl.sharedKey)(r,O);else return Promise.resolve(r(O)).then(function(B){R=B})}();return Promise.resolve(I&&I.then?I.then(A):A(I))}catch(A){return Promise.reject(A)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(Gw,"x25519Decrypter");u1();var zd=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),yb=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,f]of n.entries()){let u=[...i,s],d=Ye.asCID(f);d?yield[u.join("/"),d]:typeof f=="object"&&(yield*yb(f,u))}else{let s=Ye.asCID(n);s?yield[i.join("/"),s]:yield*yb(n,i)}}},"links"),xb=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"&&!Ye.asCID(n))if(Array.isArray(n))for(let[s,f]of n.entries()){let u=[...i,s];yield u.join("/"),typeof f=="object"&&!Ye.asCID(f)&&(yield*xb(f,u))}else yield*xb(n,i)}},"tree"),AB=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(f=>`[${JSON.stringify(f)}]`).join("")}`);let s=Ye.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),rl=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:zd(),bytes:zd(),value:zd(),asBlock:zd()})}links(){return yb(this.value,[])}tree(){return xb(this.value,[])}get(e="/"){return AB(this.value,e.split("/").filter(Boolean))}};o(rl,"Block");var Qa=o(async({value:r,codec:e,hasher:t})=>{if(typeof r>"u")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.encode(r),i=await t.digest(n),s=Ye.create(1,e.code,i);return new rl({value:r,bytes:n,cid:s})},"encode"),Ww=o(async({bytes:r,codec:e,hasher:t})=>{if(!r)throw new Error('Missing required argument "bytes"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let n=e.decode(r),i=await t.digest(r),s=Ye.create(1,e.code,i);return new rl({value:n,bytes:r,cid:s})},"decode");ji();Uu();c1();ed();var Yi={};Zt(Yi,{code:()=>Mc,decode:()=>Db,encode:()=>rf,name:()=>sL});var SB=["string","number","bigint","symbol"],MB=["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 Jw(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(SB.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(TB(r))return"Buffer";let t=CB(r);return t||"Object"}o(Jw,"is");function TB(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(TB,"isBuffer");function CB(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(MB.includes(e))return e}o(CB,"getObjectType");var _e=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(_e,"Type");_e.uint=new _e(0,"uint",!0);_e.negint=new _e(1,"negint",!0);_e.bytes=new _e(2,"bytes",!0);_e.string=new _e(3,"string",!0);_e.array=new _e(4,"array",!1);_e.map=new _e(5,"map",!1);_e.tag=new _e(6,"tag",!1);_e.float=new _e(7,"float",!0);_e.false=new _e(7,"false",!0);_e.true=new _e(7,"true",!0);_e.null=new _e(7,"null",!0);_e.undefined=new _e(7,"undefined",!0);_e.break=new _e(7,"break",!0);var qe=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(qe,"Token");var xc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",kB=new TextDecoder,IB=new TextEncoder;function Kd(r){return xc&&globalThis.Buffer.isBuffer(r)}o(Kd,"isBuffer");function _b(r){return r instanceof Uint8Array?Kd(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(_b,"asU8A");var Qw=xc?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):Zw(r,e,t):(r,e,t)=>t-e>64?kB.decode(r.subarray(e,t)):Zw(r,e,t),e4=xc?r=>r.length>64?globalThis.Buffer.from(r):Yw(r):r=>r.length>64?IB.encode(r):Yw(r),Ao=o(r=>Uint8Array.from(r),"fromArray"),wc=xc?(r,e,t)=>Kd(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),t4=xc?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),_b(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},r4=xc?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function n4(r,e){if(Kd(r)&&Kd(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(n4,"compare");function Yw(r,e=1/0){let t,n=r.length,i=null,s=[];for(let f=0;f<n;++f){if(t=r.charCodeAt(f),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+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(Yw,"utf8ToBytes");function Zw(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,f=i>239?4:i>223?3:i>191?2:1;if(e+f<=t){let u,d,y,w;switch(f){case 1:i<128&&(s=i);break;case 2:u=r[e+1],(u&192)===128&&(w=(i&31)<<6|u&63,w>127&&(s=w));break;case 3:u=r[e+1],d=r[e+2],(u&192)===128&&(d&192)===128&&(w=(i&15)<<12|(u&63)<<6|d&63,w>2047&&(w<55296||w>57343)&&(s=w));break;case 4:u=r[e+1],d=r[e+2],y=r[e+3],(u&192)===128&&(d&192)===128&&(y&192)===128&&(w=(i&15)<<18|(u&63)<<12|(d&63)<<6|y&63,w>65535&&w<1114112&&(s=w))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=f}return DB(n)}o(Zw,"utf8Slice");var Xw=4096;function DB(r){let e=r.length;if(e<=Xw)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Xw));return t}o(DB,"decodeCodePointsArray");var RB=256,_c=class{constructor(e=RB){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=r4(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=wc(n,0,this.cursor)}else t=t4(this.chunks,this.cursor);return e&&this.reset(),t}};o(_c,"Bl");var yt="CBOR decode error:",Eb="CBOR encode error:",nl=[];nl[23]=1;nl[24]=2;nl[25]=3;nl[26]=5;nl[27]=9;function ls(r,e,t){if(r.length-e<t)throw new Error(`${yt} not enough data for type`)}o(ls,"assertEnoughData");var Or=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Kn(r,e,t){ls(r,e,1);let n=r[e];if(t.strict===!0&&n<Or[0])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Kn,"readUint8");function Vn(r,e,t){ls(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Or[1])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Vn,"readUint16");function Gn(r,e,t){ls(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Or[2])throw new Error(`${yt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Gn,"readUint32");function Wn(r,e,t){ls(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<Or[3])throw new Error(`${yt} 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(`${yt} integers outside of the safe integer range are not supported`)}o(Wn,"readUint64");function i4(r,e,t,n){return new qe(_e.uint,Kn(r,e+1,n),2)}o(i4,"decodeUint8");function o4(r,e,t,n){return new qe(_e.uint,Vn(r,e+1,n),3)}o(o4,"decodeUint16");function s4(r,e,t,n){return new qe(_e.uint,Gn(r,e+1,n),5)}o(s4,"decodeUint32");function a4(r,e,t,n){return new qe(_e.uint,Wn(r,e+1,n),9)}o(a4,"decodeUint64");function Si(r,e){return Hr(r,0,e.value)}o(Si,"encodeUint");function Hr(r,e,t){if(t<Or[0]){let n=Number(t);r.push([e|n])}else if(t<Or[1]){let n=Number(t);r.push([e|24,n])}else if(t<Or[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Or[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<Or[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),f=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]=f&255,f=f>>8,i[3]=f&255,f=f>>8,i[2]=f&255,f=f>>8,i[1]=f&255,r.push(i)}else throw new Error(`${yt} encountered BigInt larger than allowable range`)}}o(Hr,"encodeUintValue");Si.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");Hr.encodedSize=o(function(e){return e<Or[0]?1:e<Or[1]?2:e<Or[2]?3:e<Or[3]?5:9},"encodedSize");Si.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function f4(r,e,t,n){return new qe(_e.negint,-1-Kn(r,e+1,n),2)}o(f4,"decodeNegint8");function c4(r,e,t,n){return new qe(_e.negint,-1-Vn(r,e+1,n),3)}o(c4,"decodeNegint16");function u4(r,e,t,n){return new qe(_e.negint,-1-Gn(r,e+1,n),5)}o(u4,"decodeNegint32");var Ab=BigInt(-1),l4=BigInt(1);function h4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new qe(_e.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${yt} integers outside of the safe integer range are not supported`);return new qe(_e.negint,Ab-BigInt(i),9)}o(h4,"decodeNegint64");function Vd(r,e){let t=e.value,n=typeof t=="bigint"?t*Ab-l4:t*-1-1;Hr(r,e.type.majorEncoded,n)}o(Vd,"encodeNegint");Vd.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*Ab-l4:t*-1-1;return n<Or[0]?1:n<Or[1]?2:n<Or[2]?3:n<Or[3]?5:9},"encodedSize");Vd.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function il(r,e,t,n){ls(r,e,t+n);let i=wc(r,e+t,e+t+n);return new qe(_e.bytes,i,t+n)}o(il,"toToken");function d4(r,e,t,n){return il(r,e,1,t)}o(d4,"decodeBytesCompact");function p4(r,e,t,n){return il(r,e,2,Kn(r,e+1,n))}o(p4,"decodeBytes8");function m4(r,e,t,n){return il(r,e,3,Vn(r,e+1,n))}o(m4,"decodeBytes16");function b4(r,e,t,n){return il(r,e,5,Gn(r,e+1,n))}o(b4,"decodeBytes32");function g4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer bytes lengths not supported`);return il(r,e,9,i)}o(g4,"decodeBytes64");function Gd(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===_e.string?e4(r.value):r.value),r.encodedBytes}o(Gd,"tokenBytes");function Ec(r,e){let t=Gd(e);Hr(r,e.type.majorEncoded,t.length),r.push(t)}o(Ec,"encodeBytes");Ec.encodedSize=o(function(e){let t=Gd(e);return Hr.encodedSize(t.length)+t.length},"encodedSize");Ec.compareTokens=o(function(e,t){return NB(Gd(e),Gd(t))},"compareTokens");function NB(r,e){return r.length<e.length?-1:r.length>e.length?1:n4(r,e)}o(NB,"compareBytes");function ol(r,e,t,n,i){let s=t+n;ls(r,e,s);let f=new qe(_e.string,Qw(r,e+t,e+s),s);return i.retainStringBytes===!0&&(f.byteValue=wc(r,e+t,e+s)),f}o(ol,"toToken");function v4(r,e,t,n){return ol(r,e,1,t,n)}o(v4,"decodeStringCompact");function y4(r,e,t,n){return ol(r,e,2,Kn(r,e+1,n),n)}o(y4,"decodeString8");function x4(r,e,t,n){return ol(r,e,3,Vn(r,e+1,n),n)}o(x4,"decodeString16");function w4(r,e,t,n){return ol(r,e,5,Gn(r,e+1,n),n)}o(w4,"decodeString32");function _4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer string lengths not supported`);return ol(r,e,9,i,n)}o(_4,"decodeString64");var E4=Ec;function Ac(r,e,t,n){return new qe(_e.array,n,t)}o(Ac,"toToken");function A4(r,e,t,n){return Ac(r,e,1,t)}o(A4,"decodeArrayCompact");function S4(r,e,t,n){return Ac(r,e,2,Kn(r,e+1,n))}o(S4,"decodeArray8");function M4(r,e,t,n){return Ac(r,e,3,Vn(r,e+1,n))}o(M4,"decodeArray16");function T4(r,e,t,n){return Ac(r,e,5,Gn(r,e+1,n))}o(T4,"decodeArray32");function C4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer array lengths not supported`);return Ac(r,e,9,i)}o(C4,"decodeArray64");function k4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Ac(r,e,1,1/0)}o(k4,"decodeArrayIndefinite");function Wd(r,e){Hr(r,_e.array.majorEncoded,e.value)}o(Wd,"encodeArray");Wd.compareTokens=Si.compareTokens;Wd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function Sc(r,e,t,n){return new qe(_e.map,n,t)}o(Sc,"toToken");function I4(r,e,t,n){return Sc(r,e,1,t)}o(I4,"decodeMapCompact");function D4(r,e,t,n){return Sc(r,e,2,Kn(r,e+1,n))}o(D4,"decodeMap8");function R4(r,e,t,n){return Sc(r,e,3,Vn(r,e+1,n))}o(R4,"decodeMap16");function O4(r,e,t,n){return Sc(r,e,5,Gn(r,e+1,n))}o(O4,"decodeMap32");function N4(r,e,t,n){let i=Wn(r,e+1,n);if(typeof i=="bigint")throw new Error(`${yt} 64-bit integer map lengths not supported`);return Sc(r,e,9,i)}o(N4,"decodeMap64");function P4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return Sc(r,e,1,1/0)}o(P4,"decodeMapIndefinite");function Jd(r,e){Hr(r,_e.map.majorEncoded,e.value)}o(Jd,"encodeMap");Jd.compareTokens=Si.compareTokens;Jd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");function B4(r,e,t,n){return new qe(_e.tag,t,1)}o(B4,"decodeTagCompact");function L4(r,e,t,n){return new qe(_e.tag,Kn(r,e+1,n),2)}o(L4,"decodeTag8");function U4(r,e,t,n){return new qe(_e.tag,Vn(r,e+1,n),3)}o(U4,"decodeTag16");function F4(r,e,t,n){return new qe(_e.tag,Gn(r,e+1,n),5)}o(F4,"decodeTag32");function $4(r,e,t,n){return new qe(_e.tag,Wn(r,e+1,n),9)}o($4,"decodeTag64");function Yd(r,e){Hr(r,_e.tag.majorEncoded,e.value)}o(Yd,"encodeTag");Yd.compareTokens=Si.compareTokens;Yd.encodedSize=o(function(e){return Hr.encodedSize(e.value)},"encodedSize");var $B=20,qB=21,jB=22,HB=23;function q4(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${yt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new qe(_e.null,null,1):new qe(_e.undefined,void 0,1)}o(q4,"decodeUndefined");function j4(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${yt} indefinite length items not allowed`);return new qe(_e.break,void 0,1)}o(j4,"decodeBreak");function Sb(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${yt} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${yt} Infinity values are not supported`)}return new qe(_e.float,r,e)}o(Sb,"createToken");function H4(r,e,t,n){return Sb(Mb(r,e+1),3,n)}o(H4,"decodeFloat16");function z4(r,e,t,n){return Sb(Tb(r,e+1),5,n)}o(z4,"decodeFloat32");function K4(r,e,t,n){return Sb(J4(r,e+1),9,n)}o(K4,"decodeFloat64");function Zd(r,e,t){let n=e.value;if(n===!1)r.push([_e.float.majorEncoded|$B]);else if(n===!0)r.push([_e.float.majorEncoded|qB]);else if(n===null)r.push([_e.float.majorEncoded|jB]);else if(n===void 0)r.push([_e.float.majorEncoded|HB]);else{let i,s=!1;(!t||t.float64!==!0)&&(G4(n),i=Mb(Wi,1),n===i||Number.isNaN(n)?(Wi[0]=249,r.push(Wi.slice(0,3)),s=!0):(W4(n),i=Tb(Wi,1),n===i&&(Wi[0]=250,r.push(Wi.slice(0,5)),s=!0))),s||(zB(n),i=J4(Wi,1),Wi[0]=251,r.push(Wi.slice(0,9)))}}o(Zd,"encodeFloat");Zd.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){G4(n);let i=Mb(Wi,1);if(n===i||Number.isNaN(n))return 3;if(W4(n),i=Tb(Wi,1),n===i)return 5}return 9},"encodedSize");var V4=new ArrayBuffer(9),Mi=new DataView(V4,1),Wi=new Uint8Array(V4,0);function G4(r){if(r===1/0)Mi.setUint16(0,31744,!1);else if(r===-1/0)Mi.setUint16(0,64512,!1);else if(Number.isNaN(r))Mi.setUint16(0,32256,!1);else{Mi.setFloat32(0,r);let e=Mi.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)Mi.setUint16(0,31744,!1);else if(t===0)Mi.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?Mi.setUint16(0,0):i<-14?Mi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):Mi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(G4,"encodeFloat16");function Mb(r,e){if(r.length-e<2)throw new Error(`${yt} 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*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(Mb,"readFloat16");function W4(r){Mi.setFloat32(0,r,!1)}o(W4,"encodeFloat32");function Tb(r,e){if(r.length-e<4)throw new Error(`${yt} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(Tb,"readFloat32");function zB(r){Mi.setFloat64(0,r,!1)}o(zB,"encodeFloat64");function J4(r,e){if(r.length-e<8)throw new Error(`${yt} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(J4,"readFloat64");Zd.compareTokens=Si.compareTokens;function qt(r,e,t){throw new Error(`${yt} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(qt,"invalidMinor");function Xd(r){return()=>{throw new Error(`${yt} ${r}`)}}o(Xd,"errorer");var Be=[];for(let r=0;r<=23;r++)Be[r]=qt;Be[24]=i4;Be[25]=o4;Be[26]=s4;Be[27]=a4;Be[28]=qt;Be[29]=qt;Be[30]=qt;Be[31]=qt;for(let r=32;r<=55;r++)Be[r]=qt;Be[56]=f4;Be[57]=c4;Be[58]=u4;Be[59]=h4;Be[60]=qt;Be[61]=qt;Be[62]=qt;Be[63]=qt;for(let r=64;r<=87;r++)Be[r]=d4;Be[88]=p4;Be[89]=m4;Be[90]=b4;Be[91]=g4;Be[92]=qt;Be[93]=qt;Be[94]=qt;Be[95]=Xd("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)Be[r]=v4;Be[120]=y4;Be[121]=x4;Be[122]=w4;Be[123]=_4;Be[124]=qt;Be[125]=qt;Be[126]=qt;Be[127]=Xd("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)Be[r]=A4;Be[152]=S4;Be[153]=M4;Be[154]=T4;Be[155]=C4;Be[156]=qt;Be[157]=qt;Be[158]=qt;Be[159]=k4;for(let r=160;r<=183;r++)Be[r]=I4;Be[184]=D4;Be[185]=R4;Be[186]=O4;Be[187]=N4;Be[188]=qt;Be[189]=qt;Be[190]=qt;Be[191]=P4;for(let r=192;r<=215;r++)Be[r]=B4;Be[216]=L4;Be[217]=U4;Be[218]=F4;Be[219]=$4;Be[220]=qt;Be[221]=qt;Be[222]=qt;Be[223]=qt;for(let r=224;r<=243;r++)Be[r]=Xd("simple values are not supported");Be[244]=qt;Be[245]=qt;Be[246]=qt;Be[247]=q4;Be[248]=Xd("simple values are not supported");Be[249]=H4;Be[250]=z4;Be[251]=K4;Be[252]=qt;Be[253]=qt;Be[254]=qt;Be[255]=j4;var Ji=[];for(let r=0;r<24;r++)Ji[r]=new qe(_e.uint,r,1);for(let r=-1;r>=-24;r--)Ji[31-r]=new qe(_e.negint,r,1);Ji[64]=new qe(_e.bytes,new Uint8Array(0),1);Ji[96]=new qe(_e.string,"",1);Ji[128]=new qe(_e.array,0,1);Ji[160]=new qe(_e.map,0,1);Ji[244]=new qe(_e.false,!1,1);Ji[245]=new qe(_e.true,!0,1);Ji[246]=new qe(_e.null,null,1);function Y4(r){switch(r.type){case _e.false:return Ao([244]);case _e.true:return Ao([245]);case _e.null:return Ao([246]);case _e.bytes:return r.value.length?void 0:Ao([64]);case _e.string:return r.value===""?Ao([96]):void 0;case _e.array:return r.value===0?Ao([128]):void 0;case _e.map:return r.value===0?Ao([160]):void 0;case _e.uint:return r.value<24?Ao([Number(r.value)]):void 0;case _e.negint:if(r.value>=-24)return Ao([31-Number(r.value)])}}o(Y4,"quickEncodeToken");var VB={float64:!1,mapSorter:JB,quickEncodeToken:Y4};function GB(){let r=[];return r[_e.uint.major]=Si,r[_e.negint.major]=Vd,r[_e.bytes.major]=Ec,r[_e.string.major]=E4,r[_e.array.major]=Wd,r[_e.map.major]=Jd,r[_e.tag.major]=Yd,r[_e.float.major]=Zd,r}o(GB,"makeCborEncoders");var Z4=GB(),Cb=new _c,tf=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(`${Eb} object contains circular references`);return new tf(t,e)}};o(tf,"Ref");var Zs={null:new qe(_e.null,null),undefined:new qe(_e.undefined,void 0),true:new qe(_e.true,!0),false:new qe(_e.false,!1),emptyArray:new qe(_e.array,0),emptyMap:new qe(_e.map,0)},Xs={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new qe(_e.float,r):r>=0?new qe(_e.uint,r):new qe(_e.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new qe(_e.uint,r):new qe(_e.negint,r)},Uint8Array(r,e,t,n){return new qe(_e.bytes,r)},string(r,e,t,n){return new qe(_e.string,r)},boolean(r,e,t,n){return r?Zs.true:Zs.false},null(r,e,t,n){return Zs.null},undefined(r,e,t,n){return Zs.undefined},ArrayBuffer(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new qe(_e.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[Zs.emptyArray,new qe(_e.break)]:Zs.emptyArray;n=tf.createCheck(n,r);let i=[],s=0;for(let f of r)i[s++]=Qd(f,t,n);return t.addBreakTokens?[new qe(_e.array,r.length),i,new qe(_e.break)]:[new qe(_e.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),f=i?r.size:s.length;if(!f)return t.addBreakTokens===!0?[Zs.emptyMap,new qe(_e.break)]:Zs.emptyMap;n=tf.createCheck(n,r);let u=[],d=0;for(let y of s)u[d++]=[Qd(y,t,n),Qd(i?r.get(y):r[y],t,n)];return WB(u,t),t.addBreakTokens?[new qe(_e.map,f),u,new qe(_e.break)]:[new qe(_e.map,f),u]}};Xs.Map=Xs.Object;Xs.Buffer=Xs.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Xs[`${r}Array`]=Xs.DataView;function Qd(r,e={},t){let n=Jw(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||Xs[n];if(typeof i=="function"){let f=i(r,n,e,t);if(f!=null)return f}let s=Xs[n];if(!s)throw new Error(`${Eb} unsupported type: ${n}`);return s(r,n,e,t)}o(Qd,"objectToTokens");function WB(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(WB,"sortMapEntries");function JB(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=Z4[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(JB,"mapSorter");function X4(r,e,t,n){if(Array.isArray(e))for(let i of e)X4(r,i,t,n);else t[e.type.major](r,e,n)}o(X4,"tokensToEncoded");function YB(r,e,t){let n=Qd(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 f=s.encodedSize(n,t),u=new _c(f);if(s(u,n,t),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return _b(u.chunks[0])}}return Cb.reset(),X4(Cb,n,e,t),Cb.toBytes(!0)}o(YB,"encodeCustom");function kb(r,e){return e=Object.assign({},VB,e),YB(r,Z4,e)}o(kb,"encode");var ZB={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},e0=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=Ji[e];if(t===void 0){let n=Be[e];if(!n)throw new Error(`${yt} 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(e0,"Tokeniser");var sl=Symbol.for("DONE"),t0=Symbol.for("BREAK");function XB(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=al(e,t);if(s===t0){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed array`)}if(s===sl)throw new Error(`${yt} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(XB,"tokenToArray");function QB(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let f=0;f<r.value;f++){let u=al(e,t);if(u===t0){if(r.value===1/0)break;throw new Error(`${yt} got unexpected break to lengthed map`)}if(u===sl)throw new Error(`${yt} found map but not enough entries (got ${f} [no key], expected ${r.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${yt} non-string keys not supported (got ${typeof u})`);if(t.rejectDuplicateMapKeys===!0&&(n&&s.has(u)||!n&&u in i))throw new Error(`${yt} found repeat map key "${u}"`);let d=al(e,t);if(d===sl)throw new Error(`${yt} found map but not enough entries (got ${f} [no value], expected ${r.value})`);n?s.set(u,d):i[u]=d}return n?s:i}o(QB,"tokenToMap");function al(r,e){if(r.done())return sl;let t=r.next();if(t.type===_e.break)return t0;if(t.type.terminal)return t.value;if(t.type===_e.array)return XB(t,r,e);if(t.type===_e.map)return QB(t,r,e);if(t.type===_e.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=al(r,e);return e.tags[t.value](n)}throw new Error(`${yt} tag not supported (${t.value})`)}throw new Error("unsupported")}o(al,"tokensToObject");function Ib(r,e){if(!(r instanceof Uint8Array))throw new Error(`${yt} data to decode must be a Uint8Array`);e=Object.assign({},ZB,e);let t=e.tokenizer||new e0(r,e),n=al(t,e);if(n===sl)throw new Error(`${yt} did not find any content to decode`);if(n===t0)throw new Error(`${yt} got unexpected break`);if(!t.done())throw new Error(`${yt} too many terminals, data makes no sense`);return n}o(Ib,"decode");ji();var Q4=42;function tL(r){if(r.asCID!==r)return null;let e=Ye.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new qe(_e.tag,Q4),new qe(_e.bytes,t)]}o(tL,"cidEncoder");function rL(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(rL,"undefinedEncoder");function nL(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(nL,"numberEncoder");var iL={float64:!0,typeEncoders:{Object:tL,undefined:rL,number:nL}};function oL(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ye.decode(r.subarray(1))}o(oL,"cidDecoder");var e5={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};e5.tags[Q4]=oL;var sL="dag-cbor",Mc=113,rf=o(r=>kb(r,iL),"encode"),Db=o(r=>Ib(r,e5),"decode");var aL=24;async function t5(r){let e=await Qa({value:r,codec:Yi,hasher:Fs});return{cid:e.cid,linkedBlock:e.bytes}}o(t5,"encodePayload");function fL(r,e=aL){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(fL,"pad");async function cL(r){return(await Qa({value:r,codec:Yi,hasher:od})).cid}o(cL,"encodeIdentityCID");function uL(r){if(r=Ye.asCID(r),r.code!==Mc)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==od.code)throw new Error("CID must use identity multihash");return Db(r.multihash.digest)}o(uL,"decodeIdentityCID");async function r5(r,e){return fL((await cL(r)).bytes,e)}o(r5,"prepareCleartext");function n5(r){return uL(Ye.decodeFirst(r)[0])}o(n5,"decodeCleartext");var i5=Symbol("abortable"),r0=Symbol("aborted");function o5(r,e){if(e.aborted)return Promise.reject(r0);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(r0)}),Promise.race([r,n])}o(o5,"abortable");var s5=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 n0="utils_abort_request";var hn;(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"})(hn||(hn={}));var a5={[hn.PARSE_ERROR]:"Parse error",[hn.INVALID_REQUEST]:"Invalid request",[hn.METHOD_NOT_FOUND]:"Method not found",[hn.INVALID_PARAMS]:"Invalid params",[hn.INTERNAL_ERROR]:"Internal error"};function lL(r){return-32e3>=r&&r>=-32099}o(lL,"isServerError");function i0(r){return a5[r.toString()]??(lL(r)?"Server error":"Application error")}o(i0,"getErrorMessage");var Tn=class extends Error{static fromObject(e){return new Tn(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,Tn.prototype),this.code=e,this.data=n,this.message=t??i0(e)}};o(Tn,"RPCError");function fl(r){let e=a5[r];return o(function(n){return new Tn(r,e,n)},"createError")}o(fl,"createErrorFactory");var hL=fl(hn.PARSE_ERROR),QW=fl(hn.INVALID_REQUEST),eJ=fl(hn.METHOD_NOT_FOUND),tJ=fl(hn.INVALID_PARAMS),rJ=fl(hn.INTERNAL_ERROR);function dL(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(dL,"_checkPrivateRedeclaration");function pL(r,e){return e.get?e.get.call(r):e.value}o(pL,"_classApplyDescriptorGet");function mL(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(mL,"_classApplyDescriptorSet");function f5(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(f5,"_classExtractFieldDescriptor");function Rb(r,e){var t=f5(r,e,"get");return pL(r,t)}o(Rb,"_classPrivateFieldGet");function bL(r,e,t){dL(r,e),e.set(r,t)}o(bL,"_classPrivateFieldInit");function gL(r,e,t){var n=f5(r,e,"set");return mL(r,n,t),t}o(gL,"_classPrivateFieldSet");var cl=new WeakMap,Tc=class{get connection(){return Rb(this,cl)}createID(){return s5()}request(e,t=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(r0);let s=this.createID(),f=Rb(this,cl).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw Tn.fromObject(u.error);return u.result});return i==null?f:(i.addEventListener("abort",()=>{this.notify(n0,{id:s})}),o5(f,i))}async notify(e,t=void 0){await Rb(this,cl).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){bL(this,cl,{writable:!0,value:void 0}),gL(this,cl,e)}};o(Tc,"RPCClient");function c5(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:i0(e)}}}o(c5,"createErrorResponse");function vL(r,e,t){console.warn("Unhandled handler error",e,t)}o(vL,"fallbackOnHandlerError");function yL(r,e){console.warn("Unhandled invalid message",e)}o(yL,"fallbackOnInvalidMessage");function xL(r,e){console.warn("Unhandled notification",e)}o(xL,"fallbackOnNotification");function u5(r,e={}){let t=e.onHandlerError??vL,n=e.onInvalidMessage??yL,i=e.onNotification??xL,s={};function f(u,d){if(d.method===n0){let y=d.params?.id;y!=null&&s[y]?.abort()}else i(u,d)}return o(f,"handleNotification"),o(async function(d,y){let w=y.id;if(y.jsonrpc!=="2.0"||y.method==null)return w==null?(n(d,y),null):c5(w,hn.INVALID_REQUEST);let A=r[y.method];if(A==null)return w==null?(f(d,y),null):c5(w,hn.METHOD_NOT_FOUND);try{let O;if(w!=null&&A[i5]){let I=new AbortController;s[w]=I,O=A(d,y.params,{signal:I.signal})}else O=A(d,y.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return w==null||s[w]?.signal.aborted?null:{jsonrpc:"2.0",id:w,result:R}}catch(O){if(w==null||s[w]?.signal.aborted)return t(d,y,O),null;let R;if(O instanceof Tn)R=O.toObject();else{t(d,y,O);let I=O.code??-32e3;R={code:I,message:O.message||i0(I)}}return{jsonrpc:"2.0",id:w,error:R}}finally{w!=null&&delete s[w]}},"handleRequest")}o(u5,"createHandler");ji();var b8=Ft(m8(),1),tn=Ft(ff(),1);var bU=`
657
657
  sign-in-with-ethereum =
658
658
  domain %s" wants you to sign in with your Ethereum account:" LF
659
659
  address LF
@@ -815,11 +815,11 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
815
815
 
816
816
  `)),[i,y].join(`
817
817
 
818
- `)}o(_U,"asString");var Bc=class extends gl{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case vl.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Bc,"SiweMessage");Uu();var EU=5*60,JJ=new Date("2022-09-20").valueOf(),yl;(function(r){function e(u){let d={h:{t:"eip4361"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:eip155:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"eip191",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:solana:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"solana:ed25519",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(t,"fromSiwsMessage"),r.fromSiwsMessage=t;function n(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:tezos:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"tezos:ed25519",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(n,"fromSiwTezosMessage"),r.fromSiwTezosMessage=n;function i(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:stacks:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"stacks:secp256k1",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(i,"fromSiwStacksMessage"),r.fromSiwStacksMessage=i;async function s(u){return(await Ww({bytes:u,codec:Yi,hasher:Fs})).value}o(s,"fromBlockBytes"),r.fromBlockBytes=s;async function f(u,d={}){tg(u);let y=d.verifiers[u.s.t];if(!y)throw new Error("Unsupported CACAO signature type, register the needed verifier");return y(u,d)}o(f,"verify"),r.verify=f})(yl||(yl={}));var xl;(function(r){function e(t){return Qa({value:t,codec:Yi,hasher:Fs})}o(e,"fromCacao"),r.fromCacao=e})(xl||(xl={}));function tg(r){if(r.s===null||r.s===void 0)throw new Error("CACAO does not have a signature")}o(tg,"assertSigned");function x8(r,e){let t=e.atTime?e.atTime.getTime():Date.now(),n=(e.clockSkewSecs??EU)*1e3;if(Date.parse(r.p.iat)>t+n||Date.parse(r.p.nbf)>t+n)throw new Error("CACAO is not valid yet");let i=e.revocationPhaseOutSecs?e.revocationPhaseOutSecs*1e3:0;if(!e.disableExpirationCheck&&Date.parse(r.p.exp)+i+n<t)throw new Error("CACAO has expired")}o(x8,"verifyTimeChecks");var w8="logger/5.8.0";var _8=!1,E8=!1,p0={debug:1,default:2,info:2,warning:3,error:4,off:5},A8=p0.default,rg=null;function AU(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{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(AU,"_checkNormalize");var S8=AU(),ng;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(ng||(ng={}));var Xi;(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",r.ACTION_REJECTED="ACTION_REJECTED"})(Xi||(Xi={}));var M8="0123456789abcdef",Tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();p0[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(A8>p0[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(E8)return this.makeError("censored error",t,{});t||(t=Tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(d=>{let y=n[d];try{if(y instanceof Uint8Array){let w="";for(let A=0;A<y.length;A++)w+=M8[y[A]>>4],w+=M8[y[A]&15];i.push(d+"=Uint8Array(0x"+w+")")}else i.push(d+"="+JSON.stringify(y))}catch{i.push(d+"="+JSON.stringify(n[d].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,f="";switch(t){case Xi.NUMERIC_FAULT:{f="NUMERIC_FAULT";let d=e;switch(d){case"overflow":case"underflow":case"division-by-zero":f+="-"+d;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result";break}break}case Xi.CALL_EXCEPTION:case Xi.INSUFFICIENT_FUNDS:case Xi.MISSING_NEW:case Xi.NONCE_EXPIRED:case Xi.REPLACEMENT_UNDERPRICED:case Xi.TRANSACTION_REPLACED:case Xi.UNPREDICTABLE_GAS_LIMIT:f=t;break}f&&(e+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let u=new Error(e);return u.reason=s,u.code=t,Object.keys(n).forEach(function(d){u[d]=n[d]}),u}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"),S8&&this.throwError("platform missing String.prototype.normalize",Tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:S8})}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 rg||(rg=new Tt(w8)),rg}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_8){if(!e)return;this.globalLogger().throwError("error censorship permanent",Tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}E8=!!e,_8=!!t}static setLogLevel(e){let t=p0[e.toLowerCase()];if(t==null){Tt.globalLogger().warn("invalid log level - "+e);return}A8=t}static from(e){return new Tt(e)}};o(Tt,"Logger");Tt.errors=Xi;Tt.levels=ng;var T8="bytes/5.8.0";var xr=new Tt(T8);function k8(r){return!!r.toHexString}o(k8,"isHexable");function Lc(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Lc(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Lc,"addSlice");function I8(r){return Qi(r)&&!(r.length%2)||og(r)}o(I8,"isBytesLike");function C8(r){return typeof r=="number"&&r==r&&r%1===0}o(C8,"isInteger");function og(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!C8(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!C8(t)||t<0||t>=256)return!1}return!0}o(og,"isBytes");function fr(r,e){if(e||(e={}),typeof r=="number"){xr.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),Lc(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),k8(r)&&(r=r.toHexString()),Qi(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":xr.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 Lc(new Uint8Array(n))}return og(r)?Lc(new Uint8Array(r)):xr.throwArgumentError("invalid arrayify value","value",r)}o(fr,"arrayify");function sg(r){let e=r.map(i=>fr(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),Lc(n)}o(sg,"concat");function SU(r,e){r=fr(r),r.length>e&&xr.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Lc(t)}o(SU,"zeroPad");function Qi(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Qi,"isHexString");var ig="0123456789abcdef";function rn(r,e){if(e||(e={}),typeof r=="number"){xr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=ig[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),k8(r))return r.toHexString();if(Qi(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":xr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(og(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=ig[(i&240)>>4]+ig[i&15]}return t}return xr.throwArgumentError("invalid hexlify value","value",r)}o(rn,"hexlify");function m0(r){if(typeof r!="string")r=rn(r);else if(!Qi(r)||r.length%2)return null;return(r.length-2)/2}o(m0,"hexDataLength");function b0(r,e,t){return typeof r!="string"?r=rn(r):(!Qi(r)||r.length%2)&&xr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(b0,"hexDataSlice");function ia(r,e){for(typeof r!="string"?r=rn(r):Qi(r)||xr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&xr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(ia,"hexZeroPad");function g0(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(I8(r)){let t=fr(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=rn(t.slice(0,32)),e.s=rn(t.slice(32,64))):t.length===65?(e.r=rn(t.slice(0,32)),e.s=rn(t.slice(32,64)),e.v=t[64]):xr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:xr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=rn(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=SU(fr(e._vs),32);e._vs=rn(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&xr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let f=rn(i);e.s==null?e.s=f:e.s!==f&&xr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?xr.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&&xr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Qi(e.r)?xr.throwArgumentError("signature missing or invalid r","signature",r):e.r=ia(e.r,32),e.s==null||!Qi(e.s)?xr.throwArgumentError("signature missing or invalid s","signature",r):e.s=ia(e.s,32);let t=fr(e.s);t[0]>=128&&xr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=rn(t);e._vs&&(Qi(e._vs)||xr.throwArgumentError("signature invalid _vs","signature",r),e._vs=ia(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&xr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(g0,"splitSignature");var O8=Ft(fg());var R8="bignumber/5.8.0";var MU=O8.default.BN,aY=new Tt(R8);function cg(r){return new MU(r,36).toString(16)}o(cg,"_base36To16");var N8=Ft(x1());function Uc(r){return"0x"+N8.default.keccak_256(fr(r))}o(Uc,"keccak256");var P8="address/5.8.0";var wl=new Tt(P8);function B8(r){Qi(r,20)||wl.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=fr(Uc(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(B8,"getChecksumAddress");var kU=9007199254740991;function IU(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(IU,"log10");var ug={};for(let r=0;r<10;r++)ug[String(r)]=String(r);for(let r=0;r<26;r++)ug[String.fromCharCode(65+r)]=String(10+r);var L8=Math.floor(IU(kU));function DU(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>ug[n]).join("");for(;e.length>=L8;){let n=e.substring(0,L8);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(DU,"ibanChecksum");function U8(r){let e=null;if(typeof r!="string"&&wl.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=B8(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&wl.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)!==DU(r)&&wl.throwArgumentError("bad icap checksum","address",r),e=cg(r.substring(4));e.length<40;)e="0"+e;e=B8("0x"+e)}else wl.throwArgumentError("invalid address","address",r);return e}o(U8,"getAddress");var F8="properties/5.8.0";var AY=new Tt(F8);function Fc(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Fc,"defineReadOnly");var $8="strings/5.8.0";var q8=new Tt($8),_l;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(_l||(_l={}));var cf;(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"})(cf||(cf={}));function RU(r,e,t,n,i){return q8.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(RU,"errorFunc");function j8(r,e,t,n,i){if(r===cf.BAD_PREFIX||r===cf.UNEXPECTED_CONTINUE){let s=0;for(let f=e+1;f<t.length&&t[f]>>6===2;f++)s++;return s}return r===cf.OVERRUN?t.length-e-1:0}o(j8,"ignoreFunc");function OU(r,e,t,n,i){return r===cf.OVERLONG?(n.push(i),0):(n.push(65533),j8(r,e,t,n,i))}o(OU,"replaceFunc");var NU=Object.freeze({error:RU,ignore:j8,replace:OU});function El(r,e=_l.current){e!=_l.current&&(q8.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 f=65536+((i&1023)<<10)+(s&1023);t.push(f>>18|240),t.push(f>>12&63|128),t.push(f>>6&63|128),t.push(f&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return fr(t)}o(El,"toUtf8Bytes");var H8=`Ethereum Signed Message:
819
- `;function lg(r){return typeof r=="string"&&(r=El(r)),Uc(sg([El(H8),El(String(r.length)),r]))}o(lg,"hashMessage");var vt=Ft(fg()),ko=Ft(Vu());function $c(r,e,t){return t={path:e,exports:{},require:function(n,i){return PU(n,i??t.path)}},r(t,t.exports),t.exports}o($c,"createCommonjsModule");function PU(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(PU,"commonjsRequire");var mg=K8;function K8(r,e){if(!r)throw new Error(e||"Assertion failed")}o(K8,"assert");K8.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var eo=$c(function(r,e){"use strict";var t=e;function n(f,u){if(Array.isArray(f))return f.slice();if(!f)return[];var d=[];if(typeof f!="string"){for(var y=0;y<f.length;y++)d[y]=f[y]|0;return d}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var y=0;y<f.length;y+=2)d.push(parseInt(f[y]+f[y+1],16))}else for(var y=0;y<f.length;y++){var w=f.charCodeAt(y),A=w>>8,O=w&255;A?d.push(A,O):d.push(O)}return d}o(n,"toArray"),t.toArray=n;function i(f){return f.length===1?"0"+f:f}o(i,"zero2"),t.zero2=i;function s(f){for(var u="",d=0;d<f.length;d++)u+=i(f[d].toString(16));return u}o(s,"toHex"),t.toHex=s,t.encode=o(function(u,d){return d==="hex"?s(u):u},"encode")}),Yn=$c(function(r,e){"use strict";var t=e;t.assert=mg,t.toArray=eo.toArray,t.zero2=eo.zero2,t.toHex=eo.toHex,t.encode=eo.encode;function n(d,y,w){var A=new Array(Math.max(d.bitLength(),w)+1),O;for(O=0;O<A.length;O+=1)A[O]=0;var R=1<<y+1,I=d.clone();for(O=0;O<A.length;O++){var B,Y=I.andln(R-1);I.isOdd()?(Y>(R>>1)-1?B=(R>>1)-Y:B=Y,I.isubn(B)):B=0,A[O]=B,I.iushrn(1)}return A}o(n,"getNAF"),t.getNAF=n;function i(d,y){var w=[[],[]];d=d.clone(),y=y.clone();for(var A=0,O=0,R;d.cmpn(-A)>0||y.cmpn(-O)>0;){var I=d.andln(3)+A&3,B=y.andln(3)+O&3;I===3&&(I=-1),B===3&&(B=-1);var Y;(I&1)===0?Y=0:(R=d.andln(7)+A&7,(R===3||R===5)&&B===2?Y=-I:Y=I),w[0].push(Y);var P;(B&1)===0?P=0:(R=y.andln(7)+O&7,(R===3||R===5)&&I===2?P=-B:P=B),w[1].push(P),2*A===Y+1&&(A=1-A),2*O===P+1&&(O=1-O),d.iushrn(1),y.iushrn(1)}return w}o(i,"getJSF"),t.getJSF=i;function s(d,y,w){var A="_"+y;d.prototype[y]=o(function(){return this[A]!==void 0?this[A]:this[A]=w.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function f(d){return typeof d=="string"?t.toArray(d,"hex"):d}o(f,"parseBytes"),t.parseBytes=f;function u(d){return new vt.default(d,"hex","le")}o(u,"intFromLE"),t.intFromLE=u}),x0=Yn.getNAF,BU=Yn.getJSF,w0=Yn.assert;function sa(r,e){this.type=r,this.p=new vt.default(e.p,16),this.red=e.prime?vt.default.red(e.prime):vt.default.mont(this.p),this.zero=new vt.default(0).toRed(this.red),this.one=new vt.default(1).toRed(this.red),this.two=new vt.default(2).toRed(this.red),this.n=e.n&&new vt.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(sa,"BaseCurve");var lf=sa;sa.prototype.point=o(function(){throw new Error("Not implemented")},"point");sa.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");sa.prototype._fixedNafMul=o(function(e,t){w0(e.precomputed);var n=e._getDoubles(),i=x0(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var y=u+n.step-1;y>=u;y--)d=(d<<1)+i[y];f.push(d)}for(var w=this.jpoint(null,null,null),A=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?A=A.mixedAdd(n.points[u]):d===-O&&(A=A.mixedAdd(n.points[u].neg()));w=w.add(A)}return w.toP()},"_fixedNafMul");sa.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=x0(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var y=0;d>=0&&f[d]===0;d--)y++;if(d>=0&&y++,u=u.dblp(y),d<0)break;var w=f[d];w0(w!==0),e.type==="affine"?w>0?u=u.mixedAdd(s[w-1>>1]):u=u.mixedAdd(s[-w-1>>1].neg()):w>0?u=u.add(s[w-1>>1]):u=u.add(s[-w-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");sa.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,y=0,w,A,O;for(w=0;w<i;w++){O=t[w];var R=O._getNAFPoints(e);f[w]=R.wnd,u[w]=R.points}for(w=i-1;w>=1;w-=2){var I=w-1,B=w;if(f[I]!==1||f[B]!==1){d[I]=x0(n[I],f[I],this._bitLength),d[B]=x0(n[B],f[B],this._bitLength),y=Math.max(d[I].length,y),y=Math.max(d[B].length,y);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=BU(n[I],n[B]);for(y=Math.max(J[0].length,y),d[I]=new Array(y),d[B]=new Array(y),A=0;A<y;A++){var ee=J[0][A]|0,Z=J[1][A]|0;d[I][A]=P[(ee+1)*3+(Z+1)],d[B][A]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(w=y;w>=0;w--){for(var j=0;w>=0;){var H=!0;for(A=0;A<i;A++)V[A]=d[A][w]|0,V[A]!==0&&(H=!1);if(!H)break;j++,w--}if(w>=0&&j++,ne=ne.dblp(j),w<0)break;for(A=0;A<i;A++){var he=V[A];he!==0&&(he>0?O=u[A][he-1>>1]:he<0&&(O=u[A][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(w=0;w<i;w++)u[w]=null;return s?ne:ne.toP()},"_wnafMulAdd");function Ii(r,e){this.curve=r,this.type=e,this.precomputed=null}o(Ii,"BasePoint");sa.BasePoint=Ii;Ii.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");Ii.prototype.validate=o(function(){return this.curve.validate(this)},"validate");sa.prototype.decodePoint=o(function(e,t){e=Yn.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?w0(e[e.length-1]%2===0):e[0]===7&&w0(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");Ii.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");Ii.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");Ii.prototype.encode=o(function(e,t){return Yn.encode(this._encode(t),e)},"encode");Ii.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");Ii.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");Ii.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");Ii.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");Ii.prototype._getBeta=o(function(){return null},"_getBeta");Ii.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var bg=$c(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")}),LU=Yn.assert;function Di(r){lf.call(this,"short",r),this.a=new vt.default(r.a,16).toRed(this.red),this.b=new vt.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(Di,"ShortCurve");bg(Di,lf);var UU=Di;Di.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 vt.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 vt.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],LU(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new vt.default(u.a,16),b:new vt.default(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");Di.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:vt.default.mont(e),n=new vt.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new vt.default(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");Di.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 vt.default(1),f=new vt.default(0),u=new vt.default(0),d=new vt.default(1),y,w,A,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Z=d.sub(ee.mul(f));if(!A&&P.cmp(t)<0)y=B.neg(),w=s,A=P.neg(),O=J;else if(A&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=Z}R=P.neg(),I=J;var ne=A.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=y,I=w),A.negative&&(A=A.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:A,b:O},{a:R,b:I}]},"_getEndoBasis");Di.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),y=s.mul(n.b),w=f.mul(i.b),A=e.sub(u).sub(d),O=y.add(w).neg();return{k1:A,k2:O}},"_endoSplit");Di.prototype.pointFromX=o(function(e,t){e=new vt.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");Di.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");Di.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],y=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),y=y.neg(!0)),i[f*2]=d,i[f*2+1]=y,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var w=this._wnafMulAdd(1,i,s,f*2,n),A=0;A<f*2;A++)i[A]=null,s[A]=null;return w},"_endoWnafMulAdd");function Br(r,e,t,n){lf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new vt.default(e,16),this.y=new vt.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(Br,"Point");bg(Br,lf.BasePoint);Di.prototype.point=o(function(e,t,n){return new Br(this,e,t,n)},"point");Di.prototype.pointFromJSON=o(function(e,t){return Br.fromJSON(this,e,t)},"pointFromJSON");Br.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");Br.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");Br.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Br.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");Br.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Br.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");Br.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Br.prototype.getX=o(function(){return this.x.fromRed()},"getX");Br.prototype.getY=o(function(){return this.y.fromRed()},"getY");Br.prototype.mul=o(function(e){return e=new vt.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");Br.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");Br.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");Br.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");Br.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");Br.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 zr(r,e,t,n){lf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt.default(0)):(this.x=new vt.default(e,16),this.y=new vt.default(t,16),this.z=new vt.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(zr,"JPoint");bg(zr,lf.BasePoint);Di.prototype.jpoint=o(function(e,t,n){return new zr(this,e,t,n)},"jpoint");zr.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");zr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");zr.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),y=f.redSub(u);if(d.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=d.redSqr(),A=w.redMul(d),O=i.redMul(w),R=y.redSqr().redIAdd(A).redISub(O).redISub(O),I=y.redMul(O.redISub(R)).redISub(f.redMul(A)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");zr.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=u.redSqr(),w=y.redMul(u),A=n.redMul(y),O=d.redSqr().redIAdd(w).redISub(A).redISub(A),R=d.redMul(A.redISub(O)).redISub(s.redMul(w)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");zr.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,f=this.x,u=this.y,d=this.z,y=d.redSqr().redSqr(),w=u.redAdd(u);for(t=0;t<e;t++){var A=f.redSqr(),O=w.redSqr(),R=O.redSqr(),I=A.redAdd(A).redIAdd(A).redIAdd(i.redMul(y)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=w.redMul(d);t+1<e&&(y=y.redMul(R)),f=Y,d=ee,w=J}return this.curve.jpoint(f,w.redMul(s),d)},"dblp");zr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");zr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),y=d.redSqr().redISub(u).redISub(u),w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),e=y,t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(A).redISub(R);I=I.redIAdd(I);var B=A.redAdd(A).redIAdd(A),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");zr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),y=d.redSqr().redISub(u).redISub(u);e=y;var w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(A).redMul(this.x.redAdd(A));I=I.redAdd(I).redIAdd(I);var B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(A);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");zr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),y=t.redAdd(t);y=y.redIAdd(y);var w=y.redMul(u),A=d.redSqr().redISub(w.redAdd(w)),O=w.redISub(A),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(A,I,B)},"_dbl");zr.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),y=i.redIAdd(i);y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var w=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(y),A=t.redMul(w);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.x.redMul(d).redISub(A);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(w.redMul(y.redISub(w)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");zr.prototype.mul=o(function(e,t){return e=new vt.default(e,t),this.curve._wnafMul(this,e)},"mul");zr.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");zr.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");zr.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");zr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var v0=$c(function(r,e){"use strict";var t=e;t.base=lf,t.short=UU,t.mont=null,t.edwards=null}),y0=$c(function(r,e){"use strict";var t=e,n=Yn.assert;function i(u){u.type==="short"?this.curve=new v0.short(u):u.type==="edwards"?this.curve=new v0.edwards(u):this.curve=new v0.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.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(u,d){Object.defineProperty(t,u,{configurable:!0,enumerable:!0,get:function(){var y=new i(d);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:y}),y}})}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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=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:ko.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function oa(r){if(!(this instanceof oa))return new oa(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=eo.toArray(r.entropy,r.entropyEnc||"hex"),t=eo.toArray(r.nonce,r.nonceEnc||"hex"),n=eo.toArray(r.pers,r.persEnc||"hex");mg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(oa,"HmacDRBG");var V8=oa;oa.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");oa.prototype._hmac=o(function(){return new ko.default.hmac(this.hash,this.K)},"hmac");oa.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");oa.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=eo.toArray(e,t),n=eo.toArray(n,i),mg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");oa.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=eo.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 f=s.slice(0,e);return this._update(n),this._reseed++,eo.encode(f,t)},"generate");var pg=Yn.assert;function nn(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(nn,"KeyPair");var gg=nn;nn.fromPublic=o(function(e,t,n){return t instanceof nn?t:new nn(e,{pub:t,pubEnc:n})},"fromPublic");nn.fromPrivate=o(function(e,t,n){return t instanceof nn?t:new nn(e,{priv:t,privEnc:n})},"fromPrivate");nn.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");nn.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");nn.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");nn.prototype._importPrivate=o(function(e,t){this.priv=new vt.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");nn.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?pg(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&pg(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");nn.prototype.derive=o(function(e){return e.validate()||pg(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");nn.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");nn.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");nn.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var FU=Yn.assert;function _0(r,e){if(r instanceof _0)return r;this._importDER(r,e)||(FU(r.r&&r.s,"Signature without r or s"),this.r=new vt.default(r.r,16),this.s=new vt.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(_0,"Signature");var E0=_0;function $U(){this.place=0}o($U,"Position");function hg(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4||r[e.place]===0)return!1;for(var i=0,s=0,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(hg,"getLength");function z8(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(z8,"rmPadding");_0.prototype._importDER=o(function(e,t){e=Yn.toArray(e,t);var n=new $U;if(e[n.place++]!==48)return!1;var i=hg(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=hg(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=hg(e,n);if(u===!1||e.length!==u+n.place||(e[n.place]&128)!==0)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new vt.default(f),this.s=new vt.default(d),this.recoveryParam=null,!0},"_importDER");function dg(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(dg,"constructLength");_0.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=z8(t),n=z8(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];dg(i,t.length),i=i.concat(t),i.push(2),dg(i,n.length);var s=i.concat(n),f=[48];return dg(f,s.length),f=f.concat(s),Yn.encode(f,e)},"toDER");var qU=o(function(){throw new Error("unsupported")},"rand"),uf=Yn.assert;function ki(r){if(!(this instanceof ki))return new ki(r);typeof r=="string"&&(uf(Object.prototype.hasOwnProperty.call(y0,r),"Unknown curve "+r),r=y0[r]),r instanceof y0.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(ki,"EC");var jU=ki;ki.prototype.keyPair=o(function(e){return new gg(this,e)},"keyPair");ki.prototype.keyFromPrivate=o(function(e,t){return gg.fromPrivate(this,e,t)},"keyFromPrivate");ki.prototype.keyFromPublic=o(function(e,t){return gg.fromPublic(this,e,t)},"keyFromPublic");ki.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new V8({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||qU(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new vt.default(2));;){var s=new vt.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");ki.prototype._truncateToN=o(function(e,t,n){var i;if(vt.default.isBN(e)||typeof e=="number")e=new vt.default(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new vt.default(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new vt.default(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");ki.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!vt.default.isBN(e)){uf(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),uf(e.length>>>0===e.length);for(var s=0;s<e.length;s++)uf((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),uf(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);uf(new vt.default(d).eq(e),"Can not sign message");for(var y=new V8({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),w=this.n.sub(new vt.default(1)),A=0;;A++){var O=i.k?i.k(A):new vt.default(y.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(w)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new E0({r:B,s:Y,recoveryParam:P})}}}}}},"sign");ki.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new E0(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),y=d.mul(e).umod(this.n),w=d.mul(f).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.eqXToP(f)):(A=this.g.mulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.getX().umod(this.n).cmp(f)===0)},"verify");ki.prototype.recoverPubKey=function(r,e,t,n){uf((3&t)===t,"The recovery param is more than two bits"),e=new E0(e,n);var i=this.n,s=new vt.default(r),f=e.r,u=e.s,d=t&1,y=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var w=e.r.invm(i),A=i.sub(s).mul(w).umod(i),O=u.mul(w).umod(i);return this.g.mulAdd(A,f,O)};ki.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new E0(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var HU=$c(function(r,e){"use strict";var t=e;t.version="6.6.1",t.utils=Yn,t.rand=function(){throw new Error("unsupported")},t.curve=v0,t.curves=y0,t.ec=jU,t.eddsa=null}),G8=HU.ec;var W8="signing-key/5.8.0";var yg=new Tt(W8),vg=null;function Io(){return vg||(vg=new G8("secp256k1")),vg}o(Io,"getCurve");var A0=class{constructor(e){Fc(this,"curve","secp256k1"),Fc(this,"privateKey",rn(e)),m0(this.privateKey)!==32&&yg.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Io().keyFromPrivate(fr(this.privateKey));Fc(this,"publicKey","0x"+t.getPublic(!1,"hex")),Fc(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Fc(this,"_isSigningKey",!0)}_addPoint(e){let t=Io().keyFromPublic(fr(this.publicKey)),n=Io().keyFromPublic(fr(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=fr(e);n.length!==32&&yg.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return g0({recoveryParam:i.recoveryParam,r:ia("0x"+i.r.toString(16),32),s:ia("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=Io().keyFromPublic(fr(xg(e)));return ia("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(A0,"SigningKey");function J8(r,e){let t=g0(e),n={r:fr(t.r),s:fr(t.s)};return"0x"+Io().recoverPubKey(fr(r),n,t.recoveryParam).encode("hex",!1)}o(J8,"recoverPublicKey");function xg(r,e){let t=fr(r);if(t.length===32){let n=new A0(t);return e?"0x"+Io().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?rn(t):"0x"+Io().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+Io().keyFromPublic(t).getPublic(!0,"hex"):rn(t)}return yg.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(xg,"computePublicKey");var Y8="transactions/5.8.0";var iZ=new Tt(Y8),Z8;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Z8||(Z8={}));function X8(r){let e=xg(r);return U8(b0(Uc(b0(e,1)),12))}o(X8,"computeAddress");function Q8(r,e){return X8(J8(fr(r),e))}o(Q8,"recoverAddress");var e_="wallet/5.8.0";var dZ=new Tt(e_);function wg(r,e){return Q8(lg(r),e)}o(wg,"verifyMessage");function t_(){return{eip191:async(r,e)=>{KU(r,e)}}}o(t_,"getEIP191Verifier");var zU=new Date("2022-09-20").valueOf();function KU(r,e){tg(r),x8(r,e);let n=[wg(Bc.fromCacao(r).toMessage(),r.s.s).toLowerCase()];if(Date.parse(r.p.iat)<=zU){let s=wg(y8(Bc.fromCacao(r),"Ethereum"),r.s.s).toLowerCase();n.push(s)}let i=na.parse(r.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(KU,"verifyEIP191Signature");ic();cd();var r_=Ft(Ga(),1);ic();function n_(){return Rt((0,r_.randomBytes)(16),"base64")}o(n_,"randomString");var i_="base64pad",o_="base64url";function s_(r){return Rt(r,i_)}o(s_,"encodeBase64");function a_(r){return Rt(r,o_)}o(a_,"encodeBase64Url");function f_(r){return $t(r,i_)}o(f_,"decodeBase64");function S0(r){return JSON.parse(Rt($t(r,o_)))}o(S0,"base64urlToJSON");function c_(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(c_,"fromDagJWS");function u_(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(u_,"didWithTime");function l_(r){return r?Array.isArray(r)?r:[r]:[]}o(l_,"extractControllers");var VU={...t_()};function GU(r){return"registry"in r&&"cache"in r}o(GU,"isResolver");var hf=class{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){return new hf({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Tc(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=GU(e)?e:new Ru(e,t)}async authenticate({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=n_(),s=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:f}=await this.verifyJWS(s),u=S0(s.payload);if(!f.includes(u.did))throw new Error("Invalid authencation response, kid mismatch");if(u.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(u.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(u.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=u.did,this._id}async createJWS(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 i=this._capability.p.exp;if(i&&Date.parse(i)<Date.now())throw new Error("Capability is expired, cannot create a valid signature");let s=await xl.fromCacao(this._capability),f=Ye.asCID(s.cid);if(!f)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://${f?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...t,payload:e});return n}async createDagJWS(e,t={}){let{cid:n,linkedBlock:i}=await t5(e),s=a_(n.bytes);Object.assign(t,{linkedBlock:s_(i)});let f=await this.createJWS(s,t),u=Ye.asCID(n);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 d=await xl.fromCacao(this._capability);return{jws:f,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:f,linkedBlock:i}}async verifyJWS(e,t={}){t=Object.assign({verifiers:VU},t),typeof e!="string"&&(e=c_(e));let n=S0(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!t.disableTimecheck){let y=i.didDocumentMetadata?.nextUpdate;if(y){let A=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,O=new Date(y).valueOf()+A;if(!(t.atTime&&t.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let w=i.didDocumentMetadata?.updated;if(w&&t.atTime&&t.atTime.getTime()<new Date(w).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let f=i.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&f===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await yl.verify(t.capability,{disableExpirationCheck:t.disableTimecheck,atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}})}else if(t.issuer&&t.issuer!==f){let y=u_(t.issuer,t.atTime),A=(await this.resolve(y)).didDocument?.controller,O=l_(A);if(t.capability?.s&&t.capability.p.aud===f&&O.includes(t.capability.p.iss))await yl.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(f?O.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];jw(e,u);let d;try{d=S0(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,t,n={}){let i=await Kw(t,this._resolver);return zw(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,t,n={}){let i=await r5(e);return this.createJWE(i,t,n)}async decryptJWE(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:n}=await this._client.request("did_decryptJWE",{did:this._id,...t,jwe:e});return f_(n)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return n5(t)}async resolve(e){let t=await 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}constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new Tc(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)}};o(hf,"DID");function h_(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(h_,"toUint8Array");var Rg=Ft(Al(),1);Qh();var Ag={};Zt(Ag,{keyToDidDoc:()=>aF});function aF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:Rt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(aF,"keyToDidDoc");var Sg={};Zt(Sg,{keyToDidDoc:()=>cF});ic();var __=Ft(Bd(),1);function fF(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${Rt(e,"base58btc")}`}o(fF,"encodeKey");function cF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=(0,__.convertPublicKeyToX25519)(r),s=`${t}#${fF(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:Rt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:Rt(i,"base58btc")}]}}o(cF,"keyToDidDoc");var kg={};Zt(kg,{keyToDidDoc:()=>xF,pubKeyBytesToXY:()=>M_});var T0={};Zt(T0,{ECPointDecompress:()=>gF});function uF(r){return r>=0?r:-r}o(uF,"n");function lF(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),r<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let t=0n,n=1n,i=1n,s=0n;for(;r!==0n;){let f=e/r,u=e%r,d=t-i*f,y=n-s*f;e=r,r=u,t=i,n=s,i=d,s=y}return{g:e,x:t,y:n}}o(lF,"r");function M0(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let t=r%e;return t<0n?t+e:t}o(M0,"e");function E_(r,e){let t=lF(M0(r,e),e);if(t.g!==1n)throw new RangeError(`${r.toString()} does not have inverse modulo ${e.toString()}`);return M0(t.x,e)}o(E_,"o");function hF(r,e,t){if(r.length!==e.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=t??e.reduce((i,s)=>i*s,1n);return e.reduce((i,s,f)=>{let u=n/s;return M0(i+u*E_(u,s)%n*r[f]%n,n)},0n)}o(hF,"i");function dF(r){return r.map(e=>e[0]**(e[1]-1n)*(e[0]-1n)).reduce((e,t)=>t*e,1n)}o(dF,"a");function aa(r,e,t,n){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");if(t===1n)return 0n;if(r=M0(r,t),e<0n)return E_(aa(r,uF(e),t,n),t);if(n!==void 0)return function(s,f,u,d){let y=d.map(O=>O[0]**O[1]),w=d.map(O=>dF([O])),A=w.map((O,R)=>aa(s,f%O,y[R]));return hF(A,y,u)}(r,e,t,function(s){let f={};return s.forEach(u=>{if(typeof u=="bigint"||typeof u=="number"){let d=String(u);f[d]===void 0?f[d]={p:BigInt(u),k:1n}:f[d].k+=1n}else{let d=String(u[0]);f[d]===void 0?f[d]={p:BigInt(u[0]),k:BigInt(u[1])}:f[d].k+=BigInt(u[1])}}),Object.values(f).map(u=>[u.p,u.k])}(n));let i=1n;for(;e>0;)e%2n===1n&&(i=i*r%t),e/=2n,r=r**2n%t;return i}o(aa,"s");var wr={};Zt(wr,{pubKeyBytesToHex:()=>pF,publicKeyHexToUint8ArrayPointPair:()=>A_,publicKeyIntToUint8ArrayPointPair:()=>S_,publicKeyIntToXY:()=>bF,publicKeyToXY:()=>mF,testHexString:()=>Tg,testUint8Array:()=>fa});ed();function pF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");return Rt(r,"base16")}o(pF,"pubKeyBytesToHex");function mF(r){if(!Tg(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=A_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(mF,"publicKeyToXY");function A_(r){if(!Tg(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=r.slice(0,r.length/2),t=r.slice(r.length/2,r.length),n=$t(e,"base16"),i=$t(t,"base16");return{xOctet:n,yOctet:i}}o(A_,"publicKeyHexToUint8ArrayPointPair");function Tg(r){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(r)!==null&&e.test(r)&&typeof r=="string")}o(Tg,"testHexString");function fa(r){return r==null?!1:r.constructor===Uint8Array}o(fa,"testUint8Array");function bF(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=S_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(bF,"publicKeyIntToXY");function S_(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=r.x.toString(),t=r.y.toString(),n=$t(e,"base10"),i=$t(t,"base10");return{xOctet:n,yOctet:i}}o(S_,"publicKeyIntToUint8ArrayPointPair");function gF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(Rt(f,"base10")),d=u**3n-u*3n+n,y=aa(d,i,t);return y%2n!==s&&(y=t-y),{x:u,y}}o(gF,"ECPointDecompress");var C0={};Zt(C0,{ECPointDecompress:()=>vF});function vF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(Rt(f,"base10")),d=u**3n-u*3n+n,y=aa(d,i,t);return y%2n!==s&&(y=t-y),{x:u,y}}o(vF,"ECPointDecompress");var k0={};Zt(k0,{ECPointDecompress:()=>yF});function yF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");let t=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(Rt(f,"base10")),d=u**3n-u*3n+n,y=aa(d,i,t);return y%2n!==s&&(y=t-y),{x:u,y}}o(yF,"ECPointDecompress");function xF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=M_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(xF,"keyToDidDoc");function M_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==64)return wr.publicKeyToXY(e);if(t==65&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=$t(e,"base16"),i=T0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(M_,"pubKeyBytesToXY");var Ig={};Zt(Ig,{keyToDidDoc:()=>wF,pubKeyBytesToXY:()=>T_});function wF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=T_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(wF,"keyToDidDoc");function T_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==96)return wr.publicKeyToXY(e);if(t==97&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=$t(e,"base16"),i=C0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(T_,"pubKeyBytesToXY");var Dg={};Zt(Dg,{keyToDidDoc:()=>_F,pubKeyBytesToXY:()=>C_});function _F(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=C_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(_F,"keyToDidDoc");function C_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let t=$t(e,"base16"),n=k0.ECPointDecompress(t);return wr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(C_,"pubKeyBytesToXY");var EF="application/did+ld+json",k_="application/did+json",AF={231:Ag,237:Sg,4608:kg,4609:Ig,4610:Dg};function SF(){return{key:async(r,e,t,n)=>{let i=n.accept||k_,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let f=vi.decode(e.id),u=Rg.default.decode(f),d=f.slice(Rg.default.decode.bytes),y=await AF[u].keyToDidDoc(d,e.id);i===EF?(y["@context"]="https://w3id.org/did/v1",s.didDocument=y):i===k_?s.didDocument=y:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(f){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=f.toString()}return s}}}o(SF,"getResolver");var I_={getResolver:SF};var I0=Ft(Bd(),1);var B_=Ft(R_(),1);var MF="base64pad";function O_(r){return JSON.parse((0,B_.default)(r))}o(O_,"toStableObject");function TF(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${Rt(e,"base58btc")}`}o(TF,"encodeDID");function N_(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(N_,"toGeneralJWS");var P_=o(async(r,e,t,n={})=>{let i=`${e}#${e.split(":")[2]}`,s=Lw(t),f=O_(Object.assign(n,{kid:i,alg:"EdDSA"}));return qw(typeof r=="string"?r:O_(r),s,f)},"sign"),CF={did_authenticate:async({did:r,secretKey:e},t)=>{let n=await P_({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return N_(n)},did_createJWS:async({did:r,secretKey:e},t)=>{if(t.did.split("#")[0]!==r)throw new Tn(4100,`Unknown DID: ${r}`);let i=await P_(t.payload,r,e,t.protected);return{jws:N_(i)}},did_decryptJWE:async({secretKey:r},e)=>{let t=Gw((0,I0.convertSecretKeyToX25519)(r));try{let n=await Hw(e.jwe,t);return{cleartext:Rt(n,MF)}}catch(n){throw new Tn(-32e3,n.message)}}},Sl=class{constructor(e){let{secretKey:t,publicKey:n}=(0,I0.generateKeyPairFromSeed)(e),i=TF(n),s=u5(CF);this._handle=async f=>await s({did:i,secretKey:t},f)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(Sl,"Ed25519Provider");var Og={};Zt(Og,{JsonPatchError:()=>br,_areEquals:()=>Cl,applyOperation:()=>df,applyPatch:()=>L0,applyReducer:()=>OF,deepClone:()=>DF,getValueByPointer:()=>P0,validate:()=>U_,validator:()=>B0});var kF=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)}}(),IF=Object.prototype.hasOwnProperty;function R0(r,e){return IF.call(r,e)}o(R0,"hasOwnProperty");function O0(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)R0(r,i)&&n.push(i);return n}o(O0,"_objectKeys");function Kr(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(Kr,"_deepClone");function N0(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(N0,"isInteger");function Do(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(Do,"escapePathComponent");function Ml(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Ml,"unescapePathComponent");function D0(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(D0(r[e]))return!0}else if(typeof r=="object"){for(var n=O0(r),i=n.length,s=0;s<i;s++)if(D0(r[n[s]]))return!0}}return!1}o(D0,"hasUndefined");function L_(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<"u"&&t.push(n+": "+i)}return t.join(`
818
+ `)}o(_U,"asString");var Bc=class extends gl{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case vl.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Bc,"SiweMessage");Uu();var EU=5*60,WJ=new Date("2022-09-20").valueOf(),yl;(function(r){function e(u){let d={h:{t:"eip4361"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:eip155:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"eip191",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:solana:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"solana:ed25519",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(t,"fromSiwsMessage"),r.fromSiwsMessage=t;function n(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:tezos:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"tezos:ed25519",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(n,"fromSiwTezosMessage"),r.fromSiwTezosMessage=n;function i(u){let d={h:{t:"caip122"},p:{domain:u.domain,iat:u.issuedAt,iss:`did:pkh:stacks:${u.chainId}:${u.address}`,aud:u.uri,version:u.version,nonce:u.nonce}};return u.signature&&(d.s={t:"stacks:secp256k1",s:u.signature}),u.notBefore&&(d.p.nbf=u.notBefore),u.expirationTime&&(d.p.exp=u.expirationTime),u.statement&&(d.p.statement=u.statement),u.requestId&&(d.p.requestId=u.requestId),u.resources&&(d.p.resources=u.resources),d}o(i,"fromSiwStacksMessage"),r.fromSiwStacksMessage=i;async function s(u){return(await Ww({bytes:u,codec:Yi,hasher:Fs})).value}o(s,"fromBlockBytes"),r.fromBlockBytes=s;async function f(u,d={}){tg(u);let y=d.verifiers[u.s.t];if(!y)throw new Error("Unsupported CACAO signature type, register the needed verifier");return y(u,d)}o(f,"verify"),r.verify=f})(yl||(yl={}));var xl;(function(r){function e(t){return Qa({value:t,codec:Yi,hasher:Fs})}o(e,"fromCacao"),r.fromCacao=e})(xl||(xl={}));function tg(r){if(r.s===null||r.s===void 0)throw new Error("CACAO does not have a signature")}o(tg,"assertSigned");function x8(r,e){let t=e.atTime?e.atTime.getTime():Date.now(),n=(e.clockSkewSecs??EU)*1e3;if(Date.parse(r.p.iat)>t+n||Date.parse(r.p.nbf)>t+n)throw new Error("CACAO is not valid yet");let i=e.revocationPhaseOutSecs?e.revocationPhaseOutSecs*1e3:0;if(!e.disableExpirationCheck&&Date.parse(r.p.exp)+i+n<t)throw new Error("CACAO has expired")}o(x8,"verifyTimeChecks");var w8="logger/5.8.0";var _8=!1,E8=!1,p0={debug:1,default:2,info:2,warning:3,error:4,off:5},A8=p0.default,rg=null;function AU(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{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(AU,"_checkNormalize");var S8=AU(),ng;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(ng||(ng={}));var Xi;(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",r.ACTION_REJECTED="ACTION_REJECTED"})(Xi||(Xi={}));var M8="0123456789abcdef",Tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();p0[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(A8>p0[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(E8)return this.makeError("censored error",t,{});t||(t=Tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(d=>{let y=n[d];try{if(y instanceof Uint8Array){let w="";for(let A=0;A<y.length;A++)w+=M8[y[A]>>4],w+=M8[y[A]&15];i.push(d+"=Uint8Array(0x"+w+")")}else i.push(d+"="+JSON.stringify(y))}catch{i.push(d+"="+JSON.stringify(n[d].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,f="";switch(t){case Xi.NUMERIC_FAULT:{f="NUMERIC_FAULT";let d=e;switch(d){case"overflow":case"underflow":case"division-by-zero":f+="-"+d;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result";break}break}case Xi.CALL_EXCEPTION:case Xi.INSUFFICIENT_FUNDS:case Xi.MISSING_NEW:case Xi.NONCE_EXPIRED:case Xi.REPLACEMENT_UNDERPRICED:case Xi.TRANSACTION_REPLACED:case Xi.UNPREDICTABLE_GAS_LIMIT:f=t;break}f&&(e+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let u=new Error(e);return u.reason=s,u.code=t,Object.keys(n).forEach(function(d){u[d]=n[d]}),u}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"),S8&&this.throwError("platform missing String.prototype.normalize",Tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:S8})}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 rg||(rg=new Tt(w8)),rg}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_8){if(!e)return;this.globalLogger().throwError("error censorship permanent",Tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}E8=!!e,_8=!!t}static setLogLevel(e){let t=p0[e.toLowerCase()];if(t==null){Tt.globalLogger().warn("invalid log level - "+e);return}A8=t}static from(e){return new Tt(e)}};o(Tt,"Logger");Tt.errors=Xi;Tt.levels=ng;var T8="bytes/5.8.0";var xr=new Tt(T8);function k8(r){return!!r.toHexString}o(k8,"isHexable");function Lc(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Lc(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Lc,"addSlice");function I8(r){return Qi(r)&&!(r.length%2)||og(r)}o(I8,"isBytesLike");function C8(r){return typeof r=="number"&&r==r&&r%1===0}o(C8,"isInteger");function og(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!C8(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!C8(t)||t<0||t>=256)return!1}return!0}o(og,"isBytes");function fr(r,e){if(e||(e={}),typeof r=="number"){xr.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),Lc(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),k8(r)&&(r=r.toHexString()),Qi(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":xr.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 Lc(new Uint8Array(n))}return og(r)?Lc(new Uint8Array(r)):xr.throwArgumentError("invalid arrayify value","value",r)}o(fr,"arrayify");function sg(r){let e=r.map(i=>fr(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),Lc(n)}o(sg,"concat");function SU(r,e){r=fr(r),r.length>e&&xr.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Lc(t)}o(SU,"zeroPad");function Qi(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Qi,"isHexString");var ig="0123456789abcdef";function rn(r,e){if(e||(e={}),typeof r=="number"){xr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=ig[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),k8(r))return r.toHexString();if(Qi(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":xr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(og(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=ig[(i&240)>>4]+ig[i&15]}return t}return xr.throwArgumentError("invalid hexlify value","value",r)}o(rn,"hexlify");function m0(r){if(typeof r!="string")r=rn(r);else if(!Qi(r)||r.length%2)return null;return(r.length-2)/2}o(m0,"hexDataLength");function b0(r,e,t){return typeof r!="string"?r=rn(r):(!Qi(r)||r.length%2)&&xr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(b0,"hexDataSlice");function ia(r,e){for(typeof r!="string"?r=rn(r):Qi(r)||xr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&xr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(ia,"hexZeroPad");function g0(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(I8(r)){let t=fr(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=rn(t.slice(0,32)),e.s=rn(t.slice(32,64))):t.length===65?(e.r=rn(t.slice(0,32)),e.s=rn(t.slice(32,64)),e.v=t[64]):xr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:xr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=rn(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=SU(fr(e._vs),32);e._vs=rn(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&xr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let f=rn(i);e.s==null?e.s=f:e.s!==f&&xr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?xr.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&&xr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Qi(e.r)?xr.throwArgumentError("signature missing or invalid r","signature",r):e.r=ia(e.r,32),e.s==null||!Qi(e.s)?xr.throwArgumentError("signature missing or invalid s","signature",r):e.s=ia(e.s,32);let t=fr(e.s);t[0]>=128&&xr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=rn(t);e._vs&&(Qi(e._vs)||xr.throwArgumentError("signature invalid _vs","signature",r),e._vs=ia(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&xr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(g0,"splitSignature");var O8=Ft(fg());var R8="bignumber/5.8.0";var MU=O8.default.BN,sY=new Tt(R8);function cg(r){return new MU(r,36).toString(16)}o(cg,"_base36To16");var N8=Ft(x1());function Uc(r){return"0x"+N8.default.keccak_256(fr(r))}o(Uc,"keccak256");var P8="address/5.8.0";var wl=new Tt(P8);function B8(r){Qi(r,20)||wl.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=fr(Uc(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(B8,"getChecksumAddress");var kU=9007199254740991;function IU(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(IU,"log10");var ug={};for(let r=0;r<10;r++)ug[String(r)]=String(r);for(let r=0;r<26;r++)ug[String.fromCharCode(65+r)]=String(10+r);var L8=Math.floor(IU(kU));function DU(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>ug[n]).join("");for(;e.length>=L8;){let n=e.substring(0,L8);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(DU,"ibanChecksum");function U8(r){let e=null;if(typeof r!="string"&&wl.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=B8(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&wl.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)!==DU(r)&&wl.throwArgumentError("bad icap checksum","address",r),e=cg(r.substring(4));e.length<40;)e="0"+e;e=B8("0x"+e)}else wl.throwArgumentError("invalid address","address",r);return e}o(U8,"getAddress");var F8="properties/5.8.0";var EY=new Tt(F8);function Fc(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Fc,"defineReadOnly");var $8="strings/5.8.0";var q8=new Tt($8),_l;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(_l||(_l={}));var cf;(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"})(cf||(cf={}));function RU(r,e,t,n,i){return q8.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(RU,"errorFunc");function j8(r,e,t,n,i){if(r===cf.BAD_PREFIX||r===cf.UNEXPECTED_CONTINUE){let s=0;for(let f=e+1;f<t.length&&t[f]>>6===2;f++)s++;return s}return r===cf.OVERRUN?t.length-e-1:0}o(j8,"ignoreFunc");function OU(r,e,t,n,i){return r===cf.OVERLONG?(n.push(i),0):(n.push(65533),j8(r,e,t,n,i))}o(OU,"replaceFunc");var NU=Object.freeze({error:RU,ignore:j8,replace:OU});function El(r,e=_l.current){e!=_l.current&&(q8.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 f=65536+((i&1023)<<10)+(s&1023);t.push(f>>18|240),t.push(f>>12&63|128),t.push(f>>6&63|128),t.push(f&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return fr(t)}o(El,"toUtf8Bytes");var H8=`Ethereum Signed Message:
819
+ `;function lg(r){return typeof r=="string"&&(r=El(r)),Uc(sg([El(H8),El(String(r.length)),r]))}o(lg,"hashMessage");var vt=Ft(fg()),ko=Ft(Vu());function $c(r,e,t){return t={path:e,exports:{},require:function(n,i){return PU(n,i??t.path)}},r(t,t.exports),t.exports}o($c,"createCommonjsModule");function PU(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(PU,"commonjsRequire");var mg=K8;function K8(r,e){if(!r)throw new Error(e||"Assertion failed")}o(K8,"assert");K8.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var eo=$c(function(r,e){"use strict";var t=e;function n(f,u){if(Array.isArray(f))return f.slice();if(!f)return[];var d=[];if(typeof f!="string"){for(var y=0;y<f.length;y++)d[y]=f[y]|0;return d}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var y=0;y<f.length;y+=2)d.push(parseInt(f[y]+f[y+1],16))}else for(var y=0;y<f.length;y++){var w=f.charCodeAt(y),A=w>>8,O=w&255;A?d.push(A,O):d.push(O)}return d}o(n,"toArray"),t.toArray=n;function i(f){return f.length===1?"0"+f:f}o(i,"zero2"),t.zero2=i;function s(f){for(var u="",d=0;d<f.length;d++)u+=i(f[d].toString(16));return u}o(s,"toHex"),t.toHex=s,t.encode=o(function(u,d){return d==="hex"?s(u):u},"encode")}),Yn=$c(function(r,e){"use strict";var t=e;t.assert=mg,t.toArray=eo.toArray,t.zero2=eo.zero2,t.toHex=eo.toHex,t.encode=eo.encode;function n(d,y,w){var A=new Array(Math.max(d.bitLength(),w)+1),O;for(O=0;O<A.length;O+=1)A[O]=0;var R=1<<y+1,I=d.clone();for(O=0;O<A.length;O++){var B,Y=I.andln(R-1);I.isOdd()?(Y>(R>>1)-1?B=(R>>1)-Y:B=Y,I.isubn(B)):B=0,A[O]=B,I.iushrn(1)}return A}o(n,"getNAF"),t.getNAF=n;function i(d,y){var w=[[],[]];d=d.clone(),y=y.clone();for(var A=0,O=0,R;d.cmpn(-A)>0||y.cmpn(-O)>0;){var I=d.andln(3)+A&3,B=y.andln(3)+O&3;I===3&&(I=-1),B===3&&(B=-1);var Y;(I&1)===0?Y=0:(R=d.andln(7)+A&7,(R===3||R===5)&&B===2?Y=-I:Y=I),w[0].push(Y);var P;(B&1)===0?P=0:(R=y.andln(7)+O&7,(R===3||R===5)&&I===2?P=-B:P=B),w[1].push(P),2*A===Y+1&&(A=1-A),2*O===P+1&&(O=1-O),d.iushrn(1),y.iushrn(1)}return w}o(i,"getJSF"),t.getJSF=i;function s(d,y,w){var A="_"+y;d.prototype[y]=o(function(){return this[A]!==void 0?this[A]:this[A]=w.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function f(d){return typeof d=="string"?t.toArray(d,"hex"):d}o(f,"parseBytes"),t.parseBytes=f;function u(d){return new vt.default(d,"hex","le")}o(u,"intFromLE"),t.intFromLE=u}),x0=Yn.getNAF,BU=Yn.getJSF,w0=Yn.assert;function sa(r,e){this.type=r,this.p=new vt.default(e.p,16),this.red=e.prime?vt.default.red(e.prime):vt.default.mont(this.p),this.zero=new vt.default(0).toRed(this.red),this.one=new vt.default(1).toRed(this.red),this.two=new vt.default(2).toRed(this.red),this.n=e.n&&new vt.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(sa,"BaseCurve");var lf=sa;sa.prototype.point=o(function(){throw new Error("Not implemented")},"point");sa.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");sa.prototype._fixedNafMul=o(function(e,t){w0(e.precomputed);var n=e._getDoubles(),i=x0(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var f=[],u,d;for(u=0;u<i.length;u+=n.step){d=0;for(var y=u+n.step-1;y>=u;y--)d=(d<<1)+i[y];f.push(d)}for(var w=this.jpoint(null,null,null),A=this.jpoint(null,null,null),O=s;O>0;O--){for(u=0;u<f.length;u++)d=f[u],d===O?A=A.mixedAdd(n.points[u]):d===-O&&(A=A.mixedAdd(n.points[u].neg()));w=w.add(A)}return w.toP()},"_fixedNafMul");sa.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,f=x0(t,n,this._bitLength),u=this.jpoint(null,null,null),d=f.length-1;d>=0;d--){for(var y=0;d>=0&&f[d]===0;d--)y++;if(d>=0&&y++,u=u.dblp(y),d<0)break;var w=f[d];w0(w!==0),e.type==="affine"?w>0?u=u.mixedAdd(s[w-1>>1]):u=u.mixedAdd(s[-w-1>>1].neg()):w>0?u=u.add(s[w-1>>1]):u=u.add(s[-w-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");sa.prototype._wnafMulAdd=o(function(e,t,n,i,s){var f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,y=0,w,A,O;for(w=0;w<i;w++){O=t[w];var R=O._getNAFPoints(e);f[w]=R.wnd,u[w]=R.points}for(w=i-1;w>=1;w-=2){var I=w-1,B=w;if(f[I]!==1||f[B]!==1){d[I]=x0(n[I],f[I],this._bitLength),d[B]=x0(n[B],f[B],this._bitLength),y=Math.max(d[I].length,y),y=Math.max(d[B].length,y);continue}var Y=[t[I],null,null,t[B]];t[I].y.cmp(t[B].y)===0?(Y[1]=t[I].add(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg())):t[I].y.cmp(t[B].y.redNeg())===0?(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].add(t[B].neg())):(Y[1]=t[I].toJ().mixedAdd(t[B]),Y[2]=t[I].toJ().mixedAdd(t[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=BU(n[I],n[B]);for(y=Math.max(J[0].length,y),d[I]=new Array(y),d[B]=new Array(y),A=0;A<y;A++){var ee=J[0][A]|0,Z=J[1][A]|0;d[I][A]=P[(ee+1)*3+(Z+1)],d[B][A]=0,u[I]=Y}}var ne=this.jpoint(null,null,null),V=this._wnafT4;for(w=y;w>=0;w--){for(var j=0;w>=0;){var H=!0;for(A=0;A<i;A++)V[A]=d[A][w]|0,V[A]!==0&&(H=!1);if(!H)break;j++,w--}if(w>=0&&j++,ne=ne.dblp(j),w<0)break;for(A=0;A<i;A++){var he=V[A];he!==0&&(he>0?O=u[A][he-1>>1]:he<0&&(O=u[A][-he-1>>1].neg()),O.type==="affine"?ne=ne.mixedAdd(O):ne=ne.add(O))}}for(w=0;w<i;w++)u[w]=null;return s?ne:ne.toP()},"_wnafMulAdd");function Ii(r,e){this.curve=r,this.type=e,this.precomputed=null}o(Ii,"BasePoint");sa.BasePoint=Ii;Ii.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");Ii.prototype.validate=o(function(){return this.curve.validate(this)},"validate");sa.prototype.decodePoint=o(function(e,t){e=Yn.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?w0(e[e.length-1]%2===0):e[0]===7&&w0(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");Ii.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");Ii.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");Ii.prototype.encode=o(function(e,t){return Yn.encode(this._encode(t),e)},"encode");Ii.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");Ii.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");Ii.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 f=0;f<e;f++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");Ii.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");Ii.prototype._getBeta=o(function(){return null},"_getBeta");Ii.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var bg=$c(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")}),LU=Yn.assert;function Di(r){lf.call(this,"short",r),this.a=new vt.default(r.a,16).toRed(this.red),this.b=new vt.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(Di,"ShortCurve");bg(Di,lf);var UU=Di;Di.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 vt.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 vt.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],LU(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new vt.default(u.a,16),b:new vt.default(u.b,16)}}):f=this._getEndoBasis(n),{beta:t,lambda:n,basis:f}}},"_getEndomorphism");Di.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:vt.default.mont(e),n=new vt.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new vt.default(3).toRed(t).redNeg().redSqrt().redMul(n),f=i.redAdd(s).fromRed(),u=i.redSub(s).fromRed();return[f,u]},"_getEndoRoots");Di.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 vt.default(1),f=new vt.default(0),u=new vt.default(0),d=new vt.default(1),y,w,A,O,R,I,B,Y=0,P,J;n.cmpn(0)!==0;){var ee=i.div(n);P=i.sub(ee.mul(n)),J=u.sub(ee.mul(s));var Z=d.sub(ee.mul(f));if(!A&&P.cmp(t)<0)y=B.neg(),w=s,A=P.neg(),O=J;else if(A&&++Y===2)break;B=P,i=n,n=P,u=s,s=J,d=f,f=Z}R=P.neg(),I=J;var ne=A.sqr().add(O.sqr()),V=R.sqr().add(I.sqr());return V.cmp(ne)>=0&&(R=y,I=w),A.negative&&(A=A.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:A,b:O},{a:R,b:I}]},"_getEndoBasis");Di.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),f=n.b.neg().mul(e).divRound(this.n),u=s.mul(n.a),d=f.mul(i.a),y=s.mul(n.b),w=f.mul(i.b),A=e.sub(u).sub(d),O=y.add(w).neg();return{k1:A,k2:O}},"_endoSplit");Di.prototype.pointFromX=o(function(e,t){e=new vt.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");Di.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");Di.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),d=e[f],y=d._getBeta();u.k1.negative&&(u.k1.ineg(),d=d.neg(!0)),u.k2.negative&&(u.k2.ineg(),y=y.neg(!0)),i[f*2]=d,i[f*2+1]=y,s[f*2]=u.k1,s[f*2+1]=u.k2}for(var w=this._wnafMulAdd(1,i,s,f*2,n),A=0;A<f*2;A++)i[A]=null,s[A]=null;return w},"_endoWnafMulAdd");function Br(r,e,t,n){lf.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new vt.default(e,16),this.y=new vt.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(Br,"Point");bg(Br,lf.BasePoint);Di.prototype.point=o(function(e,t,n){return new Br(this,e,t,n)},"point");Di.prototype.pointFromJSON=o(function(e,t){return Br.fromJSON(this,e,t)},"pointFromJSON");Br.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");Br.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");Br.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(u){return e.point(u[0],u[1],n)}o(s,"obj2point");var f=t[2];return i.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[i].concat(f.doubles.points.map(s))},naf:f.naf&&{wnd:f.naf.wnd,points:[i].concat(f.naf.points.map(s))}},i},"fromJSON");Br.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");Br.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Br.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");Br.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),f=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)},"dbl");Br.prototype.getX=o(function(){return this.x.fromRed()},"getX");Br.prototype.getY=o(function(){return this.y.fromRed()},"getY");Br.prototype.mul=o(function(e){return e=new vt.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");Br.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");Br.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");Br.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");Br.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");Br.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 zr(r,e,t,n){lf.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt.default(0)):(this.x=new vt.default(e,16),this.y=new vt.default(t,16),this.z=new vt.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(zr,"JPoint");bg(zr,lf.BasePoint);Di.prototype.jpoint=o(function(e,t,n){return new zr(this,e,t,n)},"jpoint");zr.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");zr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");zr.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),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),y=f.redSub(u);if(d.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=d.redSqr(),A=w.redMul(d),O=i.redMul(w),R=y.redSqr().redIAdd(A).redISub(O).redISub(O),I=y.redMul(O.redISub(R)).redISub(f.redMul(A)),B=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(R,I,B)},"add");zr.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,f=e.y.redMul(t).redMul(this.z),u=n.redSub(i),d=s.redSub(f);if(u.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=u.redSqr(),w=y.redMul(u),A=n.redMul(y),O=d.redSqr().redIAdd(w).redISub(A).redISub(A),R=d.redMul(A.redISub(O)).redISub(s.redMul(w)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"mixedAdd");zr.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,f=this.x,u=this.y,d=this.z,y=d.redSqr().redSqr(),w=u.redAdd(u);for(t=0;t<e;t++){var A=f.redSqr(),O=w.redSqr(),R=O.redSqr(),I=A.redAdd(A).redIAdd(A).redIAdd(i.redMul(y)),B=f.redMul(O),Y=I.redSqr().redISub(B.redAdd(B)),P=B.redISub(Y),J=I.redMul(P);J=J.redIAdd(J).redISub(R);var ee=w.redMul(d);t+1<e&&(y=y.redMul(R)),f=Y,d=ee,w=J}return this.curve.jpoint(f,w.redMul(s),d)},"dblp");zr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");zr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i),y=d.redSqr().redISub(u).redISub(u),w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),e=y,t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(A).redISub(R);I=I.redIAdd(I);var B=A.redAdd(A).redIAdd(A),Y=B.redSqr(),P=R.redIAdd(R);P=P.redIAdd(P),P=P.redIAdd(P),e=Y.redISub(I).redISub(I),t=B.redMul(I.redISub(e)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");zr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),f=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(i).redISub(f);u=u.redIAdd(u);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),y=d.redSqr().redISub(u).redISub(u);e=y;var w=f.redIAdd(f);w=w.redIAdd(w),w=w.redIAdd(w),t=d.redMul(u.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(A).redMul(this.x.redAdd(A));I=I.redAdd(I).redIAdd(I);var B=R.redIAdd(R);B=B.redIAdd(B);var Y=B.redAdd(B);e=I.redSqr().redISub(Y),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(A);var P=O.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),t=I.redMul(B.redISub(e)).redISub(P)}return this.curve.jpoint(e,t,n)},"_threeDbl");zr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),f=t.redSqr(),u=n.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(s)),y=t.redAdd(t);y=y.redIAdd(y);var w=y.redMul(u),A=d.redSqr().redISub(w.redAdd(w)),O=w.redISub(A),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=d.redMul(O).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(A,I,B)},"_dbl");zr.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),f=s.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var d=u.redSqr(),y=i.redIAdd(i);y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var w=s.redIAdd(u).redSqr().redISub(f).redISub(d).redISub(y),A=t.redMul(w);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.x.redMul(d).redISub(A);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(w.redMul(y.redISub(w)).redISub(u.redMul(d)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(d);return this.curve.jpoint(O,R,I)},"trpl");zr.prototype.mul=o(function(e,t){return e=new vt.default(e,t),this.curve._wnafMul(this,e)},"mul");zr.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");zr.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");zr.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");zr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var v0=$c(function(r,e){"use strict";var t=e;t.base=lf,t.short=UU,t.mont=null,t.edwards=null}),y0=$c(function(r,e){"use strict";var t=e,n=Yn.assert;function i(u){u.type==="short"?this.curve=new v0.short(u):u.type==="edwards"?this.curve=new v0.edwards(u):this.curve=new v0.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.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(u,d){Object.defineProperty(t,u,{configurable:!0,enumerable:!0,get:function(){var y=new i(d);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:y}),y}})}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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.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:ko.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=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:ko.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function oa(r){if(!(this instanceof oa))return new oa(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=eo.toArray(r.entropy,r.entropyEnc||"hex"),t=eo.toArray(r.nonce,r.nonceEnc||"hex"),n=eo.toArray(r.pers,r.persEnc||"hex");mg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(oa,"HmacDRBG");var V8=oa;oa.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");oa.prototype._hmac=o(function(){return new ko.default.hmac(this.hash,this.K)},"hmac");oa.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");oa.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=eo.toArray(e,t),n=eo.toArray(n,i),mg(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");oa.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=eo.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 f=s.slice(0,e);return this._update(n),this._reseed++,eo.encode(f,t)},"generate");var pg=Yn.assert;function nn(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(nn,"KeyPair");var gg=nn;nn.fromPublic=o(function(e,t,n){return t instanceof nn?t:new nn(e,{pub:t,pubEnc:n})},"fromPublic");nn.fromPrivate=o(function(e,t,n){return t instanceof nn?t:new nn(e,{priv:t,privEnc:n})},"fromPrivate");nn.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");nn.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");nn.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");nn.prototype._importPrivate=o(function(e,t){this.priv=new vt.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");nn.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?pg(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&pg(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");nn.prototype.derive=o(function(e){return e.validate()||pg(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");nn.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");nn.prototype.verify=o(function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},"verify");nn.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var FU=Yn.assert;function _0(r,e){if(r instanceof _0)return r;this._importDER(r,e)||(FU(r.r&&r.s,"Signature without r or s"),this.r=new vt.default(r.r,16),this.s=new vt.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(_0,"Signature");var E0=_0;function $U(){this.place=0}o($U,"Position");function hg(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4||r[e.place]===0)return!1;for(var i=0,s=0,f=e.place;s<n;s++,f++)i<<=8,i|=r[f],i>>>=0;return i<=127?!1:(e.place=f,i)}o(hg,"getLength");function z8(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(z8,"rmPadding");_0.prototype._importDER=o(function(e,t){e=Yn.toArray(e,t);var n=new $U;if(e[n.place++]!==48)return!1;var i=hg(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=hg(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var f=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var u=hg(e,n);if(u===!1||e.length!==u+n.place||(e[n.place]&128)!==0)return!1;var d=e.slice(n.place,u+n.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new vt.default(f),this.s=new vt.default(d),this.recoveryParam=null,!0},"_importDER");function dg(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(dg,"constructLength");_0.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=z8(t),n=z8(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];dg(i,t.length),i=i.concat(t),i.push(2),dg(i,n.length);var s=i.concat(n),f=[48];return dg(f,s.length),f=f.concat(s),Yn.encode(f,e)},"toDER");var qU=o(function(){throw new Error("unsupported")},"rand"),uf=Yn.assert;function ki(r){if(!(this instanceof ki))return new ki(r);typeof r=="string"&&(uf(Object.prototype.hasOwnProperty.call(y0,r),"Unknown curve "+r),r=y0[r]),r instanceof y0.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(ki,"EC");var jU=ki;ki.prototype.keyPair=o(function(e){return new gg(this,e)},"keyPair");ki.prototype.keyFromPrivate=o(function(e,t){return gg.fromPrivate(this,e,t)},"keyFromPrivate");ki.prototype.keyFromPublic=o(function(e,t){return gg.fromPublic(this,e,t)},"keyFromPublic");ki.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new V8({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||qU(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new vt.default(2));;){var s=new vt.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");ki.prototype._truncateToN=o(function(e,t,n){var i;if(vt.default.isBN(e)||typeof e=="number")e=new vt.default(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new vt.default(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new vt.default(s,16)}typeof n!="number"&&(n=i*8);var f=n-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");ki.prototype.sign=o(function(e,t,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!vt.default.isBN(e)){uf(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),uf(e.length>>>0===e.length);for(var s=0;s<e.length;s++)uf((e[s]&255)===e[s])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,i.msgBitLength),uf(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),d=e.toArray("be",f);uf(new vt.default(d).eq(e),"Can not sign message");for(var y=new V8({hash:this.hash,entropy:u,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),w=this.n.sub(new vt.default(1)),A=0;;A++){var O=i.k?i.k(A):new vt.default(y.generate(this.n.byteLength()));if(O=this._truncateToN(O,!0),!(O.cmpn(1)<=0||O.cmp(w)>=0)){var R=this.g.mul(O);if(!R.isInfinity()){var I=R.getX(),B=I.umod(this.n);if(B.cmpn(0)!==0){var Y=O.invm(this.n).mul(B.mul(t.getPrivate()).iadd(e));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var P=(R.getY().isOdd()?1:0)|(I.cmp(B)!==0?2:0);return i.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),P^=1),new E0({r:B,s:Y,recoveryParam:P})}}}}}},"sign");ki.prototype.verify=o(function(e,t,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),t=new E0(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var d=u.invm(this.n),y=d.mul(e).umod(this.n),w=d.mul(f).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.eqXToP(f)):(A=this.g.mulAdd(y,n.getPublic(),w),A.isInfinity()?!1:A.getX().umod(this.n).cmp(f)===0)},"verify");ki.prototype.recoverPubKey=function(r,e,t,n){uf((3&t)===t,"The recovery param is more than two bits"),e=new E0(e,n);var i=this.n,s=new vt.default(r),f=e.r,u=e.s,d=t&1,y=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?f=this.curve.pointFromX(f.add(this.curve.n),d):f=this.curve.pointFromX(f,d);var w=e.r.invm(i),A=i.sub(s).mul(w).umod(i),O=u.mul(w).umod(i);return this.g.mulAdd(A,f,O)};ki.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new E0(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{continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var HU=$c(function(r,e){"use strict";var t=e;t.version="6.6.1",t.utils=Yn,t.rand=function(){throw new Error("unsupported")},t.curve=v0,t.curves=y0,t.ec=jU,t.eddsa=null}),G8=HU.ec;var W8="signing-key/5.8.0";var yg=new Tt(W8),vg=null;function Io(){return vg||(vg=new G8("secp256k1")),vg}o(Io,"getCurve");var A0=class{constructor(e){Fc(this,"curve","secp256k1"),Fc(this,"privateKey",rn(e)),m0(this.privateKey)!==32&&yg.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Io().keyFromPrivate(fr(this.privateKey));Fc(this,"publicKey","0x"+t.getPublic(!1,"hex")),Fc(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Fc(this,"_isSigningKey",!0)}_addPoint(e){let t=Io().keyFromPublic(fr(this.publicKey)),n=Io().keyFromPublic(fr(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=fr(e);n.length!==32&&yg.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return g0({recoveryParam:i.recoveryParam,r:ia("0x"+i.r.toString(16),32),s:ia("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=Io().keyFromPrivate(fr(this.privateKey)),n=Io().keyFromPublic(fr(xg(e)));return ia("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(A0,"SigningKey");function J8(r,e){let t=g0(e),n={r:fr(t.r),s:fr(t.s)};return"0x"+Io().recoverPubKey(fr(r),n,t.recoveryParam).encode("hex",!1)}o(J8,"recoverPublicKey");function xg(r,e){let t=fr(r);if(t.length===32){let n=new A0(t);return e?"0x"+Io().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?rn(t):"0x"+Io().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+Io().keyFromPublic(t).getPublic(!0,"hex"):rn(t)}return yg.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(xg,"computePublicKey");var Y8="transactions/5.8.0";var nZ=new Tt(Y8),Z8;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Z8||(Z8={}));function X8(r){let e=xg(r);return U8(b0(Uc(b0(e,1)),12))}o(X8,"computeAddress");function Q8(r,e){return X8(J8(fr(r),e))}o(Q8,"recoverAddress");var e_="wallet/5.8.0";var hZ=new Tt(e_);function wg(r,e){return Q8(lg(r),e)}o(wg,"verifyMessage");function t_(){return{eip191:async(r,e)=>{KU(r,e)}}}o(t_,"getEIP191Verifier");var zU=new Date("2022-09-20").valueOf();function KU(r,e){tg(r),x8(r,e);let n=[wg(Bc.fromCacao(r).toMessage(),r.s.s).toLowerCase()];if(Date.parse(r.p.iat)<=zU){let s=wg(y8(Bc.fromCacao(r),"Ethereum"),r.s.s).toLowerCase();n.push(s)}let i=na.parse(r.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(i))throw new Error("Signature does not belong to issuer")}o(KU,"verifyEIP191Signature");ic();cd();var r_=Ft(Ga(),1);ic();function n_(){return Rt((0,r_.randomBytes)(16),"base64")}o(n_,"randomString");var i_="base64pad",o_="base64url";function s_(r){return Rt(r,i_)}o(s_,"encodeBase64");function a_(r){return Rt(r,o_)}o(a_,"encodeBase64Url");function f_(r){return $t(r,i_)}o(f_,"decodeBase64");function S0(r){return JSON.parse(Rt($t(r,o_)))}o(S0,"base64urlToJSON");function c_(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(c_,"fromDagJWS");function u_(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(u_,"didWithTime");function l_(r){return r?Array.isArray(r)?r:[r]:[]}o(l_,"extractControllers");var VU={...t_()};function GU(r){return"registry"in r&&"cache"in r}o(GU,"isResolver");var hf=class{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){return new hf({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Tc(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=GU(e)?e:new Ru(e,t)}async authenticate({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=n_(),s=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:f}=await this.verifyJWS(s),u=S0(s.payload);if(!f.includes(u.did))throw new Error("Invalid authencation response, kid mismatch");if(u.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(u.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(u.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=u.did,this._id}async createJWS(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 i=this._capability.p.exp;if(i&&Date.parse(i)<Date.now())throw new Error("Capability is expired, cannot create a valid signature");let s=await xl.fromCacao(this._capability),f=Ye.asCID(s.cid);if(!f)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://${f?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...t,payload:e});return n}async createDagJWS(e,t={}){let{cid:n,linkedBlock:i}=await t5(e),s=a_(n.bytes);Object.assign(t,{linkedBlock:s_(i)});let f=await this.createJWS(s,t),u=Ye.asCID(n);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 d=await xl.fromCacao(this._capability);return{jws:f,linkedBlock:i,cacaoBlock:d.bytes}}return{jws:f,linkedBlock:i}}async verifyJWS(e,t={}){t=Object.assign({verifiers:VU},t),typeof e!="string"&&(e=c_(e));let n=S0(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!t.disableTimecheck){let y=i.didDocumentMetadata?.nextUpdate;if(y){let A=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,O=new Date(y).valueOf()+A;if(!(t.atTime&&t.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let w=i.didDocumentMetadata?.updated;if(w&&t.atTime&&t.atTime.getTime()<new Date(w).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let f=i.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&f===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await yl.verify(t.capability,{disableExpirationCheck:t.disableTimecheck,atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}})}else if(t.issuer&&t.issuer!==f){let y=u_(t.issuer,t.atTime),A=(await this.resolve(y)).didDocument?.controller,O=l_(A);if(t.capability?.s&&t.capability.p.aud===f&&O.includes(t.capability.p.iss))await yl.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(f?O.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];jw(e,u);let d;try{d=S0(e.split(".")[1])}catch{}return{kid:n,payload:d,didResolutionResult:i}}async createJWE(e,t,n={}){let i=await Kw(t,this._resolver);return zw(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,t,n={}){let i=await r5(e);return this.createJWE(i,t,n)}async decryptJWE(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:n}=await this._client.request("did_decryptJWE",{did:this._id,...t,jwe:e});return f_(n)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return n5(t)}async resolve(e){let t=await 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}constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new Tc(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)}};o(hf,"DID");function h_(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(h_,"toUint8Array");var Rg=Ft(Al(),1);Qh();var Ag={};Zt(Ag,{keyToDidDoc:()=>aF});function aF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:Rt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(aF,"keyToDidDoc");var Sg={};Zt(Sg,{keyToDidDoc:()=>cF});ic();var __=Ft(Bd(),1);function fF(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${Rt(e,"base58btc")}`}o(fF,"encodeKey");function cF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=(0,__.convertPublicKeyToX25519)(r),s=`${t}#${fF(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:Rt(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:Rt(i,"base58btc")}]}}o(cF,"keyToDidDoc");var kg={};Zt(kg,{keyToDidDoc:()=>xF,pubKeyBytesToXY:()=>M_});var T0={};Zt(T0,{ECPointDecompress:()=>gF});function uF(r){return r>=0?r:-r}o(uF,"n");function lF(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),r<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let t=0n,n=1n,i=1n,s=0n;for(;r!==0n;){let f=e/r,u=e%r,d=t-i*f,y=n-s*f;e=r,r=u,t=i,n=s,i=d,s=y}return{g:e,x:t,y:n}}o(lF,"r");function M0(r,e){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let t=r%e;return t<0n?t+e:t}o(M0,"e");function E_(r,e){let t=lF(M0(r,e),e);if(t.g!==1n)throw new RangeError(`${r.toString()} does not have inverse modulo ${e.toString()}`);return M0(t.x,e)}o(E_,"o");function hF(r,e,t){if(r.length!==e.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=t??e.reduce((i,s)=>i*s,1n);return e.reduce((i,s,f)=>{let u=n/s;return M0(i+u*E_(u,s)%n*r[f]%n,n)},0n)}o(hF,"i");function dF(r){return r.map(e=>e[0]**(e[1]-1n)*(e[0]-1n)).reduce((e,t)=>t*e,1n)}o(dF,"a");function aa(r,e,t,n){if(typeof r=="number"&&(r=BigInt(r)),typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");if(t===1n)return 0n;if(r=M0(r,t),e<0n)return E_(aa(r,uF(e),t,n),t);if(n!==void 0)return function(s,f,u,d){let y=d.map(O=>O[0]**O[1]),w=d.map(O=>dF([O])),A=w.map((O,R)=>aa(s,f%O,y[R]));return hF(A,y,u)}(r,e,t,function(s){let f={};return s.forEach(u=>{if(typeof u=="bigint"||typeof u=="number"){let d=String(u);f[d]===void 0?f[d]={p:BigInt(u),k:1n}:f[d].k+=1n}else{let d=String(u[0]);f[d]===void 0?f[d]={p:BigInt(u[0]),k:BigInt(u[1])}:f[d].k+=BigInt(u[1])}}),Object.values(f).map(u=>[u.p,u.k])}(n));let i=1n;for(;e>0;)e%2n===1n&&(i=i*r%t),e/=2n,r=r**2n%t;return i}o(aa,"s");var wr={};Zt(wr,{pubKeyBytesToHex:()=>pF,publicKeyHexToUint8ArrayPointPair:()=>A_,publicKeyIntToUint8ArrayPointPair:()=>S_,publicKeyIntToXY:()=>bF,publicKeyToXY:()=>mF,testHexString:()=>Tg,testUint8Array:()=>fa});ed();function pF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");return Rt(r,"base16")}o(pF,"pubKeyBytesToHex");function mF(r){if(!Tg(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=A_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(mF,"publicKeyToXY");function A_(r){if(!Tg(r))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=r.slice(0,r.length/2),t=r.slice(r.length/2,r.length),n=$t(e,"base16"),i=$t(t,"base16");return{xOctet:n,yOctet:i}}o(A_,"publicKeyHexToUint8ArrayPointPair");function Tg(r){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(r)!==null&&e.test(r)&&typeof r=="string")}o(Tg,"testHexString");function fa(r){return r==null?!1:r.constructor===Uint8Array}o(fa,"testUint8Array");function bF(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=S_(r),t=La.encode(e.xOctet).slice(1),n=La.encode(e.yOctet).slice(1);return{xm:t,ym:n}}o(bF,"publicKeyIntToXY");function S_(r){if(r==null)throw new TypeError("input cannot be null or undefined.");if(typeof r!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(r,"x")||!Object.prototype.hasOwnProperty.call(r,"y"))throw new Error("Input must have properties x and y");if(typeof r.x!="bigint"&&typeof r.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=r.x.toString(),t=r.y.toString(),n=$t(e,"base10"),i=$t(t,"base10");return{xOctet:n,yOctet:i}}o(S_,"publicKeyIntToUint8ArrayPointPair");function gF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(Rt(f,"base10")),d=u**3n-u*3n+n,y=aa(d,i,t);return y%2n!==s&&(y=t-y),{x:u,y}}o(gF,"ECPointDecompress");var C0={};Zt(C0,{ECPointDecompress:()=>vF});function vF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),t=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(Rt(f,"base10")),d=u**3n-u*3n+n,y=aa(d,i,t);return y%2n!==s&&(y=t-y),{x:u,y}}o(vF,"ECPointDecompress");var k0={};Zt(k0,{ECPointDecompress:()=>yF});function yF(r){if(!fa(r))throw new TypeError("input must be a Uint8Array");let t=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(t+1n)/4n,s=BigInt(r[0]-2),f=r.subarray(1),u=BigInt(Rt(f,"base10")),d=u**3n-u*3n+n,y=aa(d,i,t);return y%2n!==s&&(y=t-y),{x:u,y}}o(yF,"ECPointDecompress");function xF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=M_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(xF,"keyToDidDoc");function M_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==64)return wr.publicKeyToXY(e);if(t==65&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=$t(e,"base16"),i=T0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(M_,"pubKeyBytesToXY");var Ig={};Zt(Ig,{keyToDidDoc:()=>wF,pubKeyBytesToXY:()=>T_});function wF(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=T_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(wF,"keyToDidDoc");function T_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r),t=e.length/2;if(t==96)return wr.publicKeyToXY(e);if(t==97&&e.slice(0,2)=="04"){let n=e.slice(2);return wr.publicKeyToXY(n)}if(t==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=$t(e,"base16"),i=C0.ECPointDecompress(n);return wr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(T_,"pubKeyBytesToXY");var Dg={};Zt(Dg,{keyToDidDoc:()=>_F,pubKeyBytesToXY:()=>C_});function _F(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=C_(r);return{id:t,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:t,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(_F,"keyToDidDoc");function C_(r){if(!wr.testUint8Array(r))throw new TypeError("input must be a Uint8Array");let e=wr.pubKeyBytesToHex(r);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let t=$t(e,"base16"),n=k0.ECPointDecompress(t);return wr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(C_,"pubKeyBytesToXY");var EF="application/did+ld+json",k_="application/did+json",AF={231:Ag,237:Sg,4608:kg,4609:Ig,4610:Dg};function SF(){return{key:async(r,e,t,n)=>{let i=n.accept||k_,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let f=vi.decode(e.id),u=Rg.default.decode(f),d=f.slice(Rg.default.decode.bytes),y=await AF[u].keyToDidDoc(d,e.id);i===EF?(y["@context"]="https://w3id.org/did/v1",s.didDocument=y):i===k_?s.didDocument=y:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(f){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=f.toString()}return s}}}o(SF,"getResolver");var I_={getResolver:SF};var I0=Ft(Bd(),1);var B_=Ft(R_(),1);var MF="base64pad";function O_(r){return JSON.parse((0,B_.default)(r))}o(O_,"toStableObject");function TF(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${Rt(e,"base58btc")}`}o(TF,"encodeDID");function N_(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(N_,"toGeneralJWS");var P_=o(async(r,e,t,n={})=>{let i=`${e}#${e.split(":")[2]}`,s=Lw(t),f=O_(Object.assign(n,{kid:i,alg:"EdDSA"}));return qw(typeof r=="string"?r:O_(r),s,f)},"sign"),CF={did_authenticate:async({did:r,secretKey:e},t)=>{let n=await P_({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return N_(n)},did_createJWS:async({did:r,secretKey:e},t)=>{if(t.did.split("#")[0]!==r)throw new Tn(4100,`Unknown DID: ${r}`);let i=await P_(t.payload,r,e,t.protected);return{jws:N_(i)}},did_decryptJWE:async({secretKey:r},e)=>{let t=Gw((0,I0.convertSecretKeyToX25519)(r));try{let n=await Hw(e.jwe,t);return{cleartext:Rt(n,MF)}}catch(n){throw new Tn(-32e3,n.message)}}},Sl=class{constructor(e){let{secretKey:t,publicKey:n}=(0,I0.generateKeyPairFromSeed)(e),i=TF(n),s=u5(CF);this._handle=async f=>await s({did:i,secretKey:t},f)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(Sl,"Ed25519Provider");var Og={};Zt(Og,{JsonPatchError:()=>br,_areEquals:()=>Cl,applyOperation:()=>df,applyPatch:()=>L0,applyReducer:()=>OF,deepClone:()=>DF,getValueByPointer:()=>P0,validate:()=>U_,validator:()=>B0});var kF=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)}}(),IF=Object.prototype.hasOwnProperty;function R0(r,e){return IF.call(r,e)}o(R0,"hasOwnProperty");function O0(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)R0(r,i)&&n.push(i);return n}o(O0,"_objectKeys");function Kr(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(Kr,"_deepClone");function N0(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(N0,"isInteger");function Do(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(Do,"escapePathComponent");function Ml(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Ml,"unescapePathComponent");function D0(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(D0(r[e]))return!0}else if(typeof r=="object"){for(var n=O0(r),i=n.length,s=0;s<i;s++)if(D0(r[n[s]]))return!0}}return!1}o(D0,"hasUndefined");function L_(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<"u"&&t.push(n+": "+i)}return t.join(`
820
820
  `)}o(L_,"patchErrorMessageFormatter");var Tl=function(r){kF(e,r);function e(t,n,i,s,f){var u=this.constructor,d=r.call(this,L_(t,{name:n,index:i,operation:s,tree:f}))||this;return d.name=n,d.index=i,d.operation=s,d.tree=f,Object.setPrototypeOf(d,u.prototype),d.message=L_(t,{name:n,index:i,operation:s,tree:f}),d}return o(e,"PatchError"),e}(Error);var br=Tl,DF=Kr,qc={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=P0(t,this.path);n&&(n=Kr(n));var i=df(t,{op:"remove",path:this.from}).removed;return df(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=P0(t,this.from);return df(t,{op:"add",path:this.path,value:Kr(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:Cl(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},RF={add:function(r,e,t){return N0(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:qc.move,copy:qc.copy,test:qc.test,_get:qc._get};function P0(r,e){if(e=="")return r;var t={op:"_get",path:e};return df(r,t),t.value}o(P0,"getValueByPointer");function df(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):B0(e,0)),e.path===""){var f={newDocument:r};if(e.op==="add")return f.newDocument=e.value,f;if(e.op==="replace")return f.newDocument=e.value,f.removed=r,f;if(e.op==="move"||e.op==="copy")return f.newDocument=P0(r,e.from),e.op==="move"&&(f.removed=r),f;if(e.op==="test"){if(f.test=Cl(r,e.value),f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f.newDocument=r,f}else{if(e.op==="remove")return f.removed=r,f.newDocument=null,f;if(e.op==="_get")return e.value=r,f;if(t)throw new br("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return f}}else{n||(r=Kr(r));var u=e.path||"",d=u.split("/"),y=r,w=1,A=d.length,O=void 0,R=void 0,I=void 0;for(typeof t=="function"?I=t:I=B0;;){if(R=d[w],R&&R.indexOf("~")!=-1&&(R=Ml(R)),i&&(R=="__proto__"||R=="prototype"&&w>0&&d[w-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&&O===void 0&&(y[R]===void 0?O=d.slice(0,w).join("/"):w==A-1&&(O=e.path),O!==void 0&&I(e,0,r,O)),w++,Array.isArray(y)){if(R==="-")R=y.length;else{if(t&&!N0(R))throw new br("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);N0(R)&&(R=~~R)}if(w>=A){if(t&&e.op==="add"&&R>y.length)throw new br("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var f=RF[e.op].call(e,y,R,r);if(f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}}else if(w>=A){var f=qc[e.op].call(e,y,R,r);if(f.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return f}if(y=y[R],t&&w<A&&(!y||typeof y!="object"))throw new br("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(df,"applyOperation");function L0(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new br("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=Kr(r));for(var s=new Array(e.length),f=0,u=e.length;f<u;f++)s[f]=df(r,e[f],t,!0,i,f),r=s[f].newDocument;return s.newDocument=r,s}o(L0,"applyPatch");function OF(r,e,t){var n=df(r,e);if(n.test===!1)throw new br("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(OF,"applyReducer");function B0(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new br("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(qc[r.op]){if(typeof r.path!="string")throw new br("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new br('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 br("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 br("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")&&D0(r.value))throw new br("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 br("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 br("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 f={op:"_get",path:r.from,value:void 0},u=U_([f],t);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new br("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new br("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(B0,"validator");function U_(r,e,t){try{if(!Array.isArray(r))throw new br("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)L0(Kr(e),Kr(r),t||!0);else{t=t||B0;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof br)return i;throw i}}o(U_,"validate");function Cl(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,f;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!Cl(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var u=Object.keys(r);if(s=u.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(u[i]))return!1;for(i=s;i--!==0;)if(f=u[i],!Cl(r[f],e[f]))return!1;return!0}return r!==r&&e!==e}o(Cl,"_areEquals");var Lg={};Zt(Lg,{compare:()=>qF,generate:()=>Ng,observe:()=>$F,unobserve:()=>FF});var Pg=new WeakMap,NF=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),PF=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function BF(r){return Pg.get(r)}o(BF,"getMirror");function LF(r,e){return r.observers.get(e)}o(LF,"getObserverFromMirror");function UF(r,e){r.observers.delete(e.callback)}o(UF,"removeObserverFromMirror");function FF(r,e){e.unobserve()}o(FF,"unobserve");function $F(r,e){var t=[],n,i=BF(r);if(!i)i=new NF(r),Pg.set(r,i);else{var s=LF(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=Kr(r),e){n.callback=e,n.next=null;var f=o(function(){Ng(n)},"dirtyCheck"),u=o(function(){clearTimeout(n.next),n.next=setTimeout(f)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",u),window.addEventListener("keyup",u),window.addEventListener("mousedown",u),window.addEventListener("keydown",u),window.addEventListener("change",u))}return n.patches=t,n.object=r,n.unobserve=function(){Ng(n),clearTimeout(n.next),UF(i,n),typeof window<"u"&&(window.removeEventListener("mouseup",u),window.removeEventListener("keyup",u),window.removeEventListener("mousedown",u),window.removeEventListener("keydown",u),window.removeEventListener("change",u))},i.observers.set(e,new PF(e,n)),n}o($F,"observe");function Ng(r,e){e===void 0&&(e=!1);var t=Pg.get(r.object);Bg(t.value,r.object,r.patches,"",e),r.patches.length&&L0(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(Ng,"generate");function Bg(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=O0(e),f=O0(r),u=!1,d=!1,y=f.length-1;y>=0;y--){var w=f[y],A=r[w];if(R0(e,w)&&!(e[w]===void 0&&A!==void 0&&Array.isArray(e)===!1)){var O=e[w];typeof A=="object"&&A!=null&&typeof O=="object"&&O!=null&&Array.isArray(A)===Array.isArray(O)?Bg(A,O,t,n+"/"+Do(w),i):A!==O&&(u=!0,i&&t.push({op:"test",path:n+"/"+Do(w),value:Kr(A)}),t.push({op:"replace",path:n+"/"+Do(w),value:Kr(O)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+Do(w),value:Kr(A)}),t.push({op:"remove",path:n+"/"+Do(w)}),d=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),u=!0)}if(!(!d&&s.length==f.length))for(var y=0;y<s.length;y++){var w=s[y];!R0(r,w)&&e[w]!==void 0&&t.push({op:"add",path:n+"/"+Do(w),value:Kr(e[w])})}}}o(Bg,"_generate");function qF(r,e,t){t===void 0&&(t=!1);var n=[];return Bg(r,e,n,"",t),n}o(qF,"compare");var U0=Object.assign({},Og,Lg,{JsonPatchError:Tl,deepClone:Kr,escapePathComponent:Do,unescapePathComponent:Ml});var M9=Ft(Vc(),1);var T9=Ft(Ga(),1);var _r;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(_r||(_r={}));var yv=Ft(Vc(),1);ji();tc();var ME={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function mq(r){let e=ME[r];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${r}`)}o(mq,"codeByName");function bq(r){let e=Object.entries(ME).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(bq,"nameByCode");var In=class{};o(In,"StreamType");In.nameByCode=bq;In.codeByName=mq;var ov=Ft(Al(),1);function Zn(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,f)=>{if(f.value!=null)f.value=TE(f.value,e,t,n);else if(f.get!=null)f.get=TE(f.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(Zn,"Memoize");var Xg=new Map;function TE(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let f;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let u=this[i];if(Array.isArray(n))for(let d of n)Xg.has(d)?Xg.get(d).push(u):Xg.set(d,[u]);if(e||s.length>0||t>0){let d;e===!0?d=s.map(A=>A.toString()).join("!"):e?d=e.apply(this,s):d=s[0];let y=`${d}__timestamp`,w=!1;if(t>0)if(!u.has(y))w=!0;else{let A=u.get(y);w=Date.now()-A>t}u.has(d)&&!w?f=u.get(d):(f=r.apply(this,s),u.set(d,f),t>0&&u.set(y,Date.now()))}else{let d=this;u.has(d)?f=u.get(d):(f=r.apply(this,s),u.set(d,f))}return f}}o(TE,"getNewFunction");ji();tc();Uu();var nv=Ft(Al(),1);function Gc(r){try{return r()}catch(e){return e}}o(Gc,"tryCatch");ji();var Qg=Ft(Al(),1);Fa();function gf(r){let e=Qg.default.decode(r),t=Qg.default.decode.bytes,n=r.subarray(t);return[e,n,t]}o(gf,"readVarint");function gq(r){return r===0||r===1}o(gq,"isCidVersion");function ev(r){let[e,t]=gf(r);if(!gq(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=gf(t),[,s,f]=gf(i),[u,,d]=gf(s),y=i.subarray(0,f+d+u),w=i.subarray(f+d+u);return[Ye.create(e,n,nd(y)),w]}o(ev,"readCid");ji();tc();function vf(r,e="StreamRef"){let[t,n]=gf(r);if(t!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,s]=gf(n),f=ev(s),[u,d]=f;if(d.length===0)return{kind:"stream-id",type:i,genesis:u};if(d.length===1&&d[0]===0)return{kind:"commit-id",type:i,genesis:u,commit:null};{let[y]=ev(d);return{kind:"commit-id",type:i,genesis:u,commit:y}}}o(vf,"fromBytes");var vq=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Wc(r,e="StreamRef"){let t=vq.exec(r)||[],n=t[2];if(!n)throw new Error(`Malformed ${e} string: ${r}`);let i=qi.decode(n),s=vf(i),f=t[4];return f?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:tv(s.genesis,f)}:s}o(Wc,"fromString");function yq(r){try{return typeof r=="string"?Ye.parse(r):Ye.asCID(r)}catch{return null}}o(yq,"parseCID");function tv(r,e=null){if(!e||e==="0")return null;let t=yq(e);if(t)return r.equals(t)?null:t;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(tv,"parseCommit");var Rl=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ri=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},G0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${qi.encode(e)}: contains commit`)}};o(G0,"InvalidStreamIDBytesError");var W0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(W0,"InvalidStreamIDStringError");function IE(r){let e=vf(r,"StreamID");if(e.kind==="stream-id")return new it(e.type,e.genesis);throw new G0(r)}o(IE,"fromBytes");function xq(r){return Gc(()=>IE(r))}o(xq,"fromBytesNoThrow");function DE(r){let e=Wc(r,"StreamID");if(e.kind==="stream-id")return new it(e.type,e.genesis);throw new W0(r)}o(DE,"fromString");function wq(r){return Gc(()=>DE(r))}o(wq,"fromStringNoThrow");var kE=Symbol.for("@ceramicnetwork/streamid/StreamID"),it=class{constructor(e,t){if(this._tag=kE,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?In.codeByName(e):e,this._cid=typeof t=="string"?Ye.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===kE}static async fromGenesis(e,t){let n=await Qa({value:t,codec:Yi,hasher:Fs});return new it(e,n.cid)}get type(){return this._type}get typeName(){return In.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=nv.default.encode(206),t=nv.default.encode(this.type);return Fi([e,t,this.cid.bytes])}get baseID(){return new it(this._type,this._cid)}equals(e){return it.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return qi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(it,"StreamID");it.fromBytes=IE;it.fromBytesNoThrow=xq;it.fromString=DE;it.fromStringNoThrow=wq;Rl([Zn(),Ri("design:type",String),Ri("design:paramtypes",[])],it.prototype,"typeName",null);Rl([Zn(),Ri("design:type",Uint8Array),Ri("design:paramtypes",[])],it.prototype,"bytes",null);Rl([Zn(),Ri("design:type",it),Ri("design:paramtypes",[])],it.prototype,"baseID",null);Rl([Zn(),Ri("design:type",Function),Ri("design:paramtypes",[]),Ri("design:returntype",String)],it.prototype,"toString",null);Rl([Zn(),Ri("design:type",Function),Ri("design:paramtypes",[]),Ri("design:returntype",String)],it.prototype,"toUrl",null);var Yc=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Dn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},iv=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},vs=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)},Jc,yf,Ol,J0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${qi.encode(e)}: no commit information provided`)}};o(J0,"InvalidCommitIDBytesError");var Y0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(Y0,"InvalidCommitIDStringError");function OE(r){let e=vf(r,"CommitID");if(e.kind==="commit-id")return new Bt(e.type,e.genesis,e.commit);throw new J0(r)}o(OE,"fromBytes");function _q(r){return Gc(()=>OE(r))}o(_q,"fromBytesNoThrow");function NE(r){let e=Wc(r,"CommitID");if(e.kind==="commit-id")return new Bt(e.type,e.genesis,e.commit);throw new Y0(r)}o(NE,"fromString");function Eq(r){return Gc(()=>NE(r))}o(Eq,"fromStringNoThrow");var RE=Symbol.for("@ceramicnetwork/streamid/CommitID");function Aq(r,e){return new Bt(r.type,r.cid,e)}o(Aq,"make");var Bt=class{constructor(e,t,n=null){if(this._tag=RE,Jc.set(this,void 0),yf.set(this,void 0),Ol.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");iv(this,Jc,typeof e=="string"?In.codeByName(e):e,"f"),iv(this,yf,typeof t=="string"?Ye.parse(t):t,"f"),iv(this,Ol,tv(vs(this,yf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===RE}get baseID(){return new it(vs(this,Jc,"f"),vs(this,yf,"f"))}get type(){return vs(this,Jc,"f")}get typeName(){return In.nameByCode(vs(this,Jc,"f"))}get cid(){return vs(this,yf,"f")}get commit(){return vs(this,Ol,"f")||vs(this,yf,"f")}get bytes(){let e=ov.default.encode(206),t=ov.default.encode(this.type),n=vs(this,Ol,"f")?.bytes||new Uint8Array([0]);return Fi([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 qi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Jc=new WeakMap,yf=new WeakMap,Ol=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Bt,"CommitID");Bt.fromBytes=OE;Bt.fromBytesNoThrow=_q;Bt.fromString=NE;Bt.fromStringNoThrow=Eq;Bt.make=Aq;Yc([Zn(),Dn("design:type",it),Dn("design:paramtypes",[])],Bt.prototype,"baseID",null);Yc([Zn(),Dn("design:type",String),Dn("design:paramtypes",[])],Bt.prototype,"typeName",null);Yc([Zn(),Dn("design:type",Ye),Dn("design:paramtypes",[])],Bt.prototype,"commit",null);Yc([Zn(),Dn("design:type",Uint8Array),Dn("design:paramtypes",[])],Bt.prototype,"bytes",null);Yc([Zn(),Dn("design:type",Function),Dn("design:paramtypes",[]),Dn("design:returntype",String)],Bt.prototype,"toString",null);Yc([Zn(),Dn("design:type",Function),Dn("design:paramtypes",[]),Dn("design:returntype",String)],Bt.prototype,"toUrl",null);tc();var dn;(function(r){function e(i){let s=vf(i);switch(s.kind){case"commit-id":return new Bt(s.type,s.genesis,s.commit);case"stream-id":return new it(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${qi.encode(i)}`)}}o(e,"fromBytes"),r.fromBytes=e;function t(i){let s=Wc(i);switch(s.kind){case"commit-id":return new Bt(s.type,s.genesis,s.commit);case"stream-id":return new it(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(t,"fromString"),r.fromString=t;function n(i){if(it.isInstance(i)||Bt.isInstance(i))return i;if(i instanceof Uint8Array)return e(i);if(typeof i=="string")return t(i);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(i)}`)}o(n,"from"),r.from=n})(dn||(dn={}));var sv=o(function(r,e){return sv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},sv(r,e)},"extendStatics");function on(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sv(r,e);function t(){this.constructor=r}o(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}o(on,"__extends");function PE(r,e,t,n){function i(s){return s instanceof t?s:new t(function(f){f(s)})}return o(i,"adopt"),new(t||(t=Promise))(function(s,f){function u(w){try{y(n.next(w))}catch(A){f(A)}}o(u,"fulfilled");function d(w){try{y(n.throw(w))}catch(A){f(A)}}o(d,"rejected");function y(w){w.done?s(w.value):i(w.value).then(u,d)}o(y,"step"),y((n=n.apply(r,e||[])).next())})}o(PE,"__awaiter");function Z0(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=u(0),f.throw=u(1),f.return=u(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(y){return function(w){return d([y,w])}}function d(y){if(n)throw new TypeError("Generator is already executing.");for(;f&&(f=0,y[0]&&(t=0)),t;)try{if(n=1,i&&(s=y[0]&2?i.return:y[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,y[1])).done)return s;switch(i=0,s&&(y=[y[0]&2,s.value]),y[0]){case 0:case 1:s=y;break;case 4:return t.label++,{value:y[1],done:!1};case 5:t.label++,i=y[1],y=[0];continue;case 7:y=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(y[0]===6||y[0]===2)){t=0;continue}if(y[0]===3&&(!s||y[1]>s[0]&&y[1]<s[3])){t.label=y[1];break}if(y[0]===6&&t.label<s[1]){t.label=s[1],s=y;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(y);break}s[2]&&t.ops.pop(),t.trys.pop();continue}y=e.call(r,t)}catch(w){y=[6,w],i=0}finally{n=s=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}o(Z0,"__generator");function ys(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(ys,"__values");function Xn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],f;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(u){f={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(f)throw f.error}}return s}o(Xn,"__read");function to(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}o(to,"__spreadArray");function xf(r){return this instanceof xf?(this.v=r,this):new xf(r)}o(xf,"__await");function BE(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",f),i[Symbol.asyncIterator]=function(){return this},i;function f(R){return function(I){return Promise.resolve(I).then(R,A)}}function u(R,I){n[R]&&(i[R]=function(B){return new Promise(function(Y,P){s.push([R,B,Y,P])>1||d(R,B)})},I&&(i[R]=I(i[R])))}function d(R,I){try{y(n[R](I))}catch(B){O(s[0][3],B)}}function y(R){R.value instanceof xf?Promise.resolve(R.value.v).then(w,A):O(s[0][2],R)}function w(R){d("next",R)}function A(R){d("throw",R)}function O(R,I){R(I),s.shift(),s.length&&d(s[0][0],s[0][1])}}o(BE,"__asyncGenerator");function LE(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof ys=="function"?ys(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(f){return new Promise(function(u,d){f=r[s](f),i(u,d,f.done,f.value)})}}function i(s,f,u,d){Promise.resolve(d).then(function(y){s({value:y,done:u})},f)}}o(LE,"__asyncValues");function Ct(r){return typeof r=="function"}o(Ct,"isFunction");function Zc(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(Zc,"createErrorClass");var X0=Zc(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
821
821
  `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
822
- `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function wf(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(wf,"arrRemove");var ua=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 f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var u=ys(f),d=u.next();!d.done;d=u.next()){var y=d.value;y.remove(this)}}catch(B){e={error:B}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else f.remove(this);var w=this.initialTeardown;if(Ct(w))try{w()}catch(B){s=B instanceof X0?B.errors:[B]}var A=this._finalizers;if(A){this._finalizers=null;try{for(var O=ys(A),R=O.next();!R.done;R=O.next()){var I=R.value;try{UE(I)}catch(B){s=s??[],B instanceof X0?s=to(to([],Xn(s)),Xn(B.errors)):s.push(B)}}}catch(B){n={error:B}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(s)throw new X0(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)UE(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)&&wf(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&wf(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var av=ua.EMPTY;function Q0(r){return r instanceof ua||r&&"closed"in r&&Ct(r.remove)&&Ct(r.add)&&Ct(r.unsubscribe)}o(Q0,"isSubscription");function UE(r){Ct(r)?r():r.unsubscribe()}o(UE,"execFinalizer");var ro={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Xc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Xc.delegate;return i?.setTimeout?i.setTimeout.apply(i,to([r,e],Xn(t))):setTimeout.apply(void 0,to([r,e],Xn(t)))},clearTimeout:function(r){var e=Xc.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function ep(r){Xc.setTimeout(function(){var e=ro.onUnhandledError;if(e)e(r);else throw r})}o(ep,"reportUnhandledError");function fv(){}o(fv,"noop");var FE=function(){return cv("C",void 0,void 0)}();function $E(r){return cv("E",void 0,r)}o($E,"errorNotification");function qE(r){return cv("N",r,void 0)}o(qE,"nextNotification");function cv(r,e,t){return{kind:r,value:e,error:t}}o(cv,"createNotification");var _f=null;function Qc(r){if(ro.useDeprecatedSynchronousErrorHandling){var e=!_f;if(e&&(_f={errorThrown:!1,error:null}),r(),e){var t=_f,n=t.errorThrown,i=t.error;if(_f=null,n)throw i}}else r()}o(Qc,"errorContext");function jE(r){ro.useDeprecatedSynchronousErrorHandling&&_f&&(_f.errorThrown=!0,_f.error=r)}o(jE,"captureError");var Nl=function(r){on(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Q0(t)&&t.add(n)):n.destination=Cq,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new rp(t,n,i)},e.prototype.next=function(t){this.isStopped?lv(qE(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?lv($E(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?lv(FE,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}(ua);var Sq=Function.prototype.bind;function uv(r,e){return Sq.call(r,e)}o(uv,"bind");var Mq=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){tp(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){tp(n)}else tp(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){tp(t)}},r}(),rp=function(r){on(e,r);function e(t,n,i){var s=r.call(this)||this,f;if(Ct(t)||!t)f={next:t??void 0,error:n??void 0,complete:i??void 0};else{var u;s&&ro.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()},f={next:t.next&&uv(t.next,u),error:t.error&&uv(t.error,u),complete:t.complete&&uv(t.complete,u)}):f=t}return s.destination=new Mq(f),s}return o(e,"SafeSubscriber"),e}(Nl);function tp(r){ro.useDeprecatedSynchronousErrorHandling?jE(r):ep(r)}o(tp,"handleUnhandledError");function Tq(r){throw r}o(Tq,"defaultErrorHandler");function lv(r,e){var t=ro.onStoppedNotification;t&&Xc.setTimeout(function(){return t(r,e)})}o(lv,"handleStoppedNotification");var Cq={closed:!0,next:fv,error:Tq,complete:fv};var eu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function tu(r){return r}o(tu,"identity");function HE(r){return r.length===0?tu:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(HE,"pipeFromArray");var Yt=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=Iq(e)?e:new rp(e,t,n);return Qc(function(){var f=i,u=f.operator,d=f.source;s.add(u?u.call(s,d):d?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=zE(t),new t(function(i,s){var f=new rp({next:function(u){try{e(u)}catch(d){s(d),f.unsubscribe()}},error:s,complete:i});n.subscribe(f)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[eu]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return HE(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=zE(e),new e(function(n,i){var s;t.subscribe(function(f){return s=f},function(f){return i(f)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function zE(r){var e;return(e=r??ro.Promise)!==null&&e!==void 0?e:Promise}o(zE,"getPromiseCtor");function kq(r){return r&&Ct(r.next)&&Ct(r.error)&&Ct(r.complete)}o(kq,"isObserver");function Iq(r){return r&&r instanceof Nl||kq(r)&&Q0(r)}o(Iq,"isSubscriber");function Dq(r){return Ct(r?.lift)}o(Dq,"hasLift");function Lr(r){return function(e){if(Dq(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(Lr,"operate");function Ur(r,e,t,n,i){return new Rq(r,e,t,n,i)}o(Ur,"createOperatorSubscriber");var Rq=function(r){on(e,r);function e(t,n,i,s,f,u){var d=r.call(this,t)||this;return d.onFinalize=f,d.shouldUnsubscribe=u,d._next=n?function(y){try{n(y)}catch(w){t.error(w)}}:r.prototype._next,d._error=s?function(y){try{s(y)}catch(w){t.error(w)}finally{this.unsubscribe()}}:r.prototype._error,d._complete=i?function(){try{i()}catch(y){t.error(y)}finally{this.unsubscribe()}}:r.prototype._complete,d}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}(Nl);var KE=Zc(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var hv=function(r){on(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 VE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new KE},e.prototype.next=function(t){var n=this;Qc(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var f=ys(n.currentObservers),u=f.next();!u.done;u=f.next()){var d=u.value;d.next(t)}}catch(y){i={error:y}}finally{try{u&&!u.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;Qc(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;Qc(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,f=i.isStopped,u=i.observers;return s||f?av:(this.currentObservers=null,u.push(t),new ua(function(){n.currentObservers=null,wf(u,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,f=n.isStopped;i?t.error(s):f&&t.complete()},e.prototype.asObservable=function(){var t=new Yt;return t.source=this,t},e.create=function(t,n){return new VE(t,n)},e}(Yt);var VE=function(r){on(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:av},e}(hv);var dv=function(r){on(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}(hv);var pv={now:function(){return(pv.delegate||Date).now()},delegate:void 0};var GE=function(r){on(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}(ua);var Pl={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Pl.delegate;return i?.setInterval?i.setInterval.apply(i,to([r,e],Xn(t))):setInterval.apply(void 0,to([r,e],Xn(t)))},clearInterval:function(r){var e=Pl.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var WE=function(r){on(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){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var s=this.id,f=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(f,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(f,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),Pl.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;n!=null&&Pl.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(f){i=!0,s=f||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,wf(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(GE);var mv=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=pv.now,r}();var JE=function(r){on(e,r);function e(t,n){n===void 0&&(n=mv.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,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}(mv);var Oq=new JE(WE),YE=Oq;var np=new Yt(function(r){return r.complete()});function ip(r){return r&&Ct(r.schedule)}o(ip,"isScheduler");function ZE(r){return r[r.length-1]}o(ZE,"last");function XE(r){return ip(ZE(r))?r.pop():void 0}o(XE,"popScheduler");function QE(r,e){return typeof ZE(r)=="number"?r.pop():e}o(QE,"popNumber");var ru=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function op(r){return Ct(r?.then)}o(op,"isPromise");function sp(r){return Ct(r[eu])}o(sp,"isInteropObservable");function ap(r){return Symbol.asyncIterator&&Ct(r?.[Symbol.asyncIterator])}o(ap,"isAsyncIterable");function fp(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(fp,"createInvalidObservableTypeError");function Nq(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Nq,"getSymbolIterator");var cp=Nq();function up(r){return Ct(r?.[cp])}o(up,"isIterable");function lp(r){return BE(this,arguments,o(function(){var t,n,i,s;return Z0(this,function(f){switch(f.label){case 0:t=r.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,xf(t.read())];case 3:return n=f.sent(),i=n.value,s=n.done,s?[4,xf(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,xf(i)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(lp,"readableStreamLikeToAsyncGenerator");function hp(r){return Ct(r?.getReader)}o(hp,"isReadableStreamLike");function sn(r){if(r instanceof Yt)return r;if(r!=null){if(sp(r))return Pq(r);if(ru(r))return Bq(r);if(op(r))return Lq(r);if(ap(r))return e9(r);if(up(r))return Uq(r);if(hp(r))return Fq(r)}throw fp(r)}o(sn,"innerFrom");function Pq(r){return new Yt(function(e){var t=r[eu]();if(Ct(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Pq,"fromInteropObservable");function Bq(r){return new Yt(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(Bq,"fromArrayLike");function Lq(r){return new Yt(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ep)})}o(Lq,"fromPromise");function Uq(r){return new Yt(function(e){var t,n;try{for(var i=ys(r),s=i.next();!s.done;s=i.next()){var f=s.value;if(e.next(f),e.closed)return}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(Uq,"fromIterable");function e9(r){return new Yt(function(e){$q(r,e).catch(function(t){return e.error(t)})})}o(e9,"fromAsyncIterable");function Fq(r){return e9(lp(r))}o(Fq,"fromReadableStreamLike");function $q(r,e){var t,n,i,s;return PE(this,void 0,void 0,function(){var f,u;return Z0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),t=LE(r),d.label=1;case 1:return[4,t.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(f=n.value,e.next(f),e.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),i={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:d.sent(),d.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($q,"process");function Oi(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(Oi,"executeSchedule");function dp(r,e){return e===void 0&&(e=0),Lr(function(t,n){t.subscribe(Ur(n,function(i){return Oi(n,r,function(){return n.next(i)},e)},function(){return Oi(n,r,function(){return n.complete()},e)},function(i){return Oi(n,r,function(){return n.error(i)},e)}))})}o(dp,"observeOn");function pp(r,e){return e===void 0&&(e=0),Lr(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(pp,"subscribeOn");function t9(r,e){return sn(r).pipe(pp(e),dp(e))}o(t9,"scheduleObservable");function r9(r,e){return sn(r).pipe(pp(e),dp(e))}o(r9,"schedulePromise");function n9(r,e){return new Yt(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(n9,"scheduleArray");function i9(r,e){return new Yt(function(t){var n;return Oi(t,e,function(){n=r[cp](),Oi(t,e,function(){var i,s,f;try{i=n.next(),s=i.value,f=i.done}catch(u){t.error(u);return}f?t.complete():t.next(s)},0,!0)}),function(){return Ct(n?.return)&&n.return()}})}o(i9,"scheduleIterable");function mp(r,e){if(!r)throw new Error("Iterable cannot be null");return new Yt(function(t){Oi(t,e,function(){var n=r[Symbol.asyncIterator]();Oi(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(mp,"scheduleAsyncIterable");function o9(r,e){return mp(lp(r),e)}o(o9,"scheduleReadableStreamLike");function s9(r,e){if(r!=null){if(sp(r))return t9(r,e);if(ru(r))return n9(r,e);if(op(r))return r9(r,e);if(ap(r))return mp(r,e);if(up(r))return i9(r,e);if(hp(r))return o9(r,e)}throw fp(r)}o(s9,"scheduled");function a9(r,e){return e?s9(r,e):sn(r)}o(a9,"from");var bp=Zc(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function f9(r){return r instanceof Date&&!isNaN(r)}o(f9,"isValidDate");function gp(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){n.next(r.call(e,s,i++))}))})}o(gp,"map");var qq=Array.isArray;function jq(r,e){return qq(e)?r.apply(void 0,to([],Xn(e))):r(e)}o(jq,"callOrApply");function c9(r){return gp(function(e){return jq(r,e)})}o(c9,"mapOneOrManyArgs");function u9(r,e,t,n,i,s,f,u){var d=[],y=0,w=0,A=!1,O=o(function(){A&&!d.length&&!y&&e.complete()},"checkComplete"),R=o(function(B){return y<n?I(B):d.push(B)},"outerNext"),I=o(function(B){s&&e.next(B),y++;var Y=!1;sn(t(B,w++)).subscribe(Ur(e,function(P){i?.(P),s?R(P):e.next(P)},function(){Y=!0},void 0,function(){if(Y)try{y--;for(var P=o(function(){var J=d.shift();f?Oi(e,f,function(){return I(J)}):I(J)},"_loop_1");d.length&&y<n;)P();O()}catch(J){e.error(J)}}))},"doInnerSub");return r.subscribe(Ur(e,R,function(){A=!0,O()})),function(){u?.()}}o(u9,"mergeInternals");function Bl(r,e,t){return t===void 0&&(t=1/0),Ct(e)?Bl(function(n,i){return gp(function(s,f){return e(n,s,i,f)})(sn(r(n,i)))},t):(typeof e=="number"&&(t=e),Lr(function(n,i){return u9(n,i,r,t)}))}o(Bl,"mergeMap");function l9(r){return r===void 0&&(r=1/0),Bl(tu,r)}o(l9,"mergeAll");var Hq=["addListener","removeListener"],zq=["addEventListener","removeEventListener"],Kq=["on","off"];function Ll(r,e,t,n){if(Ct(t)&&(n=t,t=void 0),n)return Ll(r,e,t).pipe(c9(n));var i=Xn(Wq(r)?zq.map(function(u){return function(d){return r[u](e,d,t)}}):Vq(r)?Hq.map(h9(r,e)):Gq(r)?Kq.map(h9(r,e)):[],2),s=i[0],f=i[1];if(!s&&ru(r))return Bl(function(u){return Ll(u,e,t)})(sn(r));if(!s)throw new TypeError("Invalid event target");return new Yt(function(u){var d=o(function(){for(var y=[],w=0;w<arguments.length;w++)y[w]=arguments[w];return u.next(1<y.length?y:y[0])},"handler");return s(d),function(){return f(d)}})}o(Ll,"fromEvent");function h9(r,e){return function(t){return function(n){return r[t](e,n)}}}o(h9,"toCommonHandlerRegistry");function Vq(r){return Ct(r.addListener)&&Ct(r.removeListener)}o(Vq,"isNodeStyleEventEmitter");function Gq(r){return Ct(r.on)&&Ct(r.off)}o(Gq,"isJQueryStyleEventEmitter");function Wq(r){return Ct(r.addEventListener)&&Ct(r.removeEventListener)}o(Wq,"isEventTarget");function Ul(r,e,t){r===void 0&&(r=0),t===void 0&&(t=YE);var n=-1;return e!=null&&(ip(e)?t=e:n=e),new Yt(function(i){var s=f9(r)?+r-t.now():r;s<0&&(s=0);var f=0;return t.schedule(function(){i.closed||(i.next(f++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(Ul,"timer");function bv(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=XE(r),n=QE(r,1/0),i=r;return i.length?i.length===1?sn(i[0]):l9(n)(a9(i,t)):np}o(bv,"merge");function d9(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(d9,"filter");function p9(r){return Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(p9,"defaultIfEmpty");function m9(r){return r<=0?function(){return np}:Lr(function(e,t){var n=0;e.subscribe(Ur(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(m9,"take");function b9(r){return r===void 0&&(r=Jq),Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(b9,"throwIfEmpty");function Jq(){return new bp}o(Jq,"defaultErrorFactory");function gv(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?d9(function(i,s){return r(i,s,n)}):tu,m9(1),t?p9(e):b9(function(){return new bp}))}}o(gv,"first");function vv(r,e){return Lr(function(t,n){var i=e??{},s=i.leading,f=s===void 0?!0:s,u=i.trailing,d=u===void 0?!1:u,y=!1,w=null,A=null,O=!1,R=o(function(){A?.unsubscribe(),A=null,d&&(Y(),O&&n.complete())},"endThrottling"),I=o(function(){A=null,O&&n.complete()},"cleanupThrottling"),B=o(function(P){return A=sn(r(P)).subscribe(Ur(n,R,I))},"startThrottle"),Y=o(function(){if(y){y=!1;var P=w;w=null,n.next(P),!O&&B(P)}},"send");t.subscribe(Ur(n,function(P){y=!0,w=P,!(A&&!A.closed)&&(f?Y():B(P))},function(){O=!0,!(d&&y&&A&&!A.closed)&&n.complete()}))})}o(vv,"throttle");var g9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(g9||(g9={}));var Fl;(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"})(Fl||(Fl={}));var xv;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(xv||(xv={}));var xs=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,yv.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Bt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Bt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===xv.ANCHOR).map(({cid:e})=>Bt.make(this.id,e))}get state(){return(0,yv.default)(this.state$.value)}async sync(e={}){e={sync:_r.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(xs,"Stream");function nu(){return r=>{}}o(nu,"StreamStatic");var _9=Ft(y9(),1);function x9(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):(bv(...r.map(t=>Ll(t,"abort"))).pipe(gv()).subscribe(()=>{e.abort()}),e.signal)}o(x9,"mergeAbortSignals");var $l=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=Ul(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}};o($l,"TimedAbortSignal");async function w9(r,e){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(w9,"abortable");var Yq=60*1e3*3;async function Vr(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let t=e.timeout||Yq,n=new $l(t),i=e.signal?x9([e.signal,n.signal]):n.signal,s=await w9(i,f=>(0,_9.default)(String(r),{...e,signal:f})).finally(()=>n.clear());if(!s.ok){let f=await s.text();throw new Error(`HTTP request to '${r}' failed with status '${s.statusText}': ${f}`)}return s.json()}o(Vr,"fetchJson");var ql=Ft(Vc(),1);ji();function ws(r){let e=Ye.asCID(r);if(e)return e;if(typeof r=="string")return Ye.parse(r);if(r instanceof Uint8Array)return Ye.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(ws,"toCID");var E9=0,Qt=class{static streamIdFromState(e){return new it(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,ql.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Rt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Rt(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(e)&&(t.link=t.link.toString()),Qt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=Rt(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,ql.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=ws(t.jws.link),t.linkedBlock=$t(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=$t(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(t)&&(t.link=ws(t.link)),Qt.isAnchorCommit(t)&&(t.proof=ws(t.proof)),t.id&&(t.id=ws(t.id)),t.prev&&(t.prev=ws(t.prev)),t.header?.model&&(t.header.model=$t(t.header.model,"base64")),t)}static serializeState(e){let t=(0,ql.default)(e);return t.log=t.log.map(n=>({...n,cid:n.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Fl[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=E9&&(t.metadata.unique=Rt(t.metadata.unique,"base64")),t.doctype=In.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,ql.default)(e);return t.doctype&&(t.type=In.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(n=>({...n,cid:ws(n.cid)})),t.anchorProof&&(t.anchorProof.txHash=ws(t.anchorProof.txHash),t.anchorProof.root=ws(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Fl[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=it.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=it.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=E9&&(t.metadata.unique=$t(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Qt.serializeState(e))===JSON.stringify(Qt.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.log.length===t.log.length&&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 async convertCommitToSignedCommitContainer(e,t){if(Qt.isSignedCommit(e)){let n=await 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(Qt,"StreamUtils");var jl=class extends dv{next(e){let t=this.value;Qt.statesEqual(t,e)||super.next(e)}};o(jl,"StreamStateSubject");var Zq=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Qn,wv={anchor:!0,publish:!0,pin:!0,sync:_r.PREFER_CACHE},Xq={sync:_r.PREFER_CACHE},A9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function _v(r,e){if(typeof r?.schema=="string")try{Bt.fromString(r.schema)}catch{throw new Error("Schema must be a CommitID")}let t={controllers:r?.controllers,family:r?.family,schema:r?.schema?.toString(),tags:r?.tags};if(e)r?.deterministic||(t.unique=Rt((0,T9.randomBytes)(12),"base64")),r?.forbidControllerChange&&(t.forbidControllerChange=!0);else{if(r?.deterministic!==void 0||r?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(r?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(n=>t[n]===void 0&&delete t[n]),t}o(_v,"headerFromMetadata");async function S9(r){if(!r.did)throw new Error("No DID provided");return r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`)),r.did}o(S9,"getAuthenticatedDID");async function Ev(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Ev,"throwReadOnlyError");var ei=Qn=o(class extends xs{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,M9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async create(e,t,n,i={}){i={...wv,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let s=i.asDID?{did:i.asDID}:e,f=await Qn.makeGenesis(s,t,n);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,f,i)}static async createFromGenesis(e,t,n={}){n={...wv,...n},t.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=t.data?await Qn._signDagJWS(e,t):t;return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async deterministic(e,t,n={}){if(n={...wv,...n},t={...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 i=await Qn.makeGenesis(e,null,t);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async load(e,t,n={}){n={...Xq,...n};let i=dn.from(t);if(i.type!=Qn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Qn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,t,n={}){n={...A9,...n};let i=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(i,e,t),f=await this.api.applyCommit(this.id,s,n);this.state$.next(f.state)}async patch(e,t={}){t={...A9,...t};let i={header:_v(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},s=await Qn._signDagJWS(this.api,i),f=await this.api.applyCommit(this.id,s,t);this.state$.next(f.state)}makeReadOnly(){this.update=Ev,this.patch=Ev,this.sync=Ev,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,t,n){let i=await this._makeRawCommit(t,n);return Qn._signDagJWS(e,i)}async _makeRawCommit(e,t){t||(t={});let n=_v(t,!1);if(e==null&&(e=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let i=U0.compare(this.content,e),s=this.state.log[0];return{header:n,data:i,prev:this.tip,id:s.cid}}static async makeGenesis(e,t,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let f=await S9(e);n.controllers=[f.hasParent?f.parent:f.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=_v(n,!0);if(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 rf(f),f}let s={data:t,header:i};return Qn._signDagJWS(e,s)}static async _signDagJWS(e,t){return(await S9(e)).createDagJWS(t)}},"TileDocument");ei.STREAM_TYPE_NAME="tile";ei.STREAM_TYPE_ID=0;ei=Qn=Zq([nu()],ei);var N9=Ft(I9(),1);function fj(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(fj,"_checkPrivateRedeclaration");function cj(r,e){return e.get?e.get.call(r):e.value}o(cj,"_classApplyDescriptorGet");function uj(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(uj,"_classApplyDescriptorSet");function O9(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(O9,"_classExtractFieldDescriptor");function Tv(r,e){var t=O9(r,e,"get");return cj(r,t)}o(Tv,"_classPrivateFieldGet");function D9(r,e,t){fj(r,e),e.set(r,t)}o(D9,"_classPrivateFieldInit");function R9(r,e,t){var n=O9(r,e,"set");return uj(r,n,t),t}o(R9,"_classPrivateFieldSet");function lj(r){return typeof r=="string"||Bt.isInstance(r)||it.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(lj,"keyToQuery");function Cv(r){return typeof r=="string"?dn.from(r).toString():Bt.isInstance(r)||it.isInstance(r)?r.toString():r.streamId.toString()}o(Cv,"keyToString");async function hj(r){let e=await ei.makeGenesis({},null,{...r,deterministic:!0}),t=await it.fromGenesis("tile",e);return{genesis:e,streamId:t}}o(hj,"getDeterministicQuery");var dj=o(()=>Promise.resolve([]),"tempBatchLoadFn"),xp=new WeakMap,kv=new WeakMap,Hl=class extends N9.default{cache(e){if(!Tv(this,kv))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,n){let i=await ei.create(Tv(this,xp),e,t,n);return this.cache(i),i}async deterministic(e,t){let n=await hj(e);try{return await super.load(n)}catch{let s=await ei.createFromGenesis(Tv(this,xp),n.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,n,i){let s=Cv(e);this.clear(s);let f=await this.load({streamId:s});return await f.update(t,n,i),f}constructor(e){super(dj,{cache:!0,cacheKeyFn:Cv,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),D9(this,xp,{writable:!0,value:void 0}),D9(this,kv,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(t.map(lj),e.multiqueryTimeout);return t.map(i=>{let s=Cv(i),f=n[s];return f||new Error(`Failed to load stream: ${s}`)})},R9(this,xp,e.ceramic),R9(this,kv,!!e.cache)}};o(Hl,"TileLoader");function Iv(r){return typeof r=="string"?it.fromString(r):r}o(Iv,"typeStreamID");function P9(r,e){let t=new URL(r);for(let[n,i]of Object.entries(e))it.isInstance(i)?t.searchParams.set(n,i.toString()):typeof i=="object"?t.searchParams.set(n,JSON.stringify(i)):t.searchParams.set(n,i);return t}o(P9,"serializeObjectToSearchParams");function Dv(r){let e={};for(let[t,n]of Object.entries(r))it.isInstance(n)?e[t]=n.toString():e[t]=n;return e}o(Dv,"serializeObjectForHttpPost");var an=class extends Yt{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=Ul(0,n).pipe(vv(()=>this._syncState(this.id,{sync:_r.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new jl(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let n=await an._load(e,this._apiUrl,t);this.state$.next(Qt.deserializeState(n))}get id(){return new it(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,n,i,s){let f=new URL("./streams",e),{state:u}=await Vr(f,{method:"post",body:{type:t,genesis:Qt.serializeCommit(n),opts:i}});return new an(Qt.deserializeState(u),e,s)}static async applyCommit(e,t,n,i,s){let f=new URL("./commits",e),{state:u}=await Vr(f,{method:"post",body:{streamId:t.toString(),commit:Qt.serializeCommit(n),opts:i}});return new an(Qt.deserializeState(u),e,s)}static async _load(e,t,n){let i=P9(new URL(`./streams/${e}`,t),n),{state:s}=await Vr(i);return s}static async load(e,t,n,i){let s=await an._load(e,t,i);return new an(Qt.deserializeState(s),t,n)}static async loadStreamCommits(e,t){let n=new URL(`./commits/${e}`,t),{commits:i}=await Vr(n);return i.map(s=>({cid:s.cid,value:Qt.deserializeCommit(s.value)}))}complete(){this.state$.complete()}};o(an,"Document");var Ef;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC",r[r.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(Ef||(Ef={}));var Rv=Ft(Vc(),1);var B9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(B9||(B9={}));var Ov;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(Ov||(Ov={}));var zl=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,Rv.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Bt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Bt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Ov.ANCHOR).map(({cid:e})=>Bt.make(this.id,e))}get state(){return(0,Rv.default)(this.state$.value)}async sync(e={}){e={sync:Ef.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(zl,"Stream");function L9(){return r=>{}}o(L9,"StreamStatic");function U9(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new na({address:e,chainId:t})}return new na(r)}o(U9,"normalizeAccountId");var pj="(?:%[0-9a-fA-F]{2})",F9=`(?:[a-zA-Z0-9._-]|${pj})`,mj="([a-z0-9]+)",bj=`((?:${F9}*:)*(${F9}+))`,$9="[a-zA-Z0-9_.:%-]",gj=`;${$9}+=${$9}*`,vj=`((${gj})*)`,yj="(/[^#?]*)?",xj="([?][^#]*)?",wj="(#.*)?",_j=new RegExp(`^did:${mj}:${bj}${vj}${yj}${xj}${wj}$`);function q9(r){if(r===""||!r)return null;let e=r.match(_j);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(q9,"parse");var H9=Ft(Vc(),1);var Ej=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Af,Nv=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),j9={anchor:!1,publish:!0,sync:Ef.PREFER_CACHE},Pv={anchor:!0,publish:!0},Aj={sync:Ef.PREFER_CACHE},Sf=Af=o(class extends zl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,H9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async fromAccount(e,t,n={}){n={...j9,...n};let i=U9(t),s=Af.makeGenesis(i);return Af.fromGenesis(e,s,n)}static async fromGenesis(e,t,n={}){return n={...j9,...n},e.createStreamFromGenesis(Af.STREAM_TYPE_ID,t,n)}async setDid(e,t,n={}){n={...Pv,...n};let i=typeof e=="string"?e.trim():e.id;if(q9(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let f=await t.createLink(i);return this.setDidProof(f,n)}async setDidProof(e,t={}){t={...Pv,...t};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,t);this.state$.next(i.state)}async clearDid(e,t={}){t={...Pv,...t};let n=await e.createLink("");return this.setDidProof(n,t)}static async load(e,t,n={}){n={...Aj,...n};let i=dn.from(t);if(i.type!=Af.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Af.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,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=Nv,this.setDid=Nv,this.sync=Nv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Sf.STREAM_TYPE_NAME="caip10-link";Sf.STREAM_TYPE_ID=1;Sf=Af=Ej([L9()],Sf);ji();Fa();var SA=Ft(EA(),1);var gH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ro,vH={sync:_r.PREFER_CACHE};async function AA(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(AA,"_ensureAuthenticated");async function yH(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(yH,"throwReadOnlyError");var ha=Ro=o(class extends xs{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Ro.MODEL}}static async create(e,t,n){Ro.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:_r.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Ro._makeGenesis(e,t,n);return await e.createStreamFromGenesis(Ro.STREAM_TYPE_ID,s,i)}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 async load(e,t,n={}){n={...vH,...n};let i=dn.from(t);if(i.type!=Ro.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ro.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return Ro._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await AA(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],model:Ro.MODEL.bytes};return{data:t,header:i}}makeReadOnly(){this.sync=yH,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,t){return await AA(e),e.did.createDagJWS(t)}},"Model");ha.STREAM_TYPE_NAME="model";ha.STREAM_TYPE_ID=2;ha.MODEL=function(){let r=rf("model-v1"),e=SA.default.encode(r,"identity"),t=ts(Mc,e),n=Ye.createV1(Mc,t);return new it("UNLOADABLE",n)}();ha=Ro=gH([nu()],ha);var CA=Ft(Ga(),1);var xH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},no,wH={anchor:!0,publish:!0,pin:!0,sync:_r.NEVER_SYNC,syncTimeoutSeconds:0},_H={anchor:!1,publish:!1,pin:!0,sync:_r.PREFER_CACHE},EH={sync:_r.PREFER_CACHE},MA={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function TA(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(TA,"_ensureAuthenticated");async function Uv(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Uv,"throwReadOnlyError");var Tf=no=o(class extends xs{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 async create(e,t,n,i={}){i={...wH,...i};let s=i.asDID?{did:i.asDID}:e,f=await no._makeGenesis(s,t,n);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,f,i)}static async single(e,t,n={}){n={..._H,...n};let i=n.asDID?{did:n.asDID}:e;t={...t,deterministic:!0};let s=await no._makeGenesis(i,null,t);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,s,n)}static async load(e,t,n={}){n={...EH,...n};let i=dn.from(t);if(i.type!=no.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${no.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,t={}){t={...MA,...t};let n=t.asDID?{did:t.asDID}:this.api,i=await this._makeCommit(n,e),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}async patch(e,t={}){t={...MA,...t};let n={data:e,prev:this.tip,id:this.id.cid},i=await no._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}makeReadOnly(){this.replace=Uv,this.patch=Uv,this.sync=Uv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return no._signDagJWS(e,n)}_makeRawCommit(e){return{data:U0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return n.deterministic?(rf(i),i):no._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let i=n.controller;if(!i)if(e.did)await TA(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let s={controllers:[i],model:n.model.bytes};return n.deterministic||(s.unique=(0,CA.randomBytes)(12)),{data:t,header:s}}static async _signDagJWS(e,t){return await TA(e),e.did.createDagJWS(t)}},"ModelInstanceDocument");Tf.STREAM_TYPE_NAME="MID";Tf.STREAM_TYPE_ID=3;Tf=no=xH([nu()],Tf);var Gl=class{constructor(e){this._apiUrl=e}async add(e,t){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await Vr(i,{method:"post",body:n})}async rm(e,t){let n=new URL(`./pins/${e}`,this._apiUrl);await Vr(n,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await Vr(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(Gl,"RemotePinApi");var Wl=class{constructor(e){this._fetchJson=Vr,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:Dv(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:Dv(e)});return{edges:t.edges.map(i=>({cursor:i.cursor,node:Qt.deserializeState(i.node)})),pageInfo:t.pageInfo}}};o(Wl,"RemoteIndexApi");var Jl=class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=Vr,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,n){let i=n?{models:n.map(f=>f.toString())}:void 0,s=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${s.signatures[0].protected}.${s.payload}.${s.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(n=>it.fromString(n))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}};o(Jl,"RemoteAdminApi");var AH="/api/v0/",SH="http://localhost:7007",MH={syncInterval:5e3},TH={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},CH={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},kA={sync:_r.PREFER_CACHE},Yl=class{constructor(e=SH,t={}){this._config={...MH,...t},this._apiUrl=new URL(AH,e),this._streamCache=new Map,this.context={api:this},this.pin=new Gl(this._apiUrl),this.index=new Wl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Jl(this._apiUrl,n),this._streamConstructors={[Sf.STREAM_TYPE_ID]:Sf,[ha.STREAM_TYPE_ID]:ha,[Tf.STREAM_TYPE_ID]:Tf,[ei.STREAM_TYPE_ID]:ei}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,n={}){n={...CH,...n};let i=await an.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),s=this._streamCache.get(i.id.toString());return s?(Qt.statesEqual(i.state,s.state)||s.next(i.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,t={}){t={...kA,...t};let n=dn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,t):(i=await an.load(n,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,t){let n=e.map(f=>({...f,streamId:typeof f.streamId=="string"?f.streamId:f.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=await Vr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((f,u)=>{let[d,y]=u,w=Qt.deserializeState(y),A=new an(w,this._apiUrl,this._config.syncInterval);return f[d]=this.buildStreamFromDocument(A),f},{})}loadStreamCommits(e){let t=Iv(e);return an.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,n={}){n={...TH,...n};let i=Iv(e),s=await an.applyCommit(this._apiUrl,i,t,n,this._config.syncInterval),f=this._streamCache.get(i.toString());return f?(f.next(s.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.toString(),s),this.buildStreamFromDocument(s))}async requestAnchor(e,t={}){t={...kA,...t};let{anchorStatus:n}=await Vr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new an(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)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await Vr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Yl,"CeramicClient");var Lt;(function(r){r.assertEqual=i=>i;function e(i){}o(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}o(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let s={};for(let f of i)s[f]=f;return s},r.getValidEnumValues=i=>{let s=r.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),f={};for(let u of s)f[u]=i[u];return r.objectValues(f)},r.objectValues=i=>r.objectKeys(i).map(function(s){return i[s]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let f in i)Object.prototype.hasOwnProperty.call(i,f)&&s.push(f);return s},r.find=(i,s)=>{for(let f of i)if(s(f))return f},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(f=>typeof f=="string"?`'${f}'`:f).join(s)}o(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Lt||(Lt={}));var $v;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})($v||($v={}));var je=Lt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),da=o(r=>{switch(typeof r){case"undefined":return je.undefined;case"string":return je.string;case"number":return isNaN(r)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(r)?je.array:r===null?je.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?je.promise:typeof Map<"u"&&r instanceof Map?je.map:typeof Set<"u"&&r instanceof Set?je.set:typeof Date<"u"&&r instanceof Date?je.date:je.object;default:return je.unknown}},"getParsedType"),Oe=Lt.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","not_finite"]),kH=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),fn=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 f of s.issues)if(f.code==="invalid_union")f.unionErrors.map(i);else if(f.code==="invalid_return_type")i(f.returnTypeError);else if(f.code==="invalid_arguments")i(f.argumentsError);else if(f.path.length===0)n._errors.push(t(f));else{let u=n,d=0;for(;d<f.path.length;){let y=f.path[d];d===f.path.length-1?(u[y]=u[y]||{_errors:[]},u[y]._errors.push(t(f))):u[y]=u[y]||{_errors:[]},u=u[y],d++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof fn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Lt.jsonStringifyReplacer,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(fn,"ZodError");fn.create=r=>new fn(r);var lu=o((r,e)=>{let t;switch(r.code){case Oe.invalid_type:r.received===je.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Lt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${Lt.joinValues(r.keys,", ")}`;break;case Oe.invalid_union:t="Invalid input";break;case Oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Lt.joinValues(r.options)}`;break;case Oe.invalid_enum_value:t=`Invalid enum value. Expected ${Lt.joinValues(r.options)}, received '${r.received}'`;break;case Oe.invalid_arguments:t="Invalid function arguments";break;case Oe.invalid_return_type:t="Invalid function return type";break;case Oe.invalid_date:t="Invalid date";break;case Oe.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:Lt.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Oe.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case Oe.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case Oe.custom:t="Invalid input";break;case Oe.invalid_intersection_types:t="Intersection results could not be merged";break;case Oe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,Lt.assertNever(r)}return{message:t}},"errorMap"),RA=lu;function IH(r){RA=r}o(IH,"setErrorMap");function Sp(){return RA}o(Sp,"getErrorMap");var Mp=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],f={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let u="",d=n.filter(y=>!!y).slice().reverse();for(let y of d)u=y(f,{data:e,defaultError:u}).message;return{...i,path:s,message:u}},"makeIssue"),DH=[];function $e(r,e){let t=Sp(),n=Mp({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===lu?void 0:lu].filter(i=>!!i)});r.common.issues.push(n)}o($e,"addIssueToContext");var Tr=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 gt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let s=await i.key,f=await i.value;n.push({key:s,value:f})}return Tr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:f}=i;if(s.status==="aborted"||f.status==="aborted")return gt;s.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof f.value<"u"||i.alwaysSet)&&(n[s.value]=f.value)}return{status:e.value,value:n}}};o(Tr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),cu=o(r=>({status:"dirty",value:r}),"DIRTY"),pn=o(r=>({status:"valid",value:r}),"OK"),qv=o(r=>r.status==="aborted","isAborted"),jv=o(r=>r.status==="dirty","isDirty"),Ql=o(r=>r.status==="valid","isValid"),eh=o(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Tp(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)}o(Tp,"__classPrivateFieldGet");function OA(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}o(OA,"__classPrivateFieldSet");var Ge;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(Ge||(Ge={}));var Zl,Xl,ti=class{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(ti,"ParseInputLazyPath");var IA=o((r,e)=>{if(Ql(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new fn(r.common.issues);return this._error=t,this._error}}},"handleResult");function At(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_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((f,u)=>{var d,y;let{message:w}=r;return f.code==="invalid_enum_value"?{message:w??u.defaultError}:typeof u.data>"u"?{message:(d=w??n)!==null&&d!==void 0?d:u.defaultError}:f.code!=="invalid_type"?{message:u.defaultError}:{message:(y=w??t)!==null&&y!==void 0?y:u.defaultError}},"customMap"),description:i}}o(At,"processCreateParams");var _t=class{constructor(e){this.spa=this.safeParseAsync,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.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return da(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:da(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tr,ctx:{common:e.parent.common,data:e.data,parsedType:da(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(eh(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?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:da(e)},s=this._parseSync({data:e,path:i.path,parent:i});return IA(i,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:da(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(eh(i)?i:Promise.resolve(i));return IA(n,s)}refine(e,t){let n=o(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let f=e(i),u=o(()=>s.addIssue({code:Oe.custom,...n(i)}),"setError");return typeof Promise<"u"&&f instanceof Promise?f.then(d=>d?!0:(u(),!1)):f?!0:(u(),!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 Nn({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ni.create(this,this._def)}nullable(){return ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return On.create(this,this._def)}promise(){return Ms.create(this,this._def)}or(e){return ga.create([this,e],this._def)}and(e){return va.create(this,e,this._def)}transform(e){return new Nn({...At(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ea({...At(this._def),innerType:this,defaultValue:t,typeName:ot.ZodDefault})}brand(){return new uu({typeName:ot.ZodBranded,type:this,...At(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Aa({...At(this._def),innerType:this,catchValue:t,typeName:ot.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Sa.create(this,e)}readonly(){return Ma.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(_t,"ZodType");var RH=/^c[^\s-]{8,}$/i,OH=/^[0-9a-z]+$/,NH=/^[0-9A-HJKMNP-TV-Z]{26}$/,PH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,BH=/^[a-z0-9_-]{21}$/i,LH=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,UH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Fv,$H=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qH=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,jH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HH=new RegExp(`^${NA}$`);function PA(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}o(PA,"timeRegexSource");function zH(r){return new RegExp(`^${PA(r)}$`)}o(zH,"timeRegex");function BA(r){let e=`${NA}T${PA(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}o(BA,"datetimeRegex");function KH(r,e){return!!((e==="v4"||!e)&&$H.test(r)||(e==="v6"||!e)&&qH.test(r))}o(KH,"isValidIP");var Rn=class extends _t{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.string,received:s.parsedType}),gt}let n=new Tr,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let f=e.data.length>s.value,u=e.data.length<s.value;(f||u)&&(i=this._getOrReturnCtx(e,i),f?$e(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&$e(i,{code:Oe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")UH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"email",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Fv||(Fv=new RegExp(FH,"u")),Fv.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"emoji",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")PH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"uuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")BH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"nanoid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")RH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")OH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid2",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")NH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ulid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),$e(i,{validation:"url",code:Oe.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),$e(i,{validation:"regex",code:Oe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?BA(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?HH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?zH(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?LH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"duration",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?KH(e.data,s.version)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ip",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?jH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"base64",code:Oe.invalid_string,message:s.message}),n.dirty()):Lt.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:Oe.invalid_string,...Ge.errToObj(n)})}_addCheck(e){return new Rn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Ge.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Ge.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ge.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ge.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ge.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ge.errToObj(t)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new Rn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};o(Rn,"ZodString");Rn.create=r=>{var e;return new Rn({checks:[],typeName:ot.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...At(r)})};function VH(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(".","")),f=parseInt(e.toFixed(i).replace(".",""));return s%f/Math.pow(10,i)}o(VH,"floatSafeRemainder");var io=class extends _t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==je.number){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.number,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="int"?Lt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.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),$e(n,{code:Oe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?VH(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_finite,message:s.message}),i.dirty()):Lt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new io({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new io({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(e)})}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"||e.kind==="multipleOf"&&Lt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};o(io,"ZodNumber");io.create=r=>new io({checks:[],typeName:ot.ZodNumber,coerce:r?.coerce||!1,...At(r)});var oo=class extends _t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==je.bigint){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.bigint,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_small,type:"bigint",minimum:s.value,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),$e(n,{code:Oe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Lt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new oo({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new oo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.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}};o(oo,"ZodBigInt");oo.create=r=>{var e;return new oo({checks:[],typeName:ot.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...At(r)})};var pa=class extends _t{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==je.boolean){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.boolean,received:n.parsedType}),gt}return pn(e.data)}};o(pa,"ZodBoolean");pa.create=r=>new pa({typeName:ot.ZodBoolean,coerce:r?.coerce||!1,...At(r)});var Oo=class extends _t{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.date,received:s.parsedType}),gt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_date}),gt}let n=new Tr,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Lt.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Oo({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};o(Oo,"ZodDate");Oo.create=r=>new Oo({checks:[],coerce:r?.coerce||!1,typeName:ot.ZodDate,...At(r)});var Cf=class extends _t{_parse(e){if(this._getType(e)!==je.symbol){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.symbol,received:n.parsedType}),gt}return pn(e.data)}};o(Cf,"ZodSymbol");Cf.create=r=>new Cf({typeName:ot.ZodSymbol,...At(r)});var ma=class extends _t{_parse(e){if(this._getType(e)!==je.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.undefined,received:n.parsedType}),gt}return pn(e.data)}};o(ma,"ZodUndefined");ma.create=r=>new ma({typeName:ot.ZodUndefined,...At(r)});var ba=class extends _t{_parse(e){if(this._getType(e)!==je.null){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.null,received:n.parsedType}),gt}return pn(e.data)}};o(ba,"ZodNull");ba.create=r=>new ba({typeName:ot.ZodNull,...At(r)});var As=class extends _t{constructor(){super(...arguments),this._any=!0}_parse(e){return pn(e.data)}};o(As,"ZodAny");As.create=r=>new As({typeName:ot.ZodAny,...At(r)});var No=class extends _t{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pn(e.data)}};o(No,"ZodUnknown");No.create=r=>new No({typeName:ot.ZodUnknown,...At(r)});var Ni=class extends _t{_parse(e){let t=this._getOrReturnCtx(e);return $e(t,{code:Oe.invalid_type,expected:je.never,received:t.parsedType}),gt}};o(Ni,"ZodNever");Ni.create=r=>new Ni({typeName:ot.ZodNever,...At(r)});var kf=class extends _t{_parse(e){if(this._getType(e)!==je.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.void,received:n.parsedType}),gt}return pn(e.data)}};o(kf,"ZodVoid");kf.create=r=>new kf({typeName:ot.ZodVoid,...At(r)});var On=class extends _t{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==je.array)return $e(t,{code:Oe.invalid_type,expected:je.array,received:t.parsedType}),gt;if(i.exactLength!==null){let f=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(f||u)&&($e(t,{code:f?Oe.too_big:Oe.too_small,minimum:u?i.exactLength.value:void 0,maximum:f?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&($e(t,{code:Oe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&($e(t,{code:Oe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((f,u)=>i.type._parseAsync(new ti(t,f,t.path,u)))).then(f=>Tr.mergeArray(n,f));let s=[...t.data].map((f,u)=>i.type._parseSync(new ti(t,f,t.path,u)));return Tr.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new On({...this._def,minLength:{value:e,message:Ge.toString(t)}})}max(e,t){return new On({...this._def,maxLength:{value:e,message:Ge.toString(t)}})}length(e,t){return new On({...this._def,exactLength:{value:e,message:Ge.toString(t)}})}nonempty(e){return this.min(1,e)}};o(On,"ZodArray");On.create=(r,e)=>new On({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...At(e)});function fu(r){if(r instanceof sr){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=ni.create(fu(n))}return new sr({...r._def,shape:()=>e})}else return r instanceof On?new On({...r._def,type:fu(r.element)}):r instanceof ni?ni.create(fu(r.unwrap())):r instanceof ao?ao.create(fu(r.unwrap())):r instanceof ri?ri.create(r.items.map(e=>fu(e))):r}o(fu,"deepPartialify");var sr=class extends _t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Lt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==je.object){let y=this._getOrReturnCtx(e);return $e(y,{code:Oe.invalid_type,expected:je.object,received:y.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:f}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ni&&this._def.unknownKeys==="strip"))for(let y in i.data)f.includes(y)||u.push(y);let d=[];for(let y of f){let w=s[y],A=i.data[y];d.push({key:{status:"valid",value:y},value:w._parse(new ti(i,A,i.path,y)),alwaysSet:y in i.data})}if(this._def.catchall instanceof Ni){let y=this._def.unknownKeys;if(y==="passthrough")for(let w of u)d.push({key:{status:"valid",value:w},value:{status:"valid",value:i.data[w]}});else if(y==="strict")u.length>0&&($e(i,{code:Oe.unrecognized_keys,keys:u}),n.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let y=this._def.catchall;for(let w of u){let A=i.data[w];d.push({key:{status:"valid",value:w},value:y._parse(new ti(i,A,i.path,w)),alwaysSet:w in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let y=[];for(let w of d){let A=await w.key,O=await w.value;y.push({key:A,value:O,alwaysSet:w.alwaysSet})}return y}).then(y=>Tr.mergeObjectSync(n,y)):Tr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new sr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,s,f,u;let d=(f=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&f!==void 0?f:n.defaultError;return t.code==="unrecognized_keys"?{message:(u=Ge.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(e){return new sr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new sr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new sr({...this._def,catchall:e})}pick(e){let t={};return Lt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}omit(e){let t={};return Lt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}deepPartial(){return fu(this)}partial(e){let t={};return Lt.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new sr({...this._def,shape:()=>t})}required(e){let t={};return Lt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ni;)s=s._def.innerType;t[n]=s}}),new sr({...this._def,shape:()=>t})}keyof(){return LA(Lt.objectKeys(this.shape))}};o(sr,"ZodObject");sr.create=(r,e)=>new sr({shape:()=>r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...At(e)});sr.strictCreate=(r,e)=>new sr({shape:()=>r,unknownKeys:"strict",catchall:Ni.create(),typeName:ot.ZodObject,...At(e)});sr.lazycreate=(r,e)=>new sr({shape:r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...At(e)});var ga=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let u of s)if(u.result.status==="valid")return u.result;for(let u of s)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;let f=s.map(u=>new fn(u.ctx.common.issues));return $e(t,{code:Oe.invalid_union,unionErrors:f}),gt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(async s=>{let f={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:f}),ctx:f}})).then(i);{let s,f=[];for(let d of n){let y={...t,common:{...t.common,issues:[]},parent:null},w=d._parseSync({data:t.data,path:t.path,parent:y});if(w.status==="valid")return w;w.status==="dirty"&&!s&&(s={result:w,ctx:y}),y.common.issues.length&&f.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let u=f.map(d=>new fn(d));return $e(t,{code:Oe.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ga,"ZodUnion");ga.create=(r,e)=>new ga({options:r,typeName:ot.ZodUnion,...At(e)});var Es=o(r=>r instanceof xa?Es(r.schema):r instanceof Nn?Es(r.innerType()):r instanceof wa?[r.value]:r instanceof so?r.options:r instanceof _a?Lt.objectValues(r.enum):r instanceof Ea?Es(r._def.innerType):r instanceof ma?[void 0]:r instanceof ba?[null]:r instanceof ni?[void 0,...Es(r.unwrap())]:r instanceof ao?[null,...Es(r.unwrap())]:r instanceof uu||r instanceof Ma?Es(r.unwrap()):r instanceof Aa?Es(r._def.innerType):[],"getDiscriminator"),If=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==je.object)return $e(t,{code:Oe.invalid_type,expected:je.object,received:t.parsedType}),gt;let n=this.discriminator,i=t.data[n],s=this.optionsMap.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}):($e(t,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let s of t){let f=Es(s.shape[e]);if(!f.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of f){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,s)}}return new If({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...At(n)})}};o(If,"ZodDiscriminatedUnion");function Hv(r,e){let t=da(r),n=da(e);if(r===e)return{valid:!0,data:r};if(t===je.object&&n===je.object){let i=Lt.objectKeys(e),s=Lt.objectKeys(r).filter(u=>i.indexOf(u)!==-1),f={...r,...e};for(let u of s){let d=Hv(r[u],e[u]);if(!d.valid)return{valid:!1};f[u]=d.data}return{valid:!0,data:f}}else if(t===je.array&&n===je.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let f=r[s],u=e[s],d=Hv(f,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===je.date&&n===je.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(Hv,"mergeValues");var va=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,f)=>{if(qv(s)||qv(f))return gt;let u=Hv(s.value,f.value);return u.valid?((jv(s)||jv(f))&&t.dirty(),{status:t.value,value:u.data}):($e(n,{code:Oe.invalid_intersection_types}),gt)},"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,f])=>i(s,f)):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(va,"ZodIntersection");va.create=(r,e,t)=>new va({left:r,right:e,typeName:ot.ZodIntersection,...At(t)});var ri=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==je.array)return $e(n,{code:Oe.invalid_type,expected:je.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return $e(n,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&($e(n,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...n.data].map((f,u)=>{let d=this._def.items[u]||this._def.rest;return d?d._parse(new ti(n,f,n.path,u)):null}).filter(f=>!!f);return n.common.async?Promise.all(s).then(f=>Tr.mergeArray(t,f)):Tr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ri({...this._def,rest:e})}};o(ri,"ZodTuple");ri.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ri({items:r,typeName:ot.ZodTuple,rest:null,...At(e)})};var ya=class extends _t{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!==je.object)return $e(n,{code:Oe.invalid_type,expected:je.object,received:n.parsedType}),gt;let i=[],s=this._def.keyType,f=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new ti(n,u,n.path,u)),value:f._parse(new ti(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?Tr.mergeObjectAsync(t,i):Tr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _t?new ya({keyType:e,valueType:t,typeName:ot.ZodRecord,...At(n)}):new ya({keyType:Rn.create(),valueType:e,typeName:ot.ZodRecord,...At(t)})}};o(ya,"ZodRecord");var Df=class extends _t{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!==je.map)return $e(n,{code:Oe.invalid_type,expected:je.map,received:n.parsedType}),gt;let i=this._def.keyType,s=this._def.valueType,f=[...n.data.entries()].map(([u,d],y)=>({key:i._parse(new ti(n,u,n.path,[y,"key"])),value:s._parse(new ti(n,d,n.path,[y,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of f){let y=await d.key,w=await d.value;if(y.status==="aborted"||w.status==="aborted")return gt;(y.status==="dirty"||w.status==="dirty")&&t.dirty(),u.set(y.value,w.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let d of f){let y=d.key,w=d.value;if(y.status==="aborted"||w.status==="aborted")return gt;(y.status==="dirty"||w.status==="dirty")&&t.dirty(),u.set(y.value,w.value)}return{status:t.value,value:u}}}};o(Df,"ZodMap");Df.create=(r,e,t)=>new Df({valueType:e,keyType:r,typeName:ot.ZodMap,...At(t)});var Po=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==je.set)return $e(n,{code:Oe.invalid_type,expected:je.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&($e(n,{code:Oe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&($e(n,{code:Oe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function f(d){let y=new Set;for(let w of d){if(w.status==="aborted")return gt;w.status==="dirty"&&t.dirty(),y.add(w.value)}return{status:t.value,value:y}}o(f,"finalizeSet");let u=[...n.data.values()].map((d,y)=>s._parse(new ti(n,d,n.path,y)));return n.common.async?Promise.all(u).then(d=>f(d)):f(u)}min(e,t){return new Po({...this._def,minSize:{value:e,message:Ge.toString(t)}})}max(e,t){return new Po({...this._def,maxSize:{value:e,message:Ge.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Po,"ZodSet");Po.create=(r,e)=>new Po({valueType:r,minSize:null,maxSize:null,typeName:ot.ZodSet,...At(e)});var Ss=class extends _t{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==je.function)return $e(t,{code:Oe.invalid_type,expected:je.function,received:t.parsedType}),gt;function n(u,d){return Mp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sp(),lu].filter(y=>!!y),issueData:{code:Oe.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return Mp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sp(),lu].filter(y=>!!y),issueData:{code:Oe.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},f=t.data;if(this._def.returns instanceof Ms){let u=this;return pn(async function(...d){let y=new fn([]),w=await u._def.args.parseAsync(d,s).catch(R=>{throw y.addIssue(n(d,R)),y}),A=await Reflect.apply(f,this,w);return await u._def.returns._def.type.parseAsync(A,s).catch(R=>{throw y.addIssue(i(A,R)),y})})}else{let u=this;return pn(function(...d){let y=u._def.args.safeParse(d,s);if(!y.success)throw new fn([n(d,y.error)]);let w=Reflect.apply(f,this,y.data),A=u._def.returns.safeParse(w,s);if(!A.success)throw new fn([i(w,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ss({...this._def,args:ri.create(e).rest(No.create())})}returns(e){return new Ss({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ss({args:e||ri.create([]).rest(No.create()),returns:t||No.create(),typeName:ot.ZodFunction,...At(n)})}};o(Ss,"ZodFunction");var xa=class extends _t{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(xa,"ZodLazy");xa.create=(r,e)=>new xa({getter:r,typeName:ot.ZodLazy,...At(e)});var wa=class extends _t{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return $e(t,{received:t.data,code:Oe.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(wa,"ZodLiteral");wa.create=(r,e)=>new wa({value:r,typeName:ot.ZodLiteral,...At(e)});function LA(r,e){return new so({values:r,typeName:ot.ZodEnum,...At(e)})}o(LA,"createZodEnum");var so=class extends _t{constructor(){super(...arguments),Zl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{expected:Lt.joinValues(n),received:t.parsedType,code:Oe.invalid_type}),gt}if(Tp(this,Zl,"f")||OA(this,Zl,new Set(this._def.values),"f"),!Tp(this,Zl,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{received:t.data,code:Oe.invalid_enum_value,options:n}),gt}return pn(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}extract(e,t=this._def){return so.create(e,{...this._def,...t})}exclude(e,t=this._def){return so.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};o(so,"ZodEnum");Zl=new WeakMap;so.create=LA;var _a=class extends _t{constructor(){super(...arguments),Xl.set(this,void 0)}_parse(e){let t=Lt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==je.string&&n.parsedType!==je.number){let i=Lt.objectValues(t);return $e(n,{expected:Lt.joinValues(i),received:n.parsedType,code:Oe.invalid_type}),gt}if(Tp(this,Xl,"f")||OA(this,Xl,new Set(Lt.getValidEnumValues(this._def.values)),"f"),!Tp(this,Xl,"f").has(e.data)){let i=Lt.objectValues(t);return $e(n,{received:n.data,code:Oe.invalid_enum_value,options:i}),gt}return pn(e.data)}get enum(){return this._def.values}};o(_a,"ZodNativeEnum");Xl=new WeakMap;_a.create=(r,e)=>new _a({values:r,typeName:ot.ZodNativeEnum,...At(e)});var Ms=class extends _t{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==je.promise&&t.common.async===!1)return $e(t,{code:Oe.invalid_type,expected:je.promise,received:t.parsedType}),gt;let n=t.parsedType===je.promise?t.data:Promise.resolve(t.data);return pn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(Ms,"ZodPromise");Ms.create=(r,e)=>new Ms({type:r,typeName:ot.ZodPromise,...At(e)});var Nn=class extends _t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:f=>{$e(n,f),f.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let f=i.transform(n.data,s);if(n.common.async)return Promise.resolve(f).then(async u=>{if(t.value==="aborted")return gt;let d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?gt:d.status==="dirty"||t.value==="dirty"?cu(d.value):d});{if(t.value==="aborted")return gt;let u=this._def.schema._parseSync({data:f,path:n.path,parent:n});return u.status==="aborted"?gt:u.status==="dirty"||t.value==="dirty"?cu(u.value):u}}if(i.type==="refinement"){let f=o(u=>{let d=i.refinement(u,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?gt:(u.status==="dirty"&&t.dirty(),f(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?gt:(u.status==="dirty"&&t.dirty(),f(u.value).then(()=>({status:t.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ql(f))return f;let u=i.transform(f.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>Ql(f)?Promise.resolve(i.transform(f.value,s)).then(u=>({status:t.value,value:u})):f);Lt.assertNever(i)}};o(Nn,"ZodEffects");Nn.create=(r,e,t)=>new Nn({schema:r,typeName:ot.ZodEffects,effect:e,...At(t)});Nn.createWithPreprocess=(r,e,t)=>new Nn({schema:e,effect:{type:"preprocess",transform:r},typeName:ot.ZodEffects,...At(t)});var ni=class extends _t{_parse(e){return this._getType(e)===je.undefined?pn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ni,"ZodOptional");ni.create=(r,e)=>new ni({innerType:r,typeName:ot.ZodOptional,...At(e)});var ao=class extends _t{_parse(e){return this._getType(e)===je.null?pn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ao,"ZodNullable");ao.create=(r,e)=>new ao({innerType:r,typeName:ot.ZodNullable,...At(e)});var Ea=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===je.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Ea,"ZodDefault");Ea.create=(r,e)=>new Ea({innerType:r,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...At(e)});var Aa=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return eh(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new fn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new fn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(Aa,"ZodCatch");Aa.create=(r,e)=>new Aa({innerType:r,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...At(e)});var Rf=class extends _t{_parse(e){if(this._getType(e)!==je.nan){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(Rf,"ZodNaN");Rf.create=r=>new Rf({typeName:ot.ZodNaN,...At(r)});var GH=Symbol("zod_brand"),uu=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};o(uu,"ZodBranded");var Sa=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?gt:s.status==="dirty"?(t.dirty(),cu(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?gt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new Sa({in:e,out:t,typeName:ot.ZodPipeline})}};o(Sa,"ZodPipeline");var Ma=class extends _t{_parse(e){let t=this._def.innerType._parse(e),n=o(i=>(Ql(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return eh(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};o(Ma,"ZodReadonly");Ma.create=(r,e)=>new Ma({innerType:r,typeName:ot.ZodReadonly,...At(e)});function UA(r,e={},t){return r?As.create().superRefine((n,i)=>{var s,f;if(!r(n)){let u=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(f=(s=u.fatal)!==null&&s!==void 0?s:t)!==null&&f!==void 0?f:!0,y=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...y,fatal:d})}}):As.create()}o(UA,"custom");var WH={object:sr.lazycreate},ot;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",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.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(ot||(ot={}));var JH=o((r,e={message:`Input not instance of ${r.name}`})=>UA(t=>t instanceof r,e),"instanceOfType"),FA=Rn.create,$A=io.create,YH=Rf.create,ZH=oo.create,qA=pa.create,XH=Oo.create,QH=Cf.create,ez=ma.create,tz=ba.create,rz=As.create,nz=No.create,iz=Ni.create,oz=kf.create,sz=On.create,az=sr.create,fz=sr.strictCreate,cz=ga.create,uz=If.create,lz=va.create,hz=ri.create,dz=ya.create,pz=Df.create,mz=Po.create,bz=Ss.create,gz=xa.create,vz=wa.create,yz=so.create,xz=_a.create,wz=Ms.create,DA=Nn.create,_z=ni.create,Ez=ao.create,Az=Nn.createWithPreprocess,Sz=Sa.create,Mz=o(()=>FA().optional(),"ostring"),Tz=o(()=>$A().optional(),"onumber"),Cz=o(()=>qA().optional(),"oboolean"),kz={string:r=>Rn.create({...r,coerce:!0}),number:r=>io.create({...r,coerce:!0}),boolean:r=>pa.create({...r,coerce:!0}),bigint:r=>oo.create({...r,coerce:!0}),date:r=>Oo.create({...r,coerce:!0})},Iz=gt,m=Object.freeze({__proto__:null,defaultErrorMap:lu,setErrorMap:IH,getErrorMap:Sp,makeIssue:Mp,EMPTY_PATH:DH,addIssueToContext:$e,ParseStatus:Tr,INVALID:gt,DIRTY:cu,OK:pn,isAborted:qv,isDirty:jv,isValid:Ql,isAsync:eh,get util(){return Lt},get objectUtil(){return $v},ZodParsedType:je,getParsedType:da,ZodType:_t,datetimeRegex:BA,ZodString:Rn,ZodNumber:io,ZodBigInt:oo,ZodBoolean:pa,ZodDate:Oo,ZodSymbol:Cf,ZodUndefined:ma,ZodNull:ba,ZodAny:As,ZodUnknown:No,ZodNever:Ni,ZodVoid:kf,ZodArray:On,ZodObject:sr,ZodUnion:ga,ZodDiscriminatedUnion:If,ZodIntersection:va,ZodTuple:ri,ZodRecord:ya,ZodMap:Df,ZodSet:Po,ZodFunction:Ss,ZodLazy:xa,ZodLiteral:wa,ZodEnum:so,ZodNativeEnum:_a,ZodPromise:Ms,ZodEffects:Nn,ZodTransformer:Nn,ZodOptional:ni,ZodNullable:ao,ZodDefault:Ea,ZodCatch:Aa,ZodNaN:Rf,BRAND:GH,ZodBranded:uu,ZodPipeline:Sa,ZodReadonly:Ma,custom:UA,Schema:_t,ZodSchema:_t,late:WH,get ZodFirstPartyTypeKind(){return ot},coerce:kz,any:rz,array:sz,bigint:ZH,boolean:qA,date:XH,discriminatedUnion:uz,effect:DA,enum:yz,function:bz,instanceof:JH,intersection:lz,lazy:gz,literal:vz,map:pz,nan:YH,nativeEnum:xz,never:iz,null:tz,nullable:Ez,number:$A,object:az,oboolean:Cz,onumber:Tz,optional:_z,ostring:Mz,pipeline:Sz,preprocess:Az,promise:wz,record:dz,set:mz,strictObject:fz,string:FA,symbol:QH,transformer:DA,tuple:hz,undefined:ez,union:cz,unknown:nz,void:oz,NEVER:Iz,ZodIssueCode:Oe,quotelessJson:kH,ZodError:fn});var hu=Symbol("current"),Of=Symbol("previous");var th=o((r,{ref:e,refType:t,param:n,header:i,...s}={})=>({...s,...r}),"mergeOpenApi");function rh(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(s){let{zodOpenApi:f,...u}=this._def,d=new this.constructor({...u,zodOpenApi:{openapi:th(s,f?.openapi)}});return d._def.zodOpenApi[hu]=d,f&&(d._def.zodOpenApi[Of]=this),d};let e=r.ZodType.prototype.describe;r.ZodType.prototype.describe=function(...s){let f=e.apply(this,s),u=f._def;if(u.zodOpenApi){let d={...u.zodOpenApi};d.openapi=th({description:s[0]},d.openapi),d[Of]=this,d[hu]=f,u.zodOpenApi=d}else u.zodOpenApi={openapi:{description:s[0]},[hu]:f};return f};let t=r.ZodObject.prototype.extend;r.ZodObject.prototype.extend=function(...s){let f=t.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=th({},d.openapi),d[Of]=this,f._def.zodOpenApi=d}else f._def.zodOpenApi={[Of]:this};return f};let n=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...s){let f=n.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=th({},d.openapi),delete d[Of],delete d[hu],f._def.zodOpenApi=d}return f};let i=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...s){let f=i.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=th({},d.openapi),delete d[Of],delete d[hu],f._def.zodOpenApi=d}return f}}o(rh,"extendZodWithOpenApi");rh(m);var Dz=Object.defineProperty,Rz=o((r,e)=>Dz(r,"name",{value:e,configurable:!0}),"__name"),kp=m.array(m.string().or(m.record(m.any()))),Xie=m.object({type:m.string().optional(),narrative:m.string().optional()}),Ip=m.string().or(m.object({id:m.string(),type:m.string(),caption:m.string().optional()})),Oz=m.object({type:m.string().min(1).or(m.string().array().nonempty()),latitude:m.number(),longitude:m.number()}),Nz=m.object({type:m.string().min(1).or(m.string().array().nonempty()),addressCountry:m.string().optional(),addressCountryCode:m.string().optional(),addressRegion:m.string().optional(),addressLocality:m.string().optional(),streetAddress:m.string().optional(),postOfficeBoxNumber:m.string().optional(),postalCode:m.string().optional(),geo:Oz.optional()}),Pz=m.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(m.string()),e7=m.object({type:m.string().min(1).or(m.string().array().nonempty()),identifier:m.string(),identifierType:Pz}),nh=m.string().or(m.object({id:m.string().optional(),type:m.string().or(m.string().array().nonempty().optional()),name:m.string().optional(),url:m.string().optional(),phone:m.string().optional(),description:m.string().optional(),endorsement:m.any().array().optional(),image:Ip.optional(),email:m.string().email().optional(),address:Nz.optional(),otherIdentifier:e7.array().optional(),official:m.string().optional(),parentOrg:m.any().optional(),familyName:m.string().optional(),givenName:m.string().optional(),additionalName:m.string().optional(),patronymicName:m.string().optional(),honorificPrefix:m.string().optional(),honorificSuffix:m.string().optional(),familyNamePrefix:m.string().optional(),dateOfBirth:m.string().optional()}).catchall(m.any())),Kv=m.object({id:m.string().optional()}).catchall(m.any()),Cp=m.object({type:m.string(),id:m.string()}).catchall(m.any()),jA=m.object({id:m.string(),type:m.string()}).catchall(m.any()),HA=m.object({id:m.string().optional(),type:m.string()}).catchall(m.any()),zA=m.object({type:m.string(),id:m.string().optional()}).catchall(m.any()),KA=m.object({type:m.string().or(m.string().array().nonempty()),id:m.string().optional()}).catchall(m.any()),du=m.object({"@context":kp,id:m.string().optional(),type:m.string().array().nonempty(),issuer:nh,credentialSubject:Kv.or(Kv.array()),refreshService:HA.or(HA.array()).optional(),credentialSchema:jA.or(jA.array()).optional(),issuanceDate:m.string().optional(),expirationDate:m.string().optional(),credentialStatus:Cp.or(Cp.array()).optional(),name:m.string().optional(),description:m.string().optional(),validFrom:m.string().optional(),validUntil:m.string().optional(),status:Cp.or(Cp.array()).optional(),termsOfUse:zA.or(zA.array()).optional(),evidence:KA.or(KA.array()).optional()}).catchall(m.any()),Bo=m.object({type:m.string(),created:m.string(),challenge:m.string().optional(),domain:m.string().optional(),nonce:m.string().optional(),proofPurpose:m.string(),verificationMethod:m.string(),jws:m.string().optional()}).catchall(m.any()),Pf=du.extend({proof:Bo.or(Bo.array())}),Bz=m.object({"@context":kp,id:m.string().optional(),type:m.string().or(m.string().array().nonempty()),verifiableCredential:Pf.or(Pf.array()).optional(),holder:m.string().optional()}).catchall(m.any()),oh=Bz.extend({proof:Bo.or(Bo.array())}),Wv=m.object({kty:m.string(),crv:m.string(),x:m.string(),y:m.string().optional(),n:m.string().optional(),d:m.string().optional()}),toe=Wv.omit({d:!0}).extend({d:m.string()}),Lz=m.object({alg:m.string(),iv:m.string(),tag:m.string(),epk:Wv.partial().optional(),kid:m.string().optional(),apv:m.string().optional(),apu:m.string().optional()}),Uz=m.object({header:Lz,encrypted_key:m.string()}),Fz=m.object({protected:m.string(),iv:m.string(),ciphertext:m.string(),tag:m.string(),aad:m.string().optional(),recipients:Uz.array().optional()}),Nf=m.string().or(m.object({"@context":kp.optional(),id:m.string(),type:m.string(),controller:m.string(),publicKeyJwk:Wv.optional(),publicKeyBase58:m.string().optional(),publicKeyMultibase:m.string().optional(),blockChainAccountId:m.string().optional()}).catchall(m.any())),$z=m.object({id:m.string(),type:m.string().or(m.string().array().nonempty()),serviceEndpoint:m.any().or(m.any().array().nonempty())}).catchall(m.any()),roe=m.object({"@context":kp,id:m.string(),alsoKnownAs:m.string().optional(),controller:m.string().or(m.string().array().nonempty()).optional(),verificationMethod:Nf.array().optional(),authentication:Nf.array().optional(),assertionMethod:Nf.array().optional(),keyAgreement:Nf.array().optional(),capabilityInvocation:Nf.array().optional(),capabilityDelegation:Nf.array().optional(),publicKey:Nf.array().optional(),service:$z.array().optional(),proof:Bo.or(Bo.array()).optional()}).catchall(m.any()),qz=m.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(m.string()),Dp=m.object({type:m.string().array().nonempty(),targetCode:m.string().optional(),targetDescription:m.string().optional(),targetName:m.string(),targetFramework:m.string().optional(),targetType:qz.optional(),targetUrl:m.string()}),jz=m.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"]),Hz=jz.or(m.string()),zz=m.object({id:m.string().optional(),narrative:m.string().optional()}).catchall(m.any()),Kz=m.object({id:m.string(),type:m.string().array().nonempty(),endorsementComment:m.string().optional()}),Vz=du.extend({credentialSubject:Kz,proof:Bo.or(Bo.array()).optional()}),Gz=m.object({id:m.string(),"@language":m.string().optional(),version:m.string().optional()}),Wz=m.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(m.string()),Jz=m.object({id:m.string(),type:m.string().array().nonempty(),alignment:Dp.array().optional(),description:m.string().optional(),level:m.string().optional(),name:m.string(),points:m.string().optional()}).catchall(m.any()),Yz=m.object({id:m.string(),type:m.string().array().nonempty(),alignment:Dp.array().optional(),allowedValue:m.string().array().optional(),name:m.string(),requiredLevel:m.string().optional(),requiredValue:m.string().optional(),resultType:Wz,rubricCriterionLevel:Jz.array().optional(),valueMax:m.string().optional(),valueMin:m.string().optional()}).catchall(m.any()),Zz=m.object({id:m.string().optional(),type:m.string().array().nonempty(),alignment:Dp.array().optional(),achievementType:Hz.optional(),creator:nh.optional(),creditsAvailable:m.number().optional(),criteria:zz,description:m.string(),endorsement:Vz.array().optional(),fieldOfStudy:m.string().optional(),humanCode:m.string().optional(),image:Ip.optional(),"@language":m.string().optional(),name:m.string(),otherIdentifier:e7.array().optional(),related:Gz.array().optional(),resultDescription:Yz.array().optional(),specialization:m.string().optional(),tag:m.string().array().optional(),version:m.string().optional()}).catchall(m.any()),Xz=m.object({type:m.string(),hashed:m.boolean(),identityHash:m.string(),identityType:m.string(),salt:m.string().optional()}),Qz=m.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),eK=m.object({type:m.string().array().nonempty(),achievedLevel:m.string().optional(),alignment:Dp.array().optional(),resultDescription:m.string().optional(),status:Qz.optional(),value:m.string().optional()}).catchall(m.any()),VA=m.object({id:m.string().optional(),type:m.string().array().nonempty(),activityEndDate:m.string().optional(),activityStartDate:m.string().optional(),creditsEarned:m.number().optional(),achievement:Zz.optional(),identifier:Xz.array().optional(),image:Ip.optional(),licenseNumber:m.string().optional(),narrative:m.string().optional(),result:eK.array().optional(),role:m.string().optional(),source:nh.optional(),term:m.string().optional()}).catchall(m.any()),tK=m.object({id:m.string().optional(),type:m.string().or(m.string().array().nonempty()),narrative:m.string().optional(),name:m.string().optional(),description:m.string().optional(),genre:m.string().optional(),audience:m.string().optional()}).catchall(m.any()),rK=du.extend({name:m.string().optional(),description:m.string().optional(),image:Ip.optional(),credentialSubject:VA.or(VA.array()),endorsement:du.array().optional(),evidence:tK.array().optional()}),ioe=rK.extend({proof:Bo.or(Bo.array())}),soe=m.object({checks:m.string().array(),warnings:m.string().array(),errors:m.string().array()}),t7=m.enum(["Success","Failed","Error"]),aoe=t7.enum,foe=m.object({check:m.string(),status:t7,message:m.string().optional(),details:m.string().optional()}),coe=m.object({title:m.string().optional(),createdAt:m.string().optional(),issuer:nh.optional(),issuee:nh.optional(),credentialSubject:Kv.optional()}),uoe=m.object({id:m.string(),uri:m.string()}).catchall(m.any()),doe=m.object({limit:m.number(),cursor:m.string().optional(),sort:m.string().optional()}),Wr=m.object({cursor:m.string().optional(),hasMore:m.boolean()}),r7=m.object({encryptedRecord:Fz,fields:m.string().array()}).catchall(m.any()),poe=Wr.extend({records:r7.array()}),nK=r7.extend({id:m.string()}),moe=Wr.extend({records:nK.array()}),GA=Rz(r=>{let e=r.match(/^\/(.*)\/([gimsuy]*)$/);if(!e)throw new Error("Invalid RegExp string format");return{pattern:e[1],flags:e[2]}},"parseRegexString"),iK=m.instanceof(RegExp).or(m.string().refine(r=>{try{return GA(r),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(r=>{let{pattern:e,flags:t}=GA(r);try{return new RegExp(e,t)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),WA=m.string().or(m.object({$in:m.string().array()})).or(m.object({$regex:iK})),Et=m.union([WA,m.object({$or:WA.array()})]);rh(m);var oK=m.object({backgroundColor:m.string().optional(),backgroundImage:m.string().optional(),fadeBackgroundImage:m.boolean().optional(),repeatBackgroundImage:m.boolean().optional(),fontColor:m.string().optional(),accentColor:m.string().optional(),accentFontColor:m.string().optional(),idBackgroundImage:m.string().optional(),fadeIdBackgroundImage:m.boolean().optional(),idBackgroundColor:m.string().optional(),repeatIdBackgroundImage:m.boolean().optional()}),Lo=m.object({profileId:m.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:m.string().default("").describe("Human-readable display name for the profile."),shortBio:m.string().default("").describe("Short bio for the profile."),bio:m.string().default("").describe("Longer bio for the profile."),did:m.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:m.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:m.string().optional().describe("Contact email address for the profile. (deprecated)"),image:m.string().optional().describe("Profile image URL for the profile."),heroImage:m.string().optional().describe("Hero image URL for the profile."),websiteLink:m.string().optional().describe("Website link for the profile."),isServiceProfile:m.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:m.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:m.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:oK.optional().describe("Display settings for the profile."),highlightedCredentials:m.array(m.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:m.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:m.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:m.string().optional().describe("Country for the profile."),approved:m.boolean().optional().describe("Approval status for the profile.")}),yoe=m.object({profileId:Et,displayName:Et,shortBio:Et,bio:Et,email:Et,websiteLink:Et,isServiceProfile:m.boolean(),type:Et}).partial(),xoe=Wr.extend({records:Lo.array()}),woe=m.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),n7=m.object({id:m.string(),created:m.string(),displayName:m.string().default("").optional(),shortBio:m.string().default("").optional(),bio:m.string().default("").optional(),email:m.string().optional(),image:m.string().optional(),heroImage:m.string().optional()}),_oe=Wr.extend({records:n7.extend({did:m.string()}).array()}),Eoe=m.object({id:Et,displayName:Et,shortBio:Et,bio:Et,email:Et}).partial(),Aoe=Wr.extend({records:m.object({profile:Lo,manager:n7.extend({did:m.string()}).optional()}).array()}),Soe=m.object({uri:m.string(),to:m.string(),from:m.string(),sent:m.string().datetime(),received:m.string().datetime().optional(),metadata:m.record(m.unknown()).optional()}),i7=m.object({role:m.string(),canEdit:m.boolean(),canIssue:m.boolean(),canRevoke:m.boolean(),canManagePermissions:m.boolean(),canIssueChildren:m.string(),canCreateChildren:m.string(),canEditChildren:m.string(),canRevokeChildren:m.string(),canManageChildrenPermissions:m.string(),canManageChildrenProfiles:m.boolean().default(!1).optional(),canViewAnalytics:m.boolean()}),sK=m.object({role:Et,canEdit:m.boolean(),canIssue:m.boolean(),canRevoke:m.boolean(),canManagePermissions:m.boolean(),canIssueChildren:Et,canCreateChildren:Et,canEditChildren:Et,canRevokeChildren:Et,canManageChildrenPermissions:Et,canManageChildrenProfiles:m.boolean(),canViewAnalytics:m.boolean()}).partial(),zv=m.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),aK=m.discriminatedUnion("type",[m.object({type:m.literal(zv.Values.GRANT_PERMISSIONS),data:m.object({claimUri:m.string(),targetUri:m.string(),permissions:i7.partial()})}),m.object({type:m.literal(zv.Values.ADD_ADMIN),data:m.object({claimUri:m.string(),targetUri:m.string()})}),m.object({type:m.literal(zv.Values.AUTO_CONNECT),data:m.object({claimUri:m.string(),targetUri:m.string()})})]),Moe=m.object({type:Et,data:m.object({claimUri:Et,targetUri:Et,permissions:sK})}).deepPartial(),fK=m.object({id:m.string(),createdAt:m.string(),updatedAt:m.string()}).and(aK),Toe=Wr.extend({records:fK.array()}),Vv=m.enum(["DRAFT","LIVE"]),cK=m.object({uri:m.string(),name:m.string().optional(),type:m.string().optional(),category:m.string().optional(),status:Vv.optional(),autoConnectRecipients:m.boolean().optional(),meta:m.record(m.any()).optional(),claimPermissions:i7.optional(),allowAnyoneToCreateChildren:m.boolean().optional()}),JA=m.object({uri:Et,name:Et,type:Et,category:Et,meta:m.record(Et),status:Vv.or(m.object({$in:Vv.array()})),autoConnectRecipients:m.boolean()}).partial(),Coe=m.union([m.object({$or:JA.array()}),JA]),koe=Wr.extend({records:cK.array()}),uK=m.object({to:Lo,from:m.string(),received:m.string().optional(),uri:m.string().optional()}),Ioe=Wr.extend({records:uK.array()}),lK=m.object({to:Lo,from:m.string(),received:m.string().optional(),boostUris:m.array(m.string()),credentialUris:m.array(m.string()).optional()}),Doe=Wr.extend({records:lK.array()}),Roe=m.object({endpoint:m.string(),name:m.string(),did:m.string().optional()}),Ooe=m.object({ttlSeconds:m.number().optional(),totalUses:m.number().optional()}),hK=m.object({endpoint:m.string()}),Noe=m.object({signingAuthority:hK,relationship:m.object({name:m.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:m.string(),isPrimary:m.boolean().optional()})}),Poe=m.object({boostUri:m.string(),signingAuthority:m.object({endpoint:m.string(),name:m.string()})}),dK=m.enum(["live","stale","withdrawn"]),pK=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({categories:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({}),personal:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({}),write:m.object({credentials:m.object({categories:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({}),personal:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({})}),o7=m.object({contract:pK,owner:Lo,name:m.string(),subtitle:m.string().optional(),description:m.string().optional(),reasonForAccessing:m.string().optional(),image:m.string().optional(),uri:m.string(),needsGuardianConsent:m.boolean().optional(),redirectUrl:m.string().optional(),frontDoorBoostUri:m.string().optional(),createdAt:m.string(),updatedAt:m.string(),expiresAt:m.string().optional(),autoBoosts:m.string().array().optional(),writers:m.array(Lo).optional()}),Boe=Wr.extend({records:o7.omit({owner:!0}).array()}),mK=m.object({credentials:m.object({categories:m.record(m.string().array()).default({})}),personal:m.record(m.string()).default({}),date:m.string()}),Loe=Wr.extend({records:mK.array()}),bK=m.object({credentials:m.object({category:m.string(),uri:m.string()}).array(),personal:m.record(m.string()).default({}),date:m.string(),contractUri:m.string()}),Uoe=Wr.extend({records:bK.array()}),s7=m.object({sharing:m.boolean().optional(),shared:m.string().array().optional(),shareAll:m.boolean().optional(),shareUntil:m.string().optional()}),a7=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({shareAll:m.boolean().optional(),sharing:m.boolean().optional(),categories:m.record(s7).default({})}).default({}),personal:m.record(m.string()).default({})}).default({}),write:m.object({credentials:m.object({categories:m.record(m.boolean()).default({})}).default({}),personal:m.record(m.boolean()).default({})}).default({}),deniedWriters:m.array(m.string()).optional()}),Foe=Wr.extend({records:m.object({expiresAt:m.string().optional(),oneTime:m.boolean().optional(),terms:a7,contract:o7,uri:m.string(),consenter:Lo,status:dK}).array()}),$oe=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({categories:m.record(m.object({required:m.boolean().optional()})).optional()}).optional(),personal:m.record(m.object({required:m.boolean().optional()})).optional()}).optional(),write:m.object({credentials:m.object({categories:m.record(m.object({required:m.boolean().optional()})).optional()}).optional(),personal:m.record(m.object({required:m.boolean().optional()})).optional()}).optional()}),qoe=m.object({anonymize:m.boolean().optional(),credentials:m.object({categories:m.record(m.boolean()).optional()}).optional(),personal:m.record(m.boolean()).optional()}),joe=m.object({credentials:m.object({categories:m.record(m.boolean()).optional()}).optional(),personal:m.record(m.boolean()).optional(),id:Et.optional()}),gK=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({shareAll:m.boolean().optional(),sharing:m.boolean().optional(),categories:m.record(s7.optional()).optional()}).optional(),personal:m.record(m.string()).optional()}).optional(),write:m.object({credentials:m.object({categories:m.record(m.boolean()).optional()}).optional(),personal:m.record(m.boolean()).optional()}).optional()}),Gv=m.enum(["consent","update","sync","withdraw","write"]),Hoe=m.object({terms:gK.optional(),action:Gv.or(Gv.array()).optional(),date:m.object({$gt:m.string()}).or(m.object({$lt:m.string()})).or(m.object({$eq:m.string()})).optional(),expiresAt:m.object({$gt:m.string()}).or(m.object({$lt:m.string()})).or(m.object({$eq:m.string()})).optional(),oneTime:m.boolean().optional()}),f7=m.object({expiresAt:m.string().optional(),oneTime:m.boolean().optional(),terms:a7.optional(),id:m.string(),action:Gv,date:m.string(),uris:m.string().array().optional()}),zoe=Wr.extend({records:f7.array()}),YA=m.object({id:Et,name:Et,description:Et,sourceURI:Et,status:Et}).partial(),Koe=m.union([m.object({$or:YA.array()}),YA]),vK=m.object({credentialUri:m.string(),termsUri:m.string(),contractUri:m.string(),boostUri:m.string(),category:m.string().optional(),date:m.string()}),Voe=Wr.extend({records:vK.array()}),yK=m.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),xK=m.object({title:m.string().optional(),body:m.string().optional()}),wK=m.object({type:m.string(),value:m.string()}),Rp=m.enum(["PENDING","ISSUED","EXPIRED","DELIVERED","CLAIMED"]),_K=m.object({issuanceId:m.string(),status:Rp,recipient:m.object({contactMethod:wK.optional(),learnCardId:m.string().optional()}),timestamp:m.string().datetime().optional()}),EK=m.object({vcUris:m.array(m.string()).optional(),vpUris:m.array(m.string()).optional(),transaction:f7.optional(),inbox:_K.optional(),metadata:m.record(m.unknown()).optional()}).passthrough(),Goe=m.object({type:yK,to:Lo.partial().and(m.object({did:m.string()})),from:Lo.partial().and(m.object({did:m.string()})),message:xK.optional(),data:EK.optional(),sent:m.string().datetime().optional(),webhookUrl:m.string().optional()}),AK="auth-grant:",Woe=m.object({id:m.string(),name:m.string(),description:m.string().optional(),challenge:m.string().startsWith(AK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:m.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:m.string(),createdAt:m.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:m.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Joe=m.object({id:m.string()}).catchall(m.any()),SK=m.enum(["active","revoked"]),Yoe=m.object({id:Et,name:Et,description:Et,status:SK}).partial(),ZA=m.object({id:m.string(),isVerified:m.boolean(),verifiedAt:m.string().optional(),isPrimary:m.boolean(),createdAt:m.string()}),Zoe=m.discriminatedUnion("type",[m.object({type:m.literal("email"),value:m.string().email()}).merge(ZA),m.object({type:m.literal("phone"),value:m.string()}).merge(ZA)]),XA=m.object({isVerified:m.boolean().optional(),isPrimary:m.boolean().optional()}),Xoe=m.discriminatedUnion("type",[m.object({type:m.literal("email"),value:m.string().email()}).merge(XA),m.object({type:m.literal("phone"),value:m.string()}).merge(XA)]),c7=m.discriminatedUnion("type",[m.object({type:m.literal("email"),value:m.string().email()}),m.object({type:m.literal("phone"),value:m.string()})]),MK=m.object({value:m.string(),type:m.enum(["email","phone"])}),Qoe=m.object({token:m.string()}),ese=m.object({contactMethodId:m.string()}),tse=m.object({contactMethod:MK,otpChallenge:m.string()}),rse=m.object({sessionJwt:m.string()}),TK=m.object({id:m.string(),credential:m.string(),isSigned:m.boolean(),currentStatus:Rp,isAccepted:m.boolean().optional(),expiresAt:m.string(),createdAt:m.string(),issuerDid:m.string(),webhookUrl:m.string().optional(),signingAuthority:m.object({endpoint:m.string().optional(),name:m.string().optional()}).optional()}),nse=m.object({hasMore:m.boolean(),records:m.array(TK),cursor:m.string().optional()}),ise=m.object({currentStatus:Rp,id:m.string(),isSigned:m.boolean(),isAccepted:m.boolean().optional(),issuerDid:m.string()}).partial(),CK=m.object({endpoint:m.string().url(),name:m.string()}),ose=m.object({recipient:c7.describe("The recipient of the credential"),credential:Pf.passthrough().or(oh.passthrough()).or(du.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:m.object({signingAuthority:CK.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:m.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:m.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:m.object({suppress:m.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:m.object({id:m.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:m.object({issuer:m.object({name:m.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:m.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:m.object({name:m.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:m.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:m.object({name:m.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),sse=m.object({issuanceId:m.string(),status:Rp,recipient:c7,claimUrl:m.string().url().optional(),recipientDid:m.string().optional()}),ase=m.object({credential:Pf.passthrough().or(oh.passthrough()).or(du.passthrough()).describe("The credential to issue."),configuration:m.object({publishableKey:m.string(),signingAuthorityName:m.string().optional()}).optional()}),Jv=m.union([m.string().regex(/^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"}),m.string().regex(/^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid http(s) origin"})]),kK=m.object({id:m.string(),name:m.string(),description:m.string().optional(),publishableKey:m.string(),whitelistedDomains:m.array(Jv).default([])}),fse=m.object({name:m.string(),description:m.string().optional(),whitelistedDomains:m.array(Jv).default([])}),cse=m.object({name:m.string().optional(),description:m.string().optional(),whitelistedDomains:m.array(Jv).optional(),rotatePublishableKey:m.boolean().optional()}),use=m.object({id:Et,name:Et,description:Et}).partial(),lse=Wr.extend({records:kK.array()}),hse=m.object({token:m.string(),contactMethodId:m.string(),autoVerifyContactMethod:m.boolean().optional().default(!1),createdAt:m.string(),expiresAt:m.string(),used:m.boolean()}),dse=m.object({id:m.string(),name:m.string().min(1),slug:m.string().min(1),createdAt:m.string().optional(),updatedAt:m.string().optional()}),ih=m.enum(["active","archived"]),u7=m.object({id:m.string(),statement:m.string(),description:m.string().optional(),code:m.string().optional(),icon:m.string().optional(),type:m.string().default("skill"),status:ih.default("active"),frameworkId:m.string().optional(),createdAt:m.string().optional(),updatedAt:m.string().optional()}),QA=m.object({id:Et,statement:Et,description:Et,code:Et,type:Et,status:ih.or(m.object({$in:ih.array()}))}).partial(),pse=m.union([m.object({$or:QA.array()}),QA]),Yv=m.enum(["active","archived"]),l7=m.object({id:m.string(),name:m.string(),description:m.string().optional(),image:m.string().optional(),sourceURI:m.string().url().optional(),status:Yv.default("active"),createdAt:m.string().optional(),updatedAt:m.string().optional()}),mse=Wr.extend({records:l7.array()}),Zv=u7.extend({children:m.array(m.lazy(()=>Zv)),hasChildren:m.boolean(),childrenCursor:m.string().nullable().optional()}).openapi({ref:"SkillTreeNode"}),IK=m.object({hasMore:m.boolean(),cursor:m.string().nullable(),records:m.array(Zv)}),pu=m.lazy(()=>m.object({id:m.string().optional(),statement:m.string(),description:m.string().optional(),code:m.string().optional(),icon:m.string().optional(),type:m.string().optional(),status:ih.optional(),children:m.array(pu).optional()})).openapi({ref:"SkillTreeNodeInput"}),bse=m.object({frameworkId:m.string()}),DK=m.object({id:m.string().optional(),name:m.string().min(1),description:m.string().optional(),image:m.string().optional(),sourceURI:m.string().url().optional(),status:Yv.optional(),skills:m.array(pu).optional(),boostUris:m.array(m.string()).optional()}),gse=m.object({id:m.string(),name:m.string().min(1).optional(),description:m.string().optional(),image:m.string().optional(),sourceURI:m.string().url().optional(),status:Yv.optional()}).refine(r=>r.name!==void 0||r.description!==void 0||r.image!==void 0||r.sourceURI!==void 0||r.status!==void 0,{message:"At least one field must be provided to update",path:["name"]}),vse=m.object({id:m.string()}),yse=m.object({frameworks:m.array(DK.extend({skills:m.array(pu).optional()})).min(1)}),xse=m.object({frameworkId:m.string(),profileId:m.string()}),wse=m.object({frameworkId:m.string()}),_se=Lo.array(),Ese=m.object({id:m.string()}),Ase=m.object({slug:m.string().min(1),name:m.string().min(1)}),Sse=m.object({frameworkId:m.string(),skill:pu,parentId:m.string().nullable().optional()}),Mse=m.object({frameworkId:m.string(),id:m.string(),statement:m.string().optional(),description:m.string().optional(),code:m.string().optional(),icon:m.string().optional(),type:m.string().optional(),status:ih.optional()}).refine(r=>r.statement!==void 0||r.description!==void 0||r.code!==void 0||r.icon!==void 0||r.type!==void 0||r.status!==void 0,{message:"At least one field must be provided to update a skill",path:["statement"]}),RK=m.enum(["recursive","reparent"]),Tse=m.object({frameworkId:m.string(),id:m.string(),strategy:RK.optional().default("reparent")}),Cse=m.object({frameworkId:m.string(),skills:m.array(pu).min(1),parentId:m.string().nullable().optional()}),kse=m.object({frameworkId:m.string(),skills:m.array(pu).min(0)}),Ise=m.object({created:m.number().int().min(0),updated:m.number().int().min(0),deleted:m.number().int().min(0),unchanged:m.number().int().min(0),total:m.number().int().min(0)}),Dse=m.object({frameworkId:m.string(),skillId:m.string().optional(),recursive:m.boolean().optional().default(!1),onlyCountCompetencies:m.boolean().optional().default(!1)}),Rse=m.object({count:m.number().int().min(0)}),Ose=m.object({frameworkId:m.string()}),Nse=m.object({skills:m.array(Zv)}),Pse=m.object({frameworkId:m.string(),skillId:m.string()}),Bse=m.object({path:m.array(u7)}),Lse=m.object({framework:l7,skills:IK});var Op=o(r=>`lc:ceramic:${r}`,"streamIdToCeramicURI");var Xv=m.string().refine(r=>r.split(":").length===3&&r.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(r=>r.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var h7={ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var Np=o(async(r,{ceramicEndpoint:e,defaultContentFamily:t}=h7)=>{let n=new Yl(e),i=o(async(R,I,B,Y)=>r.invoke.didResolver(R,Y),"learnCardResolver"),s={...I_.getResolver(),web:i},f=new hf({resolver:s});n.did=f;let u=r.invoke.getKey(),d=new Sl(h_(u));n.did.setProvider(d),await n.did.authenticate();let y=new Hl({ceramic:n}),w=o(async(R,I={},B={},Y)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=t),"pin"in B||(B.pin=!0),Y?.encrypt){r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",Y);let J=Y?.recipients||[];Y?.controllersCanDecrypt&&(J=[...J,...I.controllers]),R=await n?.did?.createDagJWE(R,d7.default.uniq(J))}return r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,B),(await ei.create(n,R,I,B)).id.toString()},"publishContentToCeramic"),A=o(async R=>{let I=(await y.load(R))?.content;if(r.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await f.decryptDagJWE(I)}catch(B){throw r.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",B),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await Pf.or(oh).parseAsync(R),Op(await w(R,{},{},I))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,I)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(I)),uploadEncrypted:async(R,I,B)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...B?{recipients:B.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let B=await Xv.spa(I);if(!B.success)return;let Y=B.data.split(":")[2];try{return await Pf.or(oh).parseAsync(await A(Y))}catch(P){R.debug?.(P);return}}},methods:{publishContentToCeramic:async(R,I,B)=>Op(await w(I,{},{},B)),readContentFromCeramic:async(R,I)=>A(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var OK=Np;
822
+ `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function wf(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(wf,"arrRemove");var ua=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 f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var u=ys(f),d=u.next();!d.done;d=u.next()){var y=d.value;y.remove(this)}}catch(B){e={error:B}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else f.remove(this);var w=this.initialTeardown;if(Ct(w))try{w()}catch(B){s=B instanceof X0?B.errors:[B]}var A=this._finalizers;if(A){this._finalizers=null;try{for(var O=ys(A),R=O.next();!R.done;R=O.next()){var I=R.value;try{UE(I)}catch(B){s=s??[],B instanceof X0?s=to(to([],Xn(s)),Xn(B.errors)):s.push(B)}}}catch(B){n={error:B}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(s)throw new X0(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)UE(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)&&wf(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&wf(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var av=ua.EMPTY;function Q0(r){return r instanceof ua||r&&"closed"in r&&Ct(r.remove)&&Ct(r.add)&&Ct(r.unsubscribe)}o(Q0,"isSubscription");function UE(r){Ct(r)?r():r.unsubscribe()}o(UE,"execFinalizer");var ro={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Xc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Xc.delegate;return i?.setTimeout?i.setTimeout.apply(i,to([r,e],Xn(t))):setTimeout.apply(void 0,to([r,e],Xn(t)))},clearTimeout:function(r){var e=Xc.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function ep(r){Xc.setTimeout(function(){var e=ro.onUnhandledError;if(e)e(r);else throw r})}o(ep,"reportUnhandledError");function fv(){}o(fv,"noop");var FE=function(){return cv("C",void 0,void 0)}();function $E(r){return cv("E",void 0,r)}o($E,"errorNotification");function qE(r){return cv("N",r,void 0)}o(qE,"nextNotification");function cv(r,e,t){return{kind:r,value:e,error:t}}o(cv,"createNotification");var _f=null;function Qc(r){if(ro.useDeprecatedSynchronousErrorHandling){var e=!_f;if(e&&(_f={errorThrown:!1,error:null}),r(),e){var t=_f,n=t.errorThrown,i=t.error;if(_f=null,n)throw i}}else r()}o(Qc,"errorContext");function jE(r){ro.useDeprecatedSynchronousErrorHandling&&_f&&(_f.errorThrown=!0,_f.error=r)}o(jE,"captureError");var Nl=function(r){on(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Q0(t)&&t.add(n)):n.destination=Cq,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new rp(t,n,i)},e.prototype.next=function(t){this.isStopped?lv(qE(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?lv($E(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?lv(FE,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}(ua);var Sq=Function.prototype.bind;function uv(r,e){return Sq.call(r,e)}o(uv,"bind");var Mq=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){tp(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){tp(n)}else tp(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){tp(t)}},r}(),rp=function(r){on(e,r);function e(t,n,i){var s=r.call(this)||this,f;if(Ct(t)||!t)f={next:t??void 0,error:n??void 0,complete:i??void 0};else{var u;s&&ro.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()},f={next:t.next&&uv(t.next,u),error:t.error&&uv(t.error,u),complete:t.complete&&uv(t.complete,u)}):f=t}return s.destination=new Mq(f),s}return o(e,"SafeSubscriber"),e}(Nl);function tp(r){ro.useDeprecatedSynchronousErrorHandling?jE(r):ep(r)}o(tp,"handleUnhandledError");function Tq(r){throw r}o(Tq,"defaultErrorHandler");function lv(r,e){var t=ro.onStoppedNotification;t&&Xc.setTimeout(function(){return t(r,e)})}o(lv,"handleStoppedNotification");var Cq={closed:!0,next:fv,error:Tq,complete:fv};var eu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function tu(r){return r}o(tu,"identity");function HE(r){return r.length===0?tu:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(HE,"pipeFromArray");var Yt=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=Iq(e)?e:new rp(e,t,n);return Qc(function(){var f=i,u=f.operator,d=f.source;s.add(u?u.call(s,d):d?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=zE(t),new t(function(i,s){var f=new rp({next:function(u){try{e(u)}catch(d){s(d),f.unsubscribe()}},error:s,complete:i});n.subscribe(f)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[eu]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return HE(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=zE(e),new e(function(n,i){var s;t.subscribe(function(f){return s=f},function(f){return i(f)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function zE(r){var e;return(e=r??ro.Promise)!==null&&e!==void 0?e:Promise}o(zE,"getPromiseCtor");function kq(r){return r&&Ct(r.next)&&Ct(r.error)&&Ct(r.complete)}o(kq,"isObserver");function Iq(r){return r&&r instanceof Nl||kq(r)&&Q0(r)}o(Iq,"isSubscriber");function Dq(r){return Ct(r?.lift)}o(Dq,"hasLift");function Lr(r){return function(e){if(Dq(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(Lr,"operate");function Ur(r,e,t,n,i){return new Rq(r,e,t,n,i)}o(Ur,"createOperatorSubscriber");var Rq=function(r){on(e,r);function e(t,n,i,s,f,u){var d=r.call(this,t)||this;return d.onFinalize=f,d.shouldUnsubscribe=u,d._next=n?function(y){try{n(y)}catch(w){t.error(w)}}:r.prototype._next,d._error=s?function(y){try{s(y)}catch(w){t.error(w)}finally{this.unsubscribe()}}:r.prototype._error,d._complete=i?function(){try{i()}catch(y){t.error(y)}finally{this.unsubscribe()}}:r.prototype._complete,d}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}(Nl);var KE=Zc(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var hv=function(r){on(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 VE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new KE},e.prototype.next=function(t){var n=this;Qc(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var f=ys(n.currentObservers),u=f.next();!u.done;u=f.next()){var d=u.value;d.next(t)}}catch(y){i={error:y}}finally{try{u&&!u.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;Qc(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;Qc(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,f=i.isStopped,u=i.observers;return s||f?av:(this.currentObservers=null,u.push(t),new ua(function(){n.currentObservers=null,wf(u,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,f=n.isStopped;i?t.error(s):f&&t.complete()},e.prototype.asObservable=function(){var t=new Yt;return t.source=this,t},e.create=function(t,n){return new VE(t,n)},e}(Yt);var VE=function(r){on(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:av},e}(hv);var dv=function(r){on(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}(hv);var pv={now:function(){return(pv.delegate||Date).now()},delegate:void 0};var GE=function(r){on(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}(ua);var Pl={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Pl.delegate;return i?.setInterval?i.setInterval.apply(i,to([r,e],Xn(t))):setInterval.apply(void 0,to([r,e],Xn(t)))},clearInterval:function(r){var e=Pl.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var WE=function(r){on(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){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var s=this.id,f=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(f,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(f,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),Pl.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;n!=null&&Pl.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(f){i=!0,s=f||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,wf(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(GE);var mv=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=pv.now,r}();var JE=function(r){on(e,r);function e(t,n){n===void 0&&(n=mv.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,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}(mv);var Oq=new JE(WE),YE=Oq;var np=new Yt(function(r){return r.complete()});function ip(r){return r&&Ct(r.schedule)}o(ip,"isScheduler");function ZE(r){return r[r.length-1]}o(ZE,"last");function XE(r){return ip(ZE(r))?r.pop():void 0}o(XE,"popScheduler");function QE(r,e){return typeof ZE(r)=="number"?r.pop():e}o(QE,"popNumber");var ru=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function op(r){return Ct(r?.then)}o(op,"isPromise");function sp(r){return Ct(r[eu])}o(sp,"isInteropObservable");function ap(r){return Symbol.asyncIterator&&Ct(r?.[Symbol.asyncIterator])}o(ap,"isAsyncIterable");function fp(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(fp,"createInvalidObservableTypeError");function Nq(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Nq,"getSymbolIterator");var cp=Nq();function up(r){return Ct(r?.[cp])}o(up,"isIterable");function lp(r){return BE(this,arguments,o(function(){var t,n,i,s;return Z0(this,function(f){switch(f.label){case 0:t=r.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,xf(t.read())];case 3:return n=f.sent(),i=n.value,s=n.done,s?[4,xf(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,xf(i)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(lp,"readableStreamLikeToAsyncGenerator");function hp(r){return Ct(r?.getReader)}o(hp,"isReadableStreamLike");function sn(r){if(r instanceof Yt)return r;if(r!=null){if(sp(r))return Pq(r);if(ru(r))return Bq(r);if(op(r))return Lq(r);if(ap(r))return e9(r);if(up(r))return Uq(r);if(hp(r))return Fq(r)}throw fp(r)}o(sn,"innerFrom");function Pq(r){return new Yt(function(e){var t=r[eu]();if(Ct(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Pq,"fromInteropObservable");function Bq(r){return new Yt(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(Bq,"fromArrayLike");function Lq(r){return new Yt(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ep)})}o(Lq,"fromPromise");function Uq(r){return new Yt(function(e){var t,n;try{for(var i=ys(r),s=i.next();!s.done;s=i.next()){var f=s.value;if(e.next(f),e.closed)return}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(Uq,"fromIterable");function e9(r){return new Yt(function(e){$q(r,e).catch(function(t){return e.error(t)})})}o(e9,"fromAsyncIterable");function Fq(r){return e9(lp(r))}o(Fq,"fromReadableStreamLike");function $q(r,e){var t,n,i,s;return PE(this,void 0,void 0,function(){var f,u;return Z0(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),t=LE(r),d.label=1;case 1:return[4,t.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(f=n.value,e.next(f),e.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),i={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:d.sent(),d.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($q,"process");function Oi(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(Oi,"executeSchedule");function dp(r,e){return e===void 0&&(e=0),Lr(function(t,n){t.subscribe(Ur(n,function(i){return Oi(n,r,function(){return n.next(i)},e)},function(){return Oi(n,r,function(){return n.complete()},e)},function(i){return Oi(n,r,function(){return n.error(i)},e)}))})}o(dp,"observeOn");function pp(r,e){return e===void 0&&(e=0),Lr(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(pp,"subscribeOn");function t9(r,e){return sn(r).pipe(pp(e),dp(e))}o(t9,"scheduleObservable");function r9(r,e){return sn(r).pipe(pp(e),dp(e))}o(r9,"schedulePromise");function n9(r,e){return new Yt(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(n9,"scheduleArray");function i9(r,e){return new Yt(function(t){var n;return Oi(t,e,function(){n=r[cp](),Oi(t,e,function(){var i,s,f;try{i=n.next(),s=i.value,f=i.done}catch(u){t.error(u);return}f?t.complete():t.next(s)},0,!0)}),function(){return Ct(n?.return)&&n.return()}})}o(i9,"scheduleIterable");function mp(r,e){if(!r)throw new Error("Iterable cannot be null");return new Yt(function(t){Oi(t,e,function(){var n=r[Symbol.asyncIterator]();Oi(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(mp,"scheduleAsyncIterable");function o9(r,e){return mp(lp(r),e)}o(o9,"scheduleReadableStreamLike");function s9(r,e){if(r!=null){if(sp(r))return t9(r,e);if(ru(r))return n9(r,e);if(op(r))return r9(r,e);if(ap(r))return mp(r,e);if(up(r))return i9(r,e);if(hp(r))return o9(r,e)}throw fp(r)}o(s9,"scheduled");function a9(r,e){return e?s9(r,e):sn(r)}o(a9,"from");var bp=Zc(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function f9(r){return r instanceof Date&&!isNaN(r)}o(f9,"isValidDate");function gp(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){n.next(r.call(e,s,i++))}))})}o(gp,"map");var qq=Array.isArray;function jq(r,e){return qq(e)?r.apply(void 0,to([],Xn(e))):r(e)}o(jq,"callOrApply");function c9(r){return gp(function(e){return jq(r,e)})}o(c9,"mapOneOrManyArgs");function u9(r,e,t,n,i,s,f,u){var d=[],y=0,w=0,A=!1,O=o(function(){A&&!d.length&&!y&&e.complete()},"checkComplete"),R=o(function(B){return y<n?I(B):d.push(B)},"outerNext"),I=o(function(B){s&&e.next(B),y++;var Y=!1;sn(t(B,w++)).subscribe(Ur(e,function(P){i?.(P),s?R(P):e.next(P)},function(){Y=!0},void 0,function(){if(Y)try{y--;for(var P=o(function(){var J=d.shift();f?Oi(e,f,function(){return I(J)}):I(J)},"_loop_1");d.length&&y<n;)P();O()}catch(J){e.error(J)}}))},"doInnerSub");return r.subscribe(Ur(e,R,function(){A=!0,O()})),function(){u?.()}}o(u9,"mergeInternals");function Bl(r,e,t){return t===void 0&&(t=1/0),Ct(e)?Bl(function(n,i){return gp(function(s,f){return e(n,s,i,f)})(sn(r(n,i)))},t):(typeof e=="number"&&(t=e),Lr(function(n,i){return u9(n,i,r,t)}))}o(Bl,"mergeMap");function l9(r){return r===void 0&&(r=1/0),Bl(tu,r)}o(l9,"mergeAll");var Hq=["addListener","removeListener"],zq=["addEventListener","removeEventListener"],Kq=["on","off"];function Ll(r,e,t,n){if(Ct(t)&&(n=t,t=void 0),n)return Ll(r,e,t).pipe(c9(n));var i=Xn(Wq(r)?zq.map(function(u){return function(d){return r[u](e,d,t)}}):Vq(r)?Hq.map(h9(r,e)):Gq(r)?Kq.map(h9(r,e)):[],2),s=i[0],f=i[1];if(!s&&ru(r))return Bl(function(u){return Ll(u,e,t)})(sn(r));if(!s)throw new TypeError("Invalid event target");return new Yt(function(u){var d=o(function(){for(var y=[],w=0;w<arguments.length;w++)y[w]=arguments[w];return u.next(1<y.length?y:y[0])},"handler");return s(d),function(){return f(d)}})}o(Ll,"fromEvent");function h9(r,e){return function(t){return function(n){return r[t](e,n)}}}o(h9,"toCommonHandlerRegistry");function Vq(r){return Ct(r.addListener)&&Ct(r.removeListener)}o(Vq,"isNodeStyleEventEmitter");function Gq(r){return Ct(r.on)&&Ct(r.off)}o(Gq,"isJQueryStyleEventEmitter");function Wq(r){return Ct(r.addEventListener)&&Ct(r.removeEventListener)}o(Wq,"isEventTarget");function Ul(r,e,t){r===void 0&&(r=0),t===void 0&&(t=YE);var n=-1;return e!=null&&(ip(e)?t=e:n=e),new Yt(function(i){var s=f9(r)?+r-t.now():r;s<0&&(s=0);var f=0;return t.schedule(function(){i.closed||(i.next(f++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(Ul,"timer");function bv(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=XE(r),n=QE(r,1/0),i=r;return i.length?i.length===1?sn(i[0]):l9(n)(a9(i,t)):np}o(bv,"merge");function d9(r,e){return Lr(function(t,n){var i=0;t.subscribe(Ur(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(d9,"filter");function p9(r){return Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(p9,"defaultIfEmpty");function m9(r){return r<=0?function(){return np}:Lr(function(e,t){var n=0;e.subscribe(Ur(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(m9,"take");function b9(r){return r===void 0&&(r=Jq),Lr(function(e,t){var n=!1;e.subscribe(Ur(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(b9,"throwIfEmpty");function Jq(){return new bp}o(Jq,"defaultErrorFactory");function gv(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?d9(function(i,s){return r(i,s,n)}):tu,m9(1),t?p9(e):b9(function(){return new bp}))}}o(gv,"first");function vv(r,e){return Lr(function(t,n){var i=e??{},s=i.leading,f=s===void 0?!0:s,u=i.trailing,d=u===void 0?!1:u,y=!1,w=null,A=null,O=!1,R=o(function(){A?.unsubscribe(),A=null,d&&(Y(),O&&n.complete())},"endThrottling"),I=o(function(){A=null,O&&n.complete()},"cleanupThrottling"),B=o(function(P){return A=sn(r(P)).subscribe(Ur(n,R,I))},"startThrottle"),Y=o(function(){if(y){y=!1;var P=w;w=null,n.next(P),!O&&B(P)}},"send");t.subscribe(Ur(n,function(P){y=!0,w=P,!(A&&!A.closed)&&(f?Y():B(P))},function(){O=!0,!(d&&y&&A&&!A.closed)&&n.complete()}))})}o(vv,"throttle");var g9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(g9||(g9={}));var Fl;(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"})(Fl||(Fl={}));var xv;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(xv||(xv={}));var xs=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,yv.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Bt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Bt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===xv.ANCHOR).map(({cid:e})=>Bt.make(this.id,e))}get state(){return(0,yv.default)(this.state$.value)}async sync(e={}){e={sync:_r.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(xs,"Stream");function nu(){return r=>{}}o(nu,"StreamStatic");var _9=Ft(y9(),1);function x9(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):(bv(...r.map(t=>Ll(t,"abort"))).pipe(gv()).subscribe(()=>{e.abort()}),e.signal)}o(x9,"mergeAbortSignals");var $l=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=Ul(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}};o($l,"TimedAbortSignal");async function w9(r,e){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(w9,"abortable");var Yq=60*1e3*3;async function Vr(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let t=e.timeout||Yq,n=new $l(t),i=e.signal?x9([e.signal,n.signal]):n.signal,s=await w9(i,f=>(0,_9.default)(String(r),{...e,signal:f})).finally(()=>n.clear());if(!s.ok){let f=await s.text();throw new Error(`HTTP request to '${r}' failed with status '${s.statusText}': ${f}`)}return s.json()}o(Vr,"fetchJson");var ql=Ft(Vc(),1);ji();function ws(r){let e=Ye.asCID(r);if(e)return e;if(typeof r=="string")return Ye.parse(r);if(r instanceof Uint8Array)return Ye.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(ws,"toCID");var E9=0,Qt=class{static streamIdFromState(e){return new it(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,ql.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Rt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Rt(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(e)&&(t.link=t.link.toString()),Qt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=Rt(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,ql.default)(e);return Qt.isSignedCommitContainer(t)?(t.jws.link=ws(t.jws.link),t.linkedBlock=$t(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=$t(t.cacaoBlock,"base64")),t):(Qt.isSignedCommit(t)&&(t.link=ws(t.link)),Qt.isAnchorCommit(t)&&(t.proof=ws(t.proof)),t.id&&(t.id=ws(t.id)),t.prev&&(t.prev=ws(t.prev)),t.header?.model&&(t.header.model=$t(t.header.model,"base64")),t)}static serializeState(e){let t=(0,ql.default)(e);return t.log=t.log.map(n=>({...n,cid:n.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Fl[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=E9&&(t.metadata.unique=Rt(t.metadata.unique,"base64")),t.doctype=In.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,ql.default)(e);return t.doctype&&(t.type=In.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(n=>({...n,cid:ws(n.cid)})),t.anchorProof&&(t.anchorProof.txHash=ws(t.anchorProof.txHash),t.anchorProof.root=ws(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Fl[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=it.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=it.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=E9&&(t.metadata.unique=$t(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Qt.serializeState(e))===JSON.stringify(Qt.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.log.length===t.log.length&&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 async convertCommitToSignedCommitContainer(e,t){if(Qt.isSignedCommit(e)){let n=await 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(Qt,"StreamUtils");var jl=class extends dv{next(e){let t=this.value;Qt.statesEqual(t,e)||super.next(e)}};o(jl,"StreamStateSubject");var Zq=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Qn,wv={anchor:!0,publish:!0,pin:!0,sync:_r.PREFER_CACHE},Xq={sync:_r.PREFER_CACHE},A9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function _v(r,e){if(typeof r?.schema=="string")try{Bt.fromString(r.schema)}catch{throw new Error("Schema must be a CommitID")}let t={controllers:r?.controllers,family:r?.family,schema:r?.schema?.toString(),tags:r?.tags};if(e)r?.deterministic||(t.unique=Rt((0,T9.randomBytes)(12),"base64")),r?.forbidControllerChange&&(t.forbidControllerChange=!0);else{if(r?.deterministic!==void 0||r?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(r?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(n=>t[n]===void 0&&delete t[n]),t}o(_v,"headerFromMetadata");async function S9(r){if(!r.did)throw new Error("No DID provided");return r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`)),r.did}o(S9,"getAuthenticatedDID");async function Ev(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Ev,"throwReadOnlyError");var ei=Qn=o(class extends xs{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,M9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async create(e,t,n,i={}){i={...wv,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let s=i.asDID?{did:i.asDID}:e,f=await Qn.makeGenesis(s,t,n);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,f,i)}static async createFromGenesis(e,t,n={}){n={...wv,...n},t.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=t.data?await Qn._signDagJWS(e,t):t;return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async deterministic(e,t,n={}){if(n={...wv,...n},t={...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 i=await Qn.makeGenesis(e,null,t);return e.createStreamFromGenesis(Qn.STREAM_TYPE_ID,i,n)}static async load(e,t,n={}){n={...Xq,...n};let i=dn.from(t);if(i.type!=Qn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Qn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,t,n={}){n={...A9,...n};let i=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(i,e,t),f=await this.api.applyCommit(this.id,s,n);this.state$.next(f.state)}async patch(e,t={}){t={...A9,...t};let i={header:_v(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},s=await Qn._signDagJWS(this.api,i),f=await this.api.applyCommit(this.id,s,t);this.state$.next(f.state)}makeReadOnly(){this.update=Ev,this.patch=Ev,this.sync=Ev,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,t,n){let i=await this._makeRawCommit(t,n);return Qn._signDagJWS(e,i)}async _makeRawCommit(e,t){t||(t={});let n=_v(t,!1);if(e==null&&(e=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let i=U0.compare(this.content,e),s=this.state.log[0];return{header:n,data:i,prev:this.tip,id:s.cid}}static async makeGenesis(e,t,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let f=await S9(e);n.controllers=[f.hasParent?f.parent:f.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=_v(n,!0);if(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 rf(f),f}let s={data:t,header:i};return Qn._signDagJWS(e,s)}static async _signDagJWS(e,t){return(await S9(e)).createDagJWS(t)}},"TileDocument");ei.STREAM_TYPE_NAME="tile";ei.STREAM_TYPE_ID=0;ei=Qn=Zq([nu()],ei);var N9=Ft(I9(),1);function fj(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(fj,"_checkPrivateRedeclaration");function cj(r,e){return e.get?e.get.call(r):e.value}o(cj,"_classApplyDescriptorGet");function uj(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(uj,"_classApplyDescriptorSet");function O9(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(O9,"_classExtractFieldDescriptor");function Tv(r,e){var t=O9(r,e,"get");return cj(r,t)}o(Tv,"_classPrivateFieldGet");function D9(r,e,t){fj(r,e),e.set(r,t)}o(D9,"_classPrivateFieldInit");function R9(r,e,t){var n=O9(r,e,"set");return uj(r,n,t),t}o(R9,"_classPrivateFieldSet");function lj(r){return typeof r=="string"||Bt.isInstance(r)||it.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(lj,"keyToQuery");function Cv(r){return typeof r=="string"?dn.from(r).toString():Bt.isInstance(r)||it.isInstance(r)?r.toString():r.streamId.toString()}o(Cv,"keyToString");async function hj(r){let e=await ei.makeGenesis({},null,{...r,deterministic:!0}),t=await it.fromGenesis("tile",e);return{genesis:e,streamId:t}}o(hj,"getDeterministicQuery");var dj=o(()=>Promise.resolve([]),"tempBatchLoadFn"),xp=new WeakMap,kv=new WeakMap,Hl=class extends N9.default{cache(e){if(!Tv(this,kv))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,n){let i=await ei.create(Tv(this,xp),e,t,n);return this.cache(i),i}async deterministic(e,t){let n=await hj(e);try{return await super.load(n)}catch{let s=await ei.createFromGenesis(Tv(this,xp),n.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,n,i){let s=Cv(e);this.clear(s);let f=await this.load({streamId:s});return await f.update(t,n,i),f}constructor(e){super(dj,{cache:!0,cacheKeyFn:Cv,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),D9(this,xp,{writable:!0,value:void 0}),D9(this,kv,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(t.map(lj),e.multiqueryTimeout);return t.map(i=>{let s=Cv(i),f=n[s];return f||new Error(`Failed to load stream: ${s}`)})},R9(this,xp,e.ceramic),R9(this,kv,!!e.cache)}};o(Hl,"TileLoader");function Iv(r){return typeof r=="string"?it.fromString(r):r}o(Iv,"typeStreamID");function P9(r,e){let t=new URL(r);for(let[n,i]of Object.entries(e))it.isInstance(i)?t.searchParams.set(n,i.toString()):typeof i=="object"?t.searchParams.set(n,JSON.stringify(i)):t.searchParams.set(n,i);return t}o(P9,"serializeObjectToSearchParams");function Dv(r){let e={};for(let[t,n]of Object.entries(r))it.isInstance(n)?e[t]=n.toString():e[t]=n;return e}o(Dv,"serializeObjectForHttpPost");var an=class extends Yt{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=Ul(0,n).pipe(vv(()=>this._syncState(this.id,{sync:_r.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new jl(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let n=await an._load(e,this._apiUrl,t);this.state$.next(Qt.deserializeState(n))}get id(){return new it(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,n,i,s){let f=new URL("./streams",e),{state:u}=await Vr(f,{method:"post",body:{type:t,genesis:Qt.serializeCommit(n),opts:i}});return new an(Qt.deserializeState(u),e,s)}static async applyCommit(e,t,n,i,s){let f=new URL("./commits",e),{state:u}=await Vr(f,{method:"post",body:{streamId:t.toString(),commit:Qt.serializeCommit(n),opts:i}});return new an(Qt.deserializeState(u),e,s)}static async _load(e,t,n){let i=P9(new URL(`./streams/${e}`,t),n),{state:s}=await Vr(i);return s}static async load(e,t,n,i){let s=await an._load(e,t,i);return new an(Qt.deserializeState(s),t,n)}static async loadStreamCommits(e,t){let n=new URL(`./commits/${e}`,t),{commits:i}=await Vr(n);return i.map(s=>({cid:s.cid,value:Qt.deserializeCommit(s.value)}))}complete(){this.state$.complete()}};o(an,"Document");var Ef;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC",r[r.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(Ef||(Ef={}));var Rv=Ft(Vc(),1);var B9;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(B9||(B9={}));var Ov;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})(Ov||(Ov={}));var zl=class extends Yt{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new it(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,Rv.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Bt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Bt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Ov.ANCHOR).map(({cid:e})=>Bt.make(this.id,e))}get state(){return(0,Rv.default)(this.state$.value)}async sync(e={}){e={sync:Ef.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(zl,"Stream");function L9(){return r=>{}}o(L9,"StreamStatic");function U9(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new na({address:e,chainId:t})}return new na(r)}o(U9,"normalizeAccountId");var pj="(?:%[0-9a-fA-F]{2})",F9=`(?:[a-zA-Z0-9._-]|${pj})`,mj="([a-z0-9]+)",bj=`((?:${F9}*:)*(${F9}+))`,$9="[a-zA-Z0-9_.:%-]",gj=`;${$9}+=${$9}*`,vj=`((${gj})*)`,yj="(/[^#?]*)?",xj="([?][^#]*)?",wj="(#.*)?",_j=new RegExp(`^did:${mj}:${bj}${vj}${yj}${xj}${wj}$`);function q9(r){if(r===""||!r)return null;let e=r.match(_j);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(q9,"parse");var H9=Ft(Vc(),1);var Ej=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Af,Nv=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),j9={anchor:!1,publish:!0,sync:Ef.PREFER_CACHE},Pv={anchor:!0,publish:!0},Aj={sync:Ef.PREFER_CACHE},Sf=Af=o(class extends zl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:t}=this.state$.value;return(0,H9.default)(e?.metadata??t)}get controllers(){return this.metadata.controllers}static async fromAccount(e,t,n={}){n={...j9,...n};let i=U9(t),s=Af.makeGenesis(i);return Af.fromGenesis(e,s,n)}static async fromGenesis(e,t,n={}){return n={...j9,...n},e.createStreamFromGenesis(Af.STREAM_TYPE_ID,t,n)}async setDid(e,t,n={}){n={...Pv,...n};let i=typeof e=="string"?e.trim():e.id;if(q9(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let f=await t.createLink(i);return this.setDidProof(f,n)}async setDidProof(e,t={}){t={...Pv,...t};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,t);this.state$.next(i.state)}async clearDid(e,t={}){t={...Pv,...t};let n=await e.createLink("");return this.setDidProof(n,t)}static async load(e,t,n={}){n={...Aj,...n};let i=dn.from(t);if(i.type!=Af.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Af.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,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=Nv,this.setDid=Nv,this.sync=Nv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Sf.STREAM_TYPE_NAME="caip10-link";Sf.STREAM_TYPE_ID=1;Sf=Af=Ej([L9()],Sf);ji();Fa();var SA=Ft(EA(),1);var gH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ro,vH={sync:_r.PREFER_CACHE};async function AA(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(AA,"_ensureAuthenticated");async function yH(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(yH,"throwReadOnlyError");var ha=Ro=o(class extends xs{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Ro.MODEL}}static async create(e,t,n){Ro.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:_r.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Ro._makeGenesis(e,t,n);return await e.createStreamFromGenesis(Ro.STREAM_TYPE_ID,s,i)}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 async load(e,t,n={}){n={...vH,...n};let i=dn.from(t);if(i.type!=Ro.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ro.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return Ro._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await AA(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],model:Ro.MODEL.bytes};return{data:t,header:i}}makeReadOnly(){this.sync=yH,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,t){return await AA(e),e.did.createDagJWS(t)}},"Model");ha.STREAM_TYPE_NAME="model";ha.STREAM_TYPE_ID=2;ha.MODEL=function(){let r=rf("model-v1"),e=SA.default.encode(r,"identity"),t=ts(Mc,e),n=Ye.createV1(Mc,t);return new it("UNLOADABLE",n)}();ha=Ro=gH([nu()],ha);var CA=Ft(Ga(),1);var xH=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(s=(i<3?f(s):i>3?f(e,t,s):f(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},no,wH={anchor:!0,publish:!0,pin:!0,sync:_r.NEVER_SYNC,syncTimeoutSeconds:0},_H={anchor:!1,publish:!1,pin:!0,sync:_r.PREFER_CACHE},EH={sync:_r.PREFER_CACHE},MA={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function TA(r){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(await r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))}o(TA,"_ensureAuthenticated");async function Uv(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Uv,"throwReadOnlyError");var Tf=no=o(class extends xs{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 async create(e,t,n,i={}){i={...wH,...i};let s=i.asDID?{did:i.asDID}:e,f=await no._makeGenesis(s,t,n);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,f,i)}static async single(e,t,n={}){n={..._H,...n};let i=n.asDID?{did:n.asDID}:e;t={...t,deterministic:!0};let s=await no._makeGenesis(i,null,t);return e.createStreamFromGenesis(no.STREAM_TYPE_ID,s,n)}static async load(e,t,n={}){n={...EH,...n};let i=dn.from(t);if(i.type!=no.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${no.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,t={}){t={...MA,...t};let n=t.asDID?{did:t.asDID}:this.api,i=await this._makeCommit(n,e),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}async patch(e,t={}){t={...MA,...t};let n={data:e,prev:this.tip,id:this.id.cid},i=await no._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,i,t);this.state$.next(s.state)}makeReadOnly(){this.replace=Uv,this.patch=Uv,this.sync=Uv,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return no._signDagJWS(e,n)}_makeRawCommit(e){return{data:U0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,t,n){let i=await this._makeRawGenesis(e,t,n);return n.deterministic?(rf(i),i):no._signDagJWS(e,i)}static async _makeRawGenesis(e,t,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let i=n.controller;if(!i)if(e.did)await TA(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let s={controllers:[i],model:n.model.bytes};return n.deterministic||(s.unique=(0,CA.randomBytes)(12)),{data:t,header:s}}static async _signDagJWS(e,t){return await TA(e),e.did.createDagJWS(t)}},"ModelInstanceDocument");Tf.STREAM_TYPE_NAME="MID";Tf.STREAM_TYPE_ID=3;Tf=no=xH([nu()],Tf);var Gl=class{constructor(e){this._apiUrl=e}async add(e,t){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await Vr(i,{method:"post",body:n})}async rm(e,t){let n=new URL(`./pins/${e}`,this._apiUrl);await Vr(n,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await Vr(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(Gl,"RemotePinApi");var Wl=class{constructor(e){this._fetchJson=Vr,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:Dv(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:Dv(e)});return{edges:t.edges.map(i=>({cursor:i.cursor,node:Qt.deserializeState(i.node)})),pageInfo:t.pageInfo}}};o(Wl,"RemoteIndexApi");var Jl=class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=Vr,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,n){let i=n?{models:n.map(f=>f.toString())}:void 0,s=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${s.signatures[0].protected}.${s.payload}.${s.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(n=>it.fromString(n))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}};o(Jl,"RemoteAdminApi");var AH="/api/v0/",SH="http://localhost:7007",MH={syncInterval:5e3},TH={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},CH={anchor:!0,publish:!0,sync:_r.PREFER_CACHE},kA={sync:_r.PREFER_CACHE},Yl=class{constructor(e=SH,t={}){this._config={...MH,...t},this._apiUrl=new URL(AH,e),this._streamCache=new Map,this.context={api:this},this.pin=new Gl(this._apiUrl),this.index=new Wl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Jl(this._apiUrl,n),this._streamConstructors={[Sf.STREAM_TYPE_ID]:Sf,[ha.STREAM_TYPE_ID]:ha,[Tf.STREAM_TYPE_ID]:Tf,[ei.STREAM_TYPE_ID]:ei}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,n={}){n={...CH,...n};let i=await an.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),s=this._streamCache.get(i.id.toString());return s?(Qt.statesEqual(i.state,s.state)||s.next(i.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,t={}){t={...kA,...t};let n=dn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,t):(i=await an.load(n,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,t){let n=e.map(f=>({...f,streamId:typeof f.streamId=="string"?f.streamId:f.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=await Vr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((f,u)=>{let[d,y]=u,w=Qt.deserializeState(y),A=new an(w,this._apiUrl,this._config.syncInterval);return f[d]=this.buildStreamFromDocument(A),f},{})}loadStreamCommits(e){let t=Iv(e);return an.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,n={}){n={...TH,...n};let i=Iv(e),s=await an.applyCommit(this._apiUrl,i,t,n,this._config.syncInterval),f=this._streamCache.get(i.toString());return f?(f.next(s.state),this.buildStreamFromDocument(s)):(this._streamCache.set(i.toString(),s),this.buildStreamFromDocument(s))}async requestAnchor(e,t={}){t={...kA,...t};let{anchorStatus:n}=await Vr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new an(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)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await Vr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Yl,"CeramicClient");var Lt;(function(r){r.assertEqual=i=>i;function e(i){}o(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}o(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let s={};for(let f of i)s[f]=f;return s},r.getValidEnumValues=i=>{let s=r.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),f={};for(let u of s)f[u]=i[u];return r.objectValues(f)},r.objectValues=i=>r.objectKeys(i).map(function(s){return i[s]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let f in i)Object.prototype.hasOwnProperty.call(i,f)&&s.push(f);return s},r.find=(i,s)=>{for(let f of i)if(s(f))return f},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(f=>typeof f=="string"?`'${f}'`:f).join(s)}o(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Lt||(Lt={}));var $v;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})($v||($v={}));var je=Lt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),da=o(r=>{switch(typeof r){case"undefined":return je.undefined;case"string":return je.string;case"number":return isNaN(r)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(r)?je.array:r===null?je.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?je.promise:typeof Map<"u"&&r instanceof Map?je.map:typeof Set<"u"&&r instanceof Set?je.set:typeof Date<"u"&&r instanceof Date?je.date:je.object;default:return je.unknown}},"getParsedType"),Oe=Lt.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","not_finite"]),kH=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),fn=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 f of s.issues)if(f.code==="invalid_union")f.unionErrors.map(i);else if(f.code==="invalid_return_type")i(f.returnTypeError);else if(f.code==="invalid_arguments")i(f.argumentsError);else if(f.path.length===0)n._errors.push(t(f));else{let u=n,d=0;for(;d<f.path.length;){let y=f.path[d];d===f.path.length-1?(u[y]=u[y]||{_errors:[]},u[y]._errors.push(t(f))):u[y]=u[y]||{_errors:[]},u=u[y],d++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof fn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Lt.jsonStringifyReplacer,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(fn,"ZodError");fn.create=r=>new fn(r);var lu=o((r,e)=>{let t;switch(r.code){case Oe.invalid_type:r.received===je.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Lt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${Lt.joinValues(r.keys,", ")}`;break;case Oe.invalid_union:t="Invalid input";break;case Oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Lt.joinValues(r.options)}`;break;case Oe.invalid_enum_value:t=`Invalid enum value. Expected ${Lt.joinValues(r.options)}, received '${r.received}'`;break;case Oe.invalid_arguments:t="Invalid function arguments";break;case Oe.invalid_return_type:t="Invalid function return type";break;case Oe.invalid_date:t="Invalid date";break;case Oe.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:Lt.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Oe.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case Oe.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case Oe.custom:t="Invalid input";break;case Oe.invalid_intersection_types:t="Intersection results could not be merged";break;case Oe.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case Oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,Lt.assertNever(r)}return{message:t}},"errorMap"),RA=lu;function IH(r){RA=r}o(IH,"setErrorMap");function Sp(){return RA}o(Sp,"getErrorMap");var Mp=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],f={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let u="",d=n.filter(y=>!!y).slice().reverse();for(let y of d)u=y(f,{data:e,defaultError:u}).message;return{...i,path:s,message:u}},"makeIssue"),DH=[];function $e(r,e){let t=Sp(),n=Mp({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===lu?void 0:lu].filter(i=>!!i)});r.common.issues.push(n)}o($e,"addIssueToContext");var Tr=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 gt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let s=await i.key,f=await i.value;n.push({key:s,value:f})}return Tr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:f}=i;if(s.status==="aborted"||f.status==="aborted")return gt;s.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof f.value<"u"||i.alwaysSet)&&(n[s.value]=f.value)}return{status:e.value,value:n}}};o(Tr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),cu=o(r=>({status:"dirty",value:r}),"DIRTY"),pn=o(r=>({status:"valid",value:r}),"OK"),qv=o(r=>r.status==="aborted","isAborted"),jv=o(r=>r.status==="dirty","isDirty"),Ql=o(r=>r.status==="valid","isValid"),eh=o(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Tp(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)}o(Tp,"__classPrivateFieldGet");function OA(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}o(OA,"__classPrivateFieldSet");var Ge;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(Ge||(Ge={}));var Zl,Xl,ti=class{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(ti,"ParseInputLazyPath");var IA=o((r,e)=>{if(Ql(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new fn(r.common.issues);return this._error=t,this._error}}},"handleResult");function At(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_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((f,u)=>{var d,y;let{message:w}=r;return f.code==="invalid_enum_value"?{message:w??u.defaultError}:typeof u.data>"u"?{message:(d=w??n)!==null&&d!==void 0?d:u.defaultError}:f.code!=="invalid_type"?{message:u.defaultError}:{message:(y=w??t)!==null&&y!==void 0?y:u.defaultError}},"customMap"),description:i}}o(At,"processCreateParams");var _t=class{constructor(e){this.spa=this.safeParseAsync,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.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return da(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:da(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tr,ctx:{common:e.parent.common,data:e.data,parsedType:da(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(eh(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?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:da(e)},s=this._parseSync({data:e,path:i.path,parent:i});return IA(i,s)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:da(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(eh(i)?i:Promise.resolve(i));return IA(n,s)}refine(e,t){let n=o(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let f=e(i),u=o(()=>s.addIssue({code:Oe.custom,...n(i)}),"setError");return typeof Promise<"u"&&f instanceof Promise?f.then(d=>d?!0:(u(),!1)):f?!0:(u(),!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 Nn({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ni.create(this,this._def)}nullable(){return ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return On.create(this,this._def)}promise(){return Ms.create(this,this._def)}or(e){return ga.create([this,e],this._def)}and(e){return va.create(this,e,this._def)}transform(e){return new Nn({...At(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ea({...At(this._def),innerType:this,defaultValue:t,typeName:ot.ZodDefault})}brand(){return new uu({typeName:ot.ZodBranded,type:this,...At(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Aa({...At(this._def),innerType:this,catchValue:t,typeName:ot.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Sa.create(this,e)}readonly(){return Ma.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(_t,"ZodType");var RH=/^c[^\s-]{8,}$/i,OH=/^[0-9a-z]+$/,NH=/^[0-9A-HJKMNP-TV-Z]{26}$/,PH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,BH=/^[a-z0-9_-]{21}$/i,LH=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,UH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Fv,$H=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qH=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,jH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HH=new RegExp(`^${NA}$`);function PA(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}o(PA,"timeRegexSource");function zH(r){return new RegExp(`^${PA(r)}$`)}o(zH,"timeRegex");function BA(r){let e=`${NA}T${PA(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}o(BA,"datetimeRegex");function KH(r,e){return!!((e==="v4"||!e)&&$H.test(r)||(e==="v6"||!e)&&qH.test(r))}o(KH,"isValidIP");var Rn=class extends _t{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.string,received:s.parsedType}),gt}let n=new Tr,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let f=e.data.length>s.value,u=e.data.length<s.value;(f||u)&&(i=this._getOrReturnCtx(e,i),f?$e(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&$e(i,{code:Oe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")UH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"email",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Fv||(Fv=new RegExp(FH,"u")),Fv.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"emoji",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")PH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"uuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")BH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"nanoid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")RH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")OH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"cuid2",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")NH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ulid",code:Oe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),$e(i,{validation:"url",code:Oe.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),$e(i,{validation:"regex",code:Oe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?BA(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?HH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?zH(s).test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?LH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"duration",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?KH(e.data,s.version)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"ip",code:Oe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?jH.test(e.data)||(i=this._getOrReturnCtx(e,i),$e(i,{validation:"base64",code:Oe.invalid_string,message:s.message}),n.dirty()):Lt.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:Oe.invalid_string,...Ge.errToObj(n)})}_addCheck(e){return new Rn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Ge.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Ge.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ge.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ge.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ge.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ge.errToObj(t)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new Rn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};o(Rn,"ZodString");Rn.create=r=>{var e;return new Rn({checks:[],typeName:ot.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...At(r)})};function VH(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(".","")),f=parseInt(e.toFixed(i).replace(".",""));return s%f/Math.pow(10,i)}o(VH,"floatSafeRemainder");var io=class extends _t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==je.number){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.number,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="int"?Lt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.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),$e(n,{code:Oe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?VH(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_finite,message:s.message}),i.dirty()):Lt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new io({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new io({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(e)})}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"||e.kind==="multipleOf"&&Lt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};o(io,"ZodNumber");io.create=r=>new io({checks:[],typeName:ot.ZodNumber,coerce:r?.coerce||!1,...At(r)});var oo=class extends _t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==je.bigint){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.bigint,received:s.parsedType}),gt}let n,i=new Tr;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.too_small,type:"bigint",minimum:s.value,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),$e(n,{code:Oe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),$e(n,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Lt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,i){return new oo({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(i)}]})}_addCheck(e){return new oo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.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}};o(oo,"ZodBigInt");oo.create=r=>{var e;return new oo({checks:[],typeName:ot.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...At(r)})};var pa=class extends _t{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==je.boolean){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.boolean,received:n.parsedType}),gt}return pn(e.data)}};o(pa,"ZodBoolean");pa.create=r=>new pa({typeName:ot.ZodBoolean,coerce:r?.coerce||!1,...At(r)});var Oo=class extends _t{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_type,expected:je.date,received:s.parsedType}),gt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return $e(s,{code:Oe.invalid_date}),gt}let n=new Tr,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),$e(i,{code:Oe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Lt.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Oo({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};o(Oo,"ZodDate");Oo.create=r=>new Oo({checks:[],coerce:r?.coerce||!1,typeName:ot.ZodDate,...At(r)});var Cf=class extends _t{_parse(e){if(this._getType(e)!==je.symbol){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.symbol,received:n.parsedType}),gt}return pn(e.data)}};o(Cf,"ZodSymbol");Cf.create=r=>new Cf({typeName:ot.ZodSymbol,...At(r)});var ma=class extends _t{_parse(e){if(this._getType(e)!==je.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.undefined,received:n.parsedType}),gt}return pn(e.data)}};o(ma,"ZodUndefined");ma.create=r=>new ma({typeName:ot.ZodUndefined,...At(r)});var ba=class extends _t{_parse(e){if(this._getType(e)!==je.null){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.null,received:n.parsedType}),gt}return pn(e.data)}};o(ba,"ZodNull");ba.create=r=>new ba({typeName:ot.ZodNull,...At(r)});var As=class extends _t{constructor(){super(...arguments),this._any=!0}_parse(e){return pn(e.data)}};o(As,"ZodAny");As.create=r=>new As({typeName:ot.ZodAny,...At(r)});var No=class extends _t{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pn(e.data)}};o(No,"ZodUnknown");No.create=r=>new No({typeName:ot.ZodUnknown,...At(r)});var Ni=class extends _t{_parse(e){let t=this._getOrReturnCtx(e);return $e(t,{code:Oe.invalid_type,expected:je.never,received:t.parsedType}),gt}};o(Ni,"ZodNever");Ni.create=r=>new Ni({typeName:ot.ZodNever,...At(r)});var kf=class extends _t{_parse(e){if(this._getType(e)!==je.undefined){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.void,received:n.parsedType}),gt}return pn(e.data)}};o(kf,"ZodVoid");kf.create=r=>new kf({typeName:ot.ZodVoid,...At(r)});var On=class extends _t{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==je.array)return $e(t,{code:Oe.invalid_type,expected:je.array,received:t.parsedType}),gt;if(i.exactLength!==null){let f=t.data.length>i.exactLength.value,u=t.data.length<i.exactLength.value;(f||u)&&($e(t,{code:f?Oe.too_big:Oe.too_small,minimum:u?i.exactLength.value:void 0,maximum:f?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&($e(t,{code:Oe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&($e(t,{code:Oe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((f,u)=>i.type._parseAsync(new ti(t,f,t.path,u)))).then(f=>Tr.mergeArray(n,f));let s=[...t.data].map((f,u)=>i.type._parseSync(new ti(t,f,t.path,u)));return Tr.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new On({...this._def,minLength:{value:e,message:Ge.toString(t)}})}max(e,t){return new On({...this._def,maxLength:{value:e,message:Ge.toString(t)}})}length(e,t){return new On({...this._def,exactLength:{value:e,message:Ge.toString(t)}})}nonempty(e){return this.min(1,e)}};o(On,"ZodArray");On.create=(r,e)=>new On({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...At(e)});function fu(r){if(r instanceof sr){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=ni.create(fu(n))}return new sr({...r._def,shape:()=>e})}else return r instanceof On?new On({...r._def,type:fu(r.element)}):r instanceof ni?ni.create(fu(r.unwrap())):r instanceof ao?ao.create(fu(r.unwrap())):r instanceof ri?ri.create(r.items.map(e=>fu(e))):r}o(fu,"deepPartialify");var sr=class extends _t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Lt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==je.object){let y=this._getOrReturnCtx(e);return $e(y,{code:Oe.invalid_type,expected:je.object,received:y.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:f}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ni&&this._def.unknownKeys==="strip"))for(let y in i.data)f.includes(y)||u.push(y);let d=[];for(let y of f){let w=s[y],A=i.data[y];d.push({key:{status:"valid",value:y},value:w._parse(new ti(i,A,i.path,y)),alwaysSet:y in i.data})}if(this._def.catchall instanceof Ni){let y=this._def.unknownKeys;if(y==="passthrough")for(let w of u)d.push({key:{status:"valid",value:w},value:{status:"valid",value:i.data[w]}});else if(y==="strict")u.length>0&&($e(i,{code:Oe.unrecognized_keys,keys:u}),n.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let y=this._def.catchall;for(let w of u){let A=i.data[w];d.push({key:{status:"valid",value:w},value:y._parse(new ti(i,A,i.path,w)),alwaysSet:w in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let y=[];for(let w of d){let A=await w.key,O=await w.value;y.push({key:A,value:O,alwaysSet:w.alwaysSet})}return y}).then(y=>Tr.mergeObjectSync(n,y)):Tr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new sr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,s,f,u;let d=(f=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&f!==void 0?f:n.defaultError;return t.code==="unrecognized_keys"?{message:(u=Ge.errToObj(e).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(e){return new sr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new sr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new sr({...this._def,catchall:e})}pick(e){let t={};return Lt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}omit(e){let t={};return Lt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new sr({...this._def,shape:()=>t})}deepPartial(){return fu(this)}partial(e){let t={};return Lt.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new sr({...this._def,shape:()=>t})}required(e){let t={};return Lt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ni;)s=s._def.innerType;t[n]=s}}),new sr({...this._def,shape:()=>t})}keyof(){return LA(Lt.objectKeys(this.shape))}};o(sr,"ZodObject");sr.create=(r,e)=>new sr({shape:()=>r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...At(e)});sr.strictCreate=(r,e)=>new sr({shape:()=>r,unknownKeys:"strict",catchall:Ni.create(),typeName:ot.ZodObject,...At(e)});sr.lazycreate=(r,e)=>new sr({shape:r,unknownKeys:"strip",catchall:Ni.create(),typeName:ot.ZodObject,...At(e)});var ga=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let u of s)if(u.result.status==="valid")return u.result;for(let u of s)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;let f=s.map(u=>new fn(u.ctx.common.issues));return $e(t,{code:Oe.invalid_union,unionErrors:f}),gt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(async s=>{let f={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:f}),ctx:f}})).then(i);{let s,f=[];for(let d of n){let y={...t,common:{...t.common,issues:[]},parent:null},w=d._parseSync({data:t.data,path:t.path,parent:y});if(w.status==="valid")return w;w.status==="dirty"&&!s&&(s={result:w,ctx:y}),y.common.issues.length&&f.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let u=f.map(d=>new fn(d));return $e(t,{code:Oe.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ga,"ZodUnion");ga.create=(r,e)=>new ga({options:r,typeName:ot.ZodUnion,...At(e)});var Es=o(r=>r instanceof xa?Es(r.schema):r instanceof Nn?Es(r.innerType()):r instanceof wa?[r.value]:r instanceof so?r.options:r instanceof _a?Lt.objectValues(r.enum):r instanceof Ea?Es(r._def.innerType):r instanceof ma?[void 0]:r instanceof ba?[null]:r instanceof ni?[void 0,...Es(r.unwrap())]:r instanceof ao?[null,...Es(r.unwrap())]:r instanceof uu||r instanceof Ma?Es(r.unwrap()):r instanceof Aa?Es(r._def.innerType):[],"getDiscriminator"),If=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==je.object)return $e(t,{code:Oe.invalid_type,expected:je.object,received:t.parsedType}),gt;let n=this.discriminator,i=t.data[n],s=this.optionsMap.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}):($e(t,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let s of t){let f=Es(s.shape[e]);if(!f.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of f){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,s)}}return new If({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...At(n)})}};o(If,"ZodDiscriminatedUnion");function Hv(r,e){let t=da(r),n=da(e);if(r===e)return{valid:!0,data:r};if(t===je.object&&n===je.object){let i=Lt.objectKeys(e),s=Lt.objectKeys(r).filter(u=>i.indexOf(u)!==-1),f={...r,...e};for(let u of s){let d=Hv(r[u],e[u]);if(!d.valid)return{valid:!1};f[u]=d.data}return{valid:!0,data:f}}else if(t===je.array&&n===je.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let f=r[s],u=e[s],d=Hv(f,u);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===je.date&&n===je.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(Hv,"mergeValues");var va=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,f)=>{if(qv(s)||qv(f))return gt;let u=Hv(s.value,f.value);return u.valid?((jv(s)||jv(f))&&t.dirty(),{status:t.value,value:u.data}):($e(n,{code:Oe.invalid_intersection_types}),gt)},"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,f])=>i(s,f)):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(va,"ZodIntersection");va.create=(r,e,t)=>new va({left:r,right:e,typeName:ot.ZodIntersection,...At(t)});var ri=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==je.array)return $e(n,{code:Oe.invalid_type,expected:je.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return $e(n,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&($e(n,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...n.data].map((f,u)=>{let d=this._def.items[u]||this._def.rest;return d?d._parse(new ti(n,f,n.path,u)):null}).filter(f=>!!f);return n.common.async?Promise.all(s).then(f=>Tr.mergeArray(t,f)):Tr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ri({...this._def,rest:e})}};o(ri,"ZodTuple");ri.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ri({items:r,typeName:ot.ZodTuple,rest:null,...At(e)})};var ya=class extends _t{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!==je.object)return $e(n,{code:Oe.invalid_type,expected:je.object,received:n.parsedType}),gt;let i=[],s=this._def.keyType,f=this._def.valueType;for(let u in n.data)i.push({key:s._parse(new ti(n,u,n.path,u)),value:f._parse(new ti(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?Tr.mergeObjectAsync(t,i):Tr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _t?new ya({keyType:e,valueType:t,typeName:ot.ZodRecord,...At(n)}):new ya({keyType:Rn.create(),valueType:e,typeName:ot.ZodRecord,...At(t)})}};o(ya,"ZodRecord");var Df=class extends _t{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!==je.map)return $e(n,{code:Oe.invalid_type,expected:je.map,received:n.parsedType}),gt;let i=this._def.keyType,s=this._def.valueType,f=[...n.data.entries()].map(([u,d],y)=>({key:i._parse(new ti(n,u,n.path,[y,"key"])),value:s._parse(new ti(n,d,n.path,[y,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let d of f){let y=await d.key,w=await d.value;if(y.status==="aborted"||w.status==="aborted")return gt;(y.status==="dirty"||w.status==="dirty")&&t.dirty(),u.set(y.value,w.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let d of f){let y=d.key,w=d.value;if(y.status==="aborted"||w.status==="aborted")return gt;(y.status==="dirty"||w.status==="dirty")&&t.dirty(),u.set(y.value,w.value)}return{status:t.value,value:u}}}};o(Df,"ZodMap");Df.create=(r,e,t)=>new Df({valueType:e,keyType:r,typeName:ot.ZodMap,...At(t)});var Po=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==je.set)return $e(n,{code:Oe.invalid_type,expected:je.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&($e(n,{code:Oe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&($e(n,{code:Oe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function f(d){let y=new Set;for(let w of d){if(w.status==="aborted")return gt;w.status==="dirty"&&t.dirty(),y.add(w.value)}return{status:t.value,value:y}}o(f,"finalizeSet");let u=[...n.data.values()].map((d,y)=>s._parse(new ti(n,d,n.path,y)));return n.common.async?Promise.all(u).then(d=>f(d)):f(u)}min(e,t){return new Po({...this._def,minSize:{value:e,message:Ge.toString(t)}})}max(e,t){return new Po({...this._def,maxSize:{value:e,message:Ge.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Po,"ZodSet");Po.create=(r,e)=>new Po({valueType:r,minSize:null,maxSize:null,typeName:ot.ZodSet,...At(e)});var Ss=class extends _t{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==je.function)return $e(t,{code:Oe.invalid_type,expected:je.function,received:t.parsedType}),gt;function n(u,d){return Mp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sp(),lu].filter(y=>!!y),issueData:{code:Oe.invalid_arguments,argumentsError:d}})}o(n,"makeArgsIssue");function i(u,d){return Mp({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Sp(),lu].filter(y=>!!y),issueData:{code:Oe.invalid_return_type,returnTypeError:d}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},f=t.data;if(this._def.returns instanceof Ms){let u=this;return pn(async function(...d){let y=new fn([]),w=await u._def.args.parseAsync(d,s).catch(R=>{throw y.addIssue(n(d,R)),y}),A=await Reflect.apply(f,this,w);return await u._def.returns._def.type.parseAsync(A,s).catch(R=>{throw y.addIssue(i(A,R)),y})})}else{let u=this;return pn(function(...d){let y=u._def.args.safeParse(d,s);if(!y.success)throw new fn([n(d,y.error)]);let w=Reflect.apply(f,this,y.data),A=u._def.returns.safeParse(w,s);if(!A.success)throw new fn([i(w,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ss({...this._def,args:ri.create(e).rest(No.create())})}returns(e){return new Ss({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ss({args:e||ri.create([]).rest(No.create()),returns:t||No.create(),typeName:ot.ZodFunction,...At(n)})}};o(Ss,"ZodFunction");var xa=class extends _t{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(xa,"ZodLazy");xa.create=(r,e)=>new xa({getter:r,typeName:ot.ZodLazy,...At(e)});var wa=class extends _t{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return $e(t,{received:t.data,code:Oe.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(wa,"ZodLiteral");wa.create=(r,e)=>new wa({value:r,typeName:ot.ZodLiteral,...At(e)});function LA(r,e){return new so({values:r,typeName:ot.ZodEnum,...At(e)})}o(LA,"createZodEnum");var so=class extends _t{constructor(){super(...arguments),Zl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{expected:Lt.joinValues(n),received:t.parsedType,code:Oe.invalid_type}),gt}if(Tp(this,Zl,"f")||OA(this,Zl,new Set(this._def.values),"f"),!Tp(this,Zl,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return $e(t,{received:t.data,code:Oe.invalid_enum_value,options:n}),gt}return pn(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}extract(e,t=this._def){return so.create(e,{...this._def,...t})}exclude(e,t=this._def){return so.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};o(so,"ZodEnum");Zl=new WeakMap;so.create=LA;var _a=class extends _t{constructor(){super(...arguments),Xl.set(this,void 0)}_parse(e){let t=Lt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==je.string&&n.parsedType!==je.number){let i=Lt.objectValues(t);return $e(n,{expected:Lt.joinValues(i),received:n.parsedType,code:Oe.invalid_type}),gt}if(Tp(this,Xl,"f")||OA(this,Xl,new Set(Lt.getValidEnumValues(this._def.values)),"f"),!Tp(this,Xl,"f").has(e.data)){let i=Lt.objectValues(t);return $e(n,{received:n.data,code:Oe.invalid_enum_value,options:i}),gt}return pn(e.data)}get enum(){return this._def.values}};o(_a,"ZodNativeEnum");Xl=new WeakMap;_a.create=(r,e)=>new _a({values:r,typeName:ot.ZodNativeEnum,...At(e)});var Ms=class extends _t{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==je.promise&&t.common.async===!1)return $e(t,{code:Oe.invalid_type,expected:je.promise,received:t.parsedType}),gt;let n=t.parsedType===je.promise?t.data:Promise.resolve(t.data);return pn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(Ms,"ZodPromise");Ms.create=(r,e)=>new Ms({type:r,typeName:ot.ZodPromise,...At(e)});var Nn=class extends _t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:f=>{$e(n,f),f.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let f=i.transform(n.data,s);if(n.common.async)return Promise.resolve(f).then(async u=>{if(t.value==="aborted")return gt;let d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?gt:d.status==="dirty"||t.value==="dirty"?cu(d.value):d});{if(t.value==="aborted")return gt;let u=this._def.schema._parseSync({data:f,path:n.path,parent:n});return u.status==="aborted"?gt:u.status==="dirty"||t.value==="dirty"?cu(u.value):u}}if(i.type==="refinement"){let f=o(u=>{let d=i.refinement(u,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?gt:(u.status==="dirty"&&t.dirty(),f(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?gt:(u.status==="dirty"&&t.dirty(),f(u.value).then(()=>({status:t.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ql(f))return f;let u=i.transform(f.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>Ql(f)?Promise.resolve(i.transform(f.value,s)).then(u=>({status:t.value,value:u})):f);Lt.assertNever(i)}};o(Nn,"ZodEffects");Nn.create=(r,e,t)=>new Nn({schema:r,typeName:ot.ZodEffects,effect:e,...At(t)});Nn.createWithPreprocess=(r,e,t)=>new Nn({schema:e,effect:{type:"preprocess",transform:r},typeName:ot.ZodEffects,...At(t)});var ni=class extends _t{_parse(e){return this._getType(e)===je.undefined?pn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ni,"ZodOptional");ni.create=(r,e)=>new ni({innerType:r,typeName:ot.ZodOptional,...At(e)});var ao=class extends _t{_parse(e){return this._getType(e)===je.null?pn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(ao,"ZodNullable");ao.create=(r,e)=>new ao({innerType:r,typeName:ot.ZodNullable,...At(e)});var Ea=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===je.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Ea,"ZodDefault");Ea.create=(r,e)=>new Ea({innerType:r,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...At(e)});var Aa=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return eh(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new fn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new fn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(Aa,"ZodCatch");Aa.create=(r,e)=>new Aa({innerType:r,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...At(e)});var Rf=class extends _t{_parse(e){if(this._getType(e)!==je.nan){let n=this._getOrReturnCtx(e);return $e(n,{code:Oe.invalid_type,expected:je.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(Rf,"ZodNaN");Rf.create=r=>new Rf({typeName:ot.ZodNaN,...At(r)});var GH=Symbol("zod_brand"),uu=class extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};o(uu,"ZodBranded");var Sa=class extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?gt:s.status==="dirty"?(t.dirty(),cu(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?gt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new Sa({in:e,out:t,typeName:ot.ZodPipeline})}};o(Sa,"ZodPipeline");var Ma=class extends _t{_parse(e){let t=this._def.innerType._parse(e),n=o(i=>(Ql(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return eh(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};o(Ma,"ZodReadonly");Ma.create=(r,e)=>new Ma({innerType:r,typeName:ot.ZodReadonly,...At(e)});function UA(r,e={},t){return r?As.create().superRefine((n,i)=>{var s,f;if(!r(n)){let u=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(f=(s=u.fatal)!==null&&s!==void 0?s:t)!==null&&f!==void 0?f:!0,y=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...y,fatal:d})}}):As.create()}o(UA,"custom");var WH={object:sr.lazycreate},ot;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",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.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(ot||(ot={}));var JH=o((r,e={message:`Input not instance of ${r.name}`})=>UA(t=>t instanceof r,e),"instanceOfType"),FA=Rn.create,$A=io.create,YH=Rf.create,ZH=oo.create,qA=pa.create,XH=Oo.create,QH=Cf.create,ez=ma.create,tz=ba.create,rz=As.create,nz=No.create,iz=Ni.create,oz=kf.create,sz=On.create,az=sr.create,fz=sr.strictCreate,cz=ga.create,uz=If.create,lz=va.create,hz=ri.create,dz=ya.create,pz=Df.create,mz=Po.create,bz=Ss.create,gz=xa.create,vz=wa.create,yz=so.create,xz=_a.create,wz=Ms.create,DA=Nn.create,_z=ni.create,Ez=ao.create,Az=Nn.createWithPreprocess,Sz=Sa.create,Mz=o(()=>FA().optional(),"ostring"),Tz=o(()=>$A().optional(),"onumber"),Cz=o(()=>qA().optional(),"oboolean"),kz={string:r=>Rn.create({...r,coerce:!0}),number:r=>io.create({...r,coerce:!0}),boolean:r=>pa.create({...r,coerce:!0}),bigint:r=>oo.create({...r,coerce:!0}),date:r=>Oo.create({...r,coerce:!0})},Iz=gt,m=Object.freeze({__proto__:null,defaultErrorMap:lu,setErrorMap:IH,getErrorMap:Sp,makeIssue:Mp,EMPTY_PATH:DH,addIssueToContext:$e,ParseStatus:Tr,INVALID:gt,DIRTY:cu,OK:pn,isAborted:qv,isDirty:jv,isValid:Ql,isAsync:eh,get util(){return Lt},get objectUtil(){return $v},ZodParsedType:je,getParsedType:da,ZodType:_t,datetimeRegex:BA,ZodString:Rn,ZodNumber:io,ZodBigInt:oo,ZodBoolean:pa,ZodDate:Oo,ZodSymbol:Cf,ZodUndefined:ma,ZodNull:ba,ZodAny:As,ZodUnknown:No,ZodNever:Ni,ZodVoid:kf,ZodArray:On,ZodObject:sr,ZodUnion:ga,ZodDiscriminatedUnion:If,ZodIntersection:va,ZodTuple:ri,ZodRecord:ya,ZodMap:Df,ZodSet:Po,ZodFunction:Ss,ZodLazy:xa,ZodLiteral:wa,ZodEnum:so,ZodNativeEnum:_a,ZodPromise:Ms,ZodEffects:Nn,ZodTransformer:Nn,ZodOptional:ni,ZodNullable:ao,ZodDefault:Ea,ZodCatch:Aa,ZodNaN:Rf,BRAND:GH,ZodBranded:uu,ZodPipeline:Sa,ZodReadonly:Ma,custom:UA,Schema:_t,ZodSchema:_t,late:WH,get ZodFirstPartyTypeKind(){return ot},coerce:kz,any:rz,array:sz,bigint:ZH,boolean:qA,date:XH,discriminatedUnion:uz,effect:DA,enum:yz,function:bz,instanceof:JH,intersection:lz,lazy:gz,literal:vz,map:pz,nan:YH,nativeEnum:xz,never:iz,null:tz,nullable:Ez,number:$A,object:az,oboolean:Cz,onumber:Tz,optional:_z,ostring:Mz,pipeline:Sz,preprocess:Az,promise:wz,record:dz,set:mz,strictObject:fz,string:FA,symbol:QH,transformer:DA,tuple:hz,undefined:ez,union:cz,unknown:nz,void:oz,NEVER:Iz,ZodIssueCode:Oe,quotelessJson:kH,ZodError:fn});var hu=Symbol("current"),Of=Symbol("previous");var th=o((r,{ref:e,refType:t,param:n,header:i,...s}={})=>({...s,...r}),"mergeOpenApi");function rh(r){if(typeof r.ZodType.prototype.openapi<"u")return;r.ZodType.prototype.openapi=function(s){let{zodOpenApi:f,...u}=this._def,d=new this.constructor({...u,zodOpenApi:{openapi:th(s,f?.openapi)}});return d._def.zodOpenApi[hu]=d,f&&(d._def.zodOpenApi[Of]=this),d};let e=r.ZodType.prototype.describe;r.ZodType.prototype.describe=function(...s){let f=e.apply(this,s),u=f._def;if(u.zodOpenApi){let d={...u.zodOpenApi};d.openapi=th({description:s[0]},d.openapi),d[Of]=this,d[hu]=f,u.zodOpenApi=d}else u.zodOpenApi={openapi:{description:s[0]},[hu]:f};return f};let t=r.ZodObject.prototype.extend;r.ZodObject.prototype.extend=function(...s){let f=t.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=th({},d.openapi),d[Of]=this,f._def.zodOpenApi=d}else f._def.zodOpenApi={[Of]:this};return f};let n=r.ZodObject.prototype.omit;r.ZodObject.prototype.omit=function(...s){let f=n.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=th({},d.openapi),delete d[Of],delete d[hu],f._def.zodOpenApi=d}return f};let i=r.ZodObject.prototype.pick;r.ZodObject.prototype.pick=function(...s){let f=i.apply(this,s),u=f._def.zodOpenApi;if(u){let d={...u};d.openapi=th({},d.openapi),delete d[Of],delete d[hu],f._def.zodOpenApi=d}return f}}o(rh,"extendZodWithOpenApi");rh(m);var Dz=Object.defineProperty,Rz=o((r,e)=>Dz(r,"name",{value:e,configurable:!0}),"__name"),kp=m.array(m.string().or(m.record(m.any()))),Zie=m.object({type:m.string().optional(),narrative:m.string().optional()}),Ip=m.string().or(m.object({id:m.string(),type:m.string(),caption:m.string().optional()})),Oz=m.object({type:m.string().min(1).or(m.string().array().nonempty()),latitude:m.number(),longitude:m.number()}),Nz=m.object({type:m.string().min(1).or(m.string().array().nonempty()),addressCountry:m.string().optional(),addressCountryCode:m.string().optional(),addressRegion:m.string().optional(),addressLocality:m.string().optional(),streetAddress:m.string().optional(),postOfficeBoxNumber:m.string().optional(),postalCode:m.string().optional(),geo:Oz.optional()}),Pz=m.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(m.string()),e7=m.object({type:m.string().min(1).or(m.string().array().nonempty()),identifier:m.string(),identifierType:Pz}),nh=m.string().or(m.object({id:m.string().optional(),type:m.string().or(m.string().array().nonempty().optional()),name:m.string().optional(),url:m.string().optional(),phone:m.string().optional(),description:m.string().optional(),endorsement:m.any().array().optional(),image:Ip.optional(),email:m.string().email().optional(),address:Nz.optional(),otherIdentifier:e7.array().optional(),official:m.string().optional(),parentOrg:m.any().optional(),familyName:m.string().optional(),givenName:m.string().optional(),additionalName:m.string().optional(),patronymicName:m.string().optional(),honorificPrefix:m.string().optional(),honorificSuffix:m.string().optional(),familyNamePrefix:m.string().optional(),dateOfBirth:m.string().optional()}).catchall(m.any())),Kv=m.object({id:m.string().optional()}).catchall(m.any()),Cp=m.object({type:m.string(),id:m.string()}).catchall(m.any()),jA=m.object({id:m.string(),type:m.string()}).catchall(m.any()),HA=m.object({id:m.string().optional(),type:m.string()}).catchall(m.any()),zA=m.object({type:m.string(),id:m.string().optional()}).catchall(m.any()),KA=m.object({id:m.string().optional(),type:m.array(m.string()).nonempty(),name:m.string().optional(),narrative:m.string().optional(),description:m.string().optional(),genre:m.string().optional(),audience:m.string().optional()}).catchall(m.any()),du=m.object({"@context":kp,id:m.string().optional(),type:m.string().array().nonempty(),issuer:nh,credentialSubject:Kv.or(Kv.array()),refreshService:HA.or(HA.array()).optional(),credentialSchema:jA.or(jA.array()).optional(),issuanceDate:m.string().optional(),expirationDate:m.string().optional(),credentialStatus:Cp.or(Cp.array()).optional(),name:m.string().optional(),description:m.string().optional(),validFrom:m.string().optional(),validUntil:m.string().optional(),status:Cp.or(Cp.array()).optional(),termsOfUse:zA.or(zA.array()).optional(),evidence:m.union([KA,m.array(KA)]).optional()}).catchall(m.any()),Bo=m.object({type:m.string(),created:m.string(),challenge:m.string().optional(),domain:m.string().optional(),nonce:m.string().optional(),proofPurpose:m.string(),verificationMethod:m.string(),jws:m.string().optional()}).catchall(m.any()),Pf=du.extend({proof:Bo.or(Bo.array())}),Bz=m.object({"@context":kp,id:m.string().optional(),type:m.string().or(m.string().array().nonempty()),verifiableCredential:Pf.or(Pf.array()).optional(),holder:m.string().optional()}).catchall(m.any()),oh=Bz.extend({proof:Bo.or(Bo.array())}),Wv=m.object({kty:m.string(),crv:m.string(),x:m.string(),y:m.string().optional(),n:m.string().optional(),d:m.string().optional()}),eoe=Wv.omit({d:!0}).extend({d:m.string()}),Lz=m.object({alg:m.string(),iv:m.string(),tag:m.string(),epk:Wv.partial().optional(),kid:m.string().optional(),apv:m.string().optional(),apu:m.string().optional()}),Uz=m.object({header:Lz,encrypted_key:m.string()}),Fz=m.object({protected:m.string(),iv:m.string(),ciphertext:m.string(),tag:m.string(),aad:m.string().optional(),recipients:Uz.array().optional()}),Nf=m.string().or(m.object({"@context":kp.optional(),id:m.string(),type:m.string(),controller:m.string(),publicKeyJwk:Wv.optional(),publicKeyBase58:m.string().optional(),publicKeyMultibase:m.string().optional(),blockChainAccountId:m.string().optional()}).catchall(m.any())),$z=m.object({id:m.string(),type:m.string().or(m.string().array().nonempty()),serviceEndpoint:m.any().or(m.any().array().nonempty())}).catchall(m.any()),toe=m.object({"@context":kp,id:m.string(),alsoKnownAs:m.string().optional(),controller:m.string().or(m.string().array().nonempty()).optional(),verificationMethod:Nf.array().optional(),authentication:Nf.array().optional(),assertionMethod:Nf.array().optional(),keyAgreement:Nf.array().optional(),capabilityInvocation:Nf.array().optional(),capabilityDelegation:Nf.array().optional(),publicKey:Nf.array().optional(),service:$z.array().optional(),proof:Bo.or(Bo.array()).optional()}).catchall(m.any()),qz=m.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(m.string()),Dp=m.object({type:m.string().array().nonempty(),targetCode:m.string().optional(),targetDescription:m.string().optional(),targetName:m.string(),targetFramework:m.string().optional(),targetType:qz.optional(),targetUrl:m.string()}),jz=m.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"]),Hz=jz.or(m.string()),zz=m.object({id:m.string().optional(),narrative:m.string().optional()}).catchall(m.any()),Kz=m.object({id:m.string(),type:m.string().array().nonempty(),endorsementComment:m.string().optional()}),Vz=du.extend({credentialSubject:Kz,proof:Bo.or(Bo.array()).optional()}),Gz=m.object({id:m.string(),"@language":m.string().optional(),version:m.string().optional()}),Wz=m.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(m.string()),Jz=m.object({id:m.string(),type:m.string().array().nonempty(),alignment:Dp.array().optional(),description:m.string().optional(),level:m.string().optional(),name:m.string(),points:m.string().optional()}).catchall(m.any()),Yz=m.object({id:m.string(),type:m.string().array().nonempty(),alignment:Dp.array().optional(),allowedValue:m.string().array().optional(),name:m.string(),requiredLevel:m.string().optional(),requiredValue:m.string().optional(),resultType:Wz,rubricCriterionLevel:Jz.array().optional(),valueMax:m.string().optional(),valueMin:m.string().optional()}).catchall(m.any()),noe=m.object({id:m.string().optional(),type:m.array(m.string()).nonempty(),name:m.string().optional(),narrative:m.string().optional(),description:m.string().optional(),genre:m.string().optional(),audience:m.string().optional()}).catchall(m.any()),Zz=m.object({id:m.string().optional(),type:m.array(m.string()).nonempty(),alignment:Dp.array().optional(),achievementType:Hz.optional(),creator:nh.optional(),creditsAvailable:m.number().optional(),criteria:zz,description:m.string(),endorsement:Vz.array().optional(),fieldOfStudy:m.string().optional(),humanCode:m.string().optional(),image:Ip.optional(),"@language":m.string().optional(),name:m.string(),otherIdentifier:e7.array().optional(),related:Gz.array().optional(),resultDescription:Yz.array().optional(),specialization:m.string().optional(),tag:m.array(m.string()).optional(),version:m.string().optional()}).catchall(m.any()),Xz=m.object({type:m.string(),hashed:m.boolean(),identityHash:m.string(),identityType:m.string(),salt:m.string().optional()}),Qz=m.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),eK=m.object({type:m.string().array().nonempty(),achievedLevel:m.string().optional(),alignment:Dp.array().optional(),resultDescription:m.string().optional(),status:Qz.optional(),value:m.string().optional()}).catchall(m.any()),VA=m.object({id:m.string().optional(),type:m.string().array().nonempty(),activityEndDate:m.string().optional(),activityStartDate:m.string().optional(),creditsEarned:m.number().optional(),achievement:Zz.optional(),identifier:Xz.array().optional(),image:Ip.optional(),licenseNumber:m.string().optional(),narrative:m.string().optional(),result:eK.array().optional(),role:m.string().optional(),source:nh.optional(),term:m.string().optional()}).catchall(m.any()),tK=du.extend({name:m.string().optional(),description:m.string().optional(),image:Ip.optional(),credentialSubject:VA.or(VA.array()),endorsement:du.array().optional()}),ioe=tK.extend({proof:Bo.or(Bo.array())}),soe=m.object({checks:m.string().array(),warnings:m.string().array(),errors:m.string().array()}),t7=m.enum(["Success","Failed","Error"]),aoe=t7.enum,foe=m.object({check:m.string(),status:t7,message:m.string().optional(),details:m.string().optional()}),coe=m.object({title:m.string().optional(),createdAt:m.string().optional(),issuer:nh.optional(),issuee:nh.optional(),credentialSubject:Kv.optional()}),uoe=m.object({id:m.string(),uri:m.string()}).catchall(m.any()),doe=m.object({limit:m.number(),cursor:m.string().optional(),sort:m.string().optional()}),Wr=m.object({cursor:m.string().optional(),hasMore:m.boolean()}),r7=m.object({encryptedRecord:Fz,fields:m.string().array()}).catchall(m.any()),poe=Wr.extend({records:r7.array()}),rK=r7.extend({id:m.string()}),moe=Wr.extend({records:rK.array()}),GA=Rz(r=>{let e=r.match(/^\/(.*)\/([gimsuy]*)$/);if(!e)throw new Error("Invalid RegExp string format");return{pattern:e[1],flags:e[2]}},"parseRegexString"),nK=m.instanceof(RegExp).or(m.string().refine(r=>{try{return GA(r),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(r=>{let{pattern:e,flags:t}=GA(r);try{return new RegExp(e,t)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),WA=m.string().or(m.object({$in:m.string().array()})).or(m.object({$regex:nK})),Et=m.union([WA,m.object({$or:WA.array()})]);rh(m);var iK=m.object({backgroundColor:m.string().optional(),backgroundImage:m.string().optional(),fadeBackgroundImage:m.boolean().optional(),repeatBackgroundImage:m.boolean().optional(),fontColor:m.string().optional(),accentColor:m.string().optional(),accentFontColor:m.string().optional(),idBackgroundImage:m.string().optional(),fadeIdBackgroundImage:m.boolean().optional(),idBackgroundColor:m.string().optional(),repeatIdBackgroundImage:m.boolean().optional()}),Lo=m.object({profileId:m.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:m.string().default("").describe("Human-readable display name for the profile."),shortBio:m.string().default("").describe("Short bio for the profile."),bio:m.string().default("").describe("Longer bio for the profile."),did:m.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:m.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:m.string().optional().describe("Contact email address for the profile. (deprecated)"),image:m.string().optional().describe("Profile image URL for the profile."),heroImage:m.string().optional().describe("Hero image URL for the profile."),websiteLink:m.string().optional().describe("Website link for the profile."),isServiceProfile:m.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:m.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:m.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:iK.optional().describe("Display settings for the profile."),highlightedCredentials:m.array(m.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),role:m.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:m.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),country:m.string().optional().describe("Country for the profile."),approved:m.boolean().optional().describe("Approval status for the profile.")}),yoe=m.object({profileId:Et,displayName:Et,shortBio:Et,bio:Et,email:Et,websiteLink:Et,isServiceProfile:m.boolean(),type:Et}).partial(),xoe=Wr.extend({records:Lo.array()}),woe=m.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),n7=m.object({id:m.string(),created:m.string(),displayName:m.string().default("").optional(),shortBio:m.string().default("").optional(),bio:m.string().default("").optional(),email:m.string().optional(),image:m.string().optional(),heroImage:m.string().optional()}),_oe=Wr.extend({records:n7.extend({did:m.string()}).array()}),Eoe=m.object({id:Et,displayName:Et,shortBio:Et,bio:Et,email:Et}).partial(),Aoe=Wr.extend({records:m.object({profile:Lo,manager:n7.extend({did:m.string()}).optional()}).array()}),Soe=m.object({uri:m.string(),to:m.string(),from:m.string(),sent:m.string().datetime(),received:m.string().datetime().optional(),metadata:m.record(m.unknown()).optional()}),i7=m.object({role:m.string(),canEdit:m.boolean(),canIssue:m.boolean(),canRevoke:m.boolean(),canManagePermissions:m.boolean(),canIssueChildren:m.string(),canCreateChildren:m.string(),canEditChildren:m.string(),canRevokeChildren:m.string(),canManageChildrenPermissions:m.string(),canManageChildrenProfiles:m.boolean().default(!1).optional(),canViewAnalytics:m.boolean()}),oK=m.object({role:Et,canEdit:m.boolean(),canIssue:m.boolean(),canRevoke:m.boolean(),canManagePermissions:m.boolean(),canIssueChildren:Et,canCreateChildren:Et,canEditChildren:Et,canRevokeChildren:Et,canManageChildrenPermissions:Et,canManageChildrenProfiles:m.boolean(),canViewAnalytics:m.boolean()}).partial(),zv=m.enum(["GRANT_PERMISSIONS","ADD_ADMIN","AUTO_CONNECT"]),sK=m.discriminatedUnion("type",[m.object({type:m.literal(zv.Values.GRANT_PERMISSIONS),data:m.object({claimUri:m.string(),targetUri:m.string(),permissions:i7.partial()})}),m.object({type:m.literal(zv.Values.ADD_ADMIN),data:m.object({claimUri:m.string(),targetUri:m.string()})}),m.object({type:m.literal(zv.Values.AUTO_CONNECT),data:m.object({claimUri:m.string(),targetUri:m.string()})})]),Moe=m.object({type:Et,data:m.object({claimUri:Et,targetUri:Et,permissions:oK})}).deepPartial(),aK=m.object({id:m.string(),createdAt:m.string(),updatedAt:m.string()}).and(sK),Toe=Wr.extend({records:aK.array()}),Vv=m.enum(["DRAFT","LIVE"]),fK=m.object({uri:m.string(),name:m.string().optional(),type:m.string().optional(),category:m.string().optional(),status:Vv.optional(),autoConnectRecipients:m.boolean().optional(),meta:m.record(m.any()).optional(),claimPermissions:i7.optional(),allowAnyoneToCreateChildren:m.boolean().optional()}),JA=m.object({uri:Et,name:Et,type:Et,category:Et,meta:m.record(Et),status:Vv.or(m.object({$in:Vv.array()})),autoConnectRecipients:m.boolean()}).partial(),Coe=m.union([m.object({$or:JA.array()}),JA]),koe=Wr.extend({records:fK.array()}),cK=m.object({to:Lo,from:m.string(),received:m.string().optional(),uri:m.string().optional()}),Ioe=Wr.extend({records:cK.array()}),uK=m.object({to:Lo,from:m.string(),received:m.string().optional(),boostUris:m.array(m.string()),credentialUris:m.array(m.string()).optional()}),Doe=Wr.extend({records:uK.array()}),Roe=m.object({endpoint:m.string(),name:m.string(),did:m.string().optional()}),Ooe=m.object({ttlSeconds:m.number().optional(),totalUses:m.number().optional()}),lK=m.object({endpoint:m.string()}),Noe=m.object({signingAuthority:lK,relationship:m.object({name:m.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:m.string(),isPrimary:m.boolean().optional()})}),Poe=m.object({boostUri:m.string(),signingAuthority:m.object({endpoint:m.string(),name:m.string()})}),hK=m.enum(["live","stale","withdrawn"]),dK=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({categories:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({}),personal:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({}),write:m.object({credentials:m.object({categories:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({}),personal:m.record(m.object({required:m.boolean(),defaultEnabled:m.boolean().optional()})).default({})}).default({})}),o7=m.object({contract:dK,owner:Lo,name:m.string(),subtitle:m.string().optional(),description:m.string().optional(),reasonForAccessing:m.string().optional(),image:m.string().optional(),uri:m.string(),needsGuardianConsent:m.boolean().optional(),redirectUrl:m.string().optional(),frontDoorBoostUri:m.string().optional(),createdAt:m.string(),updatedAt:m.string(),expiresAt:m.string().optional(),autoBoosts:m.string().array().optional(),writers:m.array(Lo).optional()}),Boe=Wr.extend({records:o7.omit({owner:!0}).array()}),pK=m.object({credentials:m.object({categories:m.record(m.string().array()).default({})}),personal:m.record(m.string()).default({}),date:m.string()}),Loe=Wr.extend({records:pK.array()}),mK=m.object({credentials:m.object({category:m.string(),uri:m.string()}).array(),personal:m.record(m.string()).default({}),date:m.string(),contractUri:m.string()}),Uoe=Wr.extend({records:mK.array()}),s7=m.object({sharing:m.boolean().optional(),shared:m.string().array().optional(),shareAll:m.boolean().optional(),shareUntil:m.string().optional()}),a7=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({shareAll:m.boolean().optional(),sharing:m.boolean().optional(),categories:m.record(s7).default({})}).default({}),personal:m.record(m.string()).default({})}).default({}),write:m.object({credentials:m.object({categories:m.record(m.boolean()).default({})}).default({}),personal:m.record(m.boolean()).default({})}).default({}),deniedWriters:m.array(m.string()).optional()}),Foe=Wr.extend({records:m.object({expiresAt:m.string().optional(),oneTime:m.boolean().optional(),terms:a7,contract:o7,uri:m.string(),consenter:Lo,status:hK}).array()}),$oe=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({categories:m.record(m.object({required:m.boolean().optional()})).optional()}).optional(),personal:m.record(m.object({required:m.boolean().optional()})).optional()}).optional(),write:m.object({credentials:m.object({categories:m.record(m.object({required:m.boolean().optional()})).optional()}).optional(),personal:m.record(m.object({required:m.boolean().optional()})).optional()}).optional()}),qoe=m.object({anonymize:m.boolean().optional(),credentials:m.object({categories:m.record(m.boolean()).optional()}).optional(),personal:m.record(m.boolean()).optional()}),joe=m.object({credentials:m.object({categories:m.record(m.boolean()).optional()}).optional(),personal:m.record(m.boolean()).optional(),id:Et.optional()}),bK=m.object({read:m.object({anonymize:m.boolean().optional(),credentials:m.object({shareAll:m.boolean().optional(),sharing:m.boolean().optional(),categories:m.record(s7.optional()).optional()}).optional(),personal:m.record(m.string()).optional()}).optional(),write:m.object({credentials:m.object({categories:m.record(m.boolean()).optional()}).optional(),personal:m.record(m.boolean()).optional()}).optional()}),Gv=m.enum(["consent","update","sync","withdraw","write"]),Hoe=m.object({terms:bK.optional(),action:Gv.or(Gv.array()).optional(),date:m.object({$gt:m.string()}).or(m.object({$lt:m.string()})).or(m.object({$eq:m.string()})).optional(),expiresAt:m.object({$gt:m.string()}).or(m.object({$lt:m.string()})).or(m.object({$eq:m.string()})).optional(),oneTime:m.boolean().optional()}),f7=m.object({expiresAt:m.string().optional(),oneTime:m.boolean().optional(),terms:a7.optional(),id:m.string(),action:Gv,date:m.string(),uris:m.string().array().optional()}),zoe=Wr.extend({records:f7.array()}),YA=m.object({id:Et,name:Et,description:Et,sourceURI:Et,status:Et}).partial(),Koe=m.union([m.object({$or:YA.array()}),YA]),gK=m.object({credentialUri:m.string(),termsUri:m.string(),contractUri:m.string(),boostUri:m.string(),category:m.string().optional(),date:m.string()}),Voe=Wr.extend({records:gK.array()}),vK=m.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION","ISSUANCE_CLAIMED","ISSUANCE_DELIVERED","ISSUANCE_ERROR","PROFILE_PARENT_APPROVED"]),yK=m.object({title:m.string().optional(),body:m.string().optional()}),xK=m.object({type:m.string(),value:m.string()}),Rp=m.enum(["PENDING","ISSUED","EXPIRED","DELIVERED","CLAIMED"]),wK=m.object({issuanceId:m.string(),status:Rp,recipient:m.object({contactMethod:xK.optional(),learnCardId:m.string().optional()}),timestamp:m.string().datetime().optional()}),_K=m.object({vcUris:m.array(m.string()).optional(),vpUris:m.array(m.string()).optional(),transaction:f7.optional(),inbox:wK.optional(),metadata:m.record(m.unknown()).optional()}).passthrough(),Goe=m.object({type:vK,to:Lo.partial().and(m.object({did:m.string()})),from:Lo.partial().and(m.object({did:m.string()})),message:yK.optional(),data:_K.optional(),sent:m.string().datetime().optional(),webhookUrl:m.string().optional()}),EK="auth-grant:",Woe=m.object({id:m.string(),name:m.string(),description:m.string().optional(),challenge:m.string().startsWith(EK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:m.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:m.string(),createdAt:m.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:m.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),Joe=m.object({id:m.string()}).catchall(m.any()),AK=m.enum(["active","revoked"]),Yoe=m.object({id:Et,name:Et,description:Et,status:AK}).partial(),ZA=m.object({id:m.string(),isVerified:m.boolean(),verifiedAt:m.string().optional(),isPrimary:m.boolean(),createdAt:m.string()}),Zoe=m.discriminatedUnion("type",[m.object({type:m.literal("email"),value:m.string().email()}).merge(ZA),m.object({type:m.literal("phone"),value:m.string()}).merge(ZA)]),XA=m.object({isVerified:m.boolean().optional(),isPrimary:m.boolean().optional()}),Xoe=m.discriminatedUnion("type",[m.object({type:m.literal("email"),value:m.string().email()}).merge(XA),m.object({type:m.literal("phone"),value:m.string()}).merge(XA)]),c7=m.discriminatedUnion("type",[m.object({type:m.literal("email"),value:m.string().email()}),m.object({type:m.literal("phone"),value:m.string()})]),SK=m.object({value:m.string(),type:m.enum(["email","phone"])}),Qoe=m.object({token:m.string()}),ese=m.object({contactMethodId:m.string()}),tse=m.object({contactMethod:SK,otpChallenge:m.string()}),rse=m.object({sessionJwt:m.string()}),MK=m.object({id:m.string(),credential:m.string(),isSigned:m.boolean(),currentStatus:Rp,isAccepted:m.boolean().optional(),expiresAt:m.string(),createdAt:m.string(),issuerDid:m.string(),webhookUrl:m.string().optional(),signingAuthority:m.object({endpoint:m.string().optional(),name:m.string().optional()}).optional()}),nse=m.object({hasMore:m.boolean(),records:m.array(MK),cursor:m.string().optional()}),ise=m.object({currentStatus:Rp,id:m.string(),isSigned:m.boolean(),isAccepted:m.boolean().optional(),issuerDid:m.string()}).partial(),TK=m.object({endpoint:m.string().url(),name:m.string()}),ose=m.object({recipient:c7.describe("The recipient of the credential"),credential:Pf.passthrough().or(oh.passthrough()).or(du.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),configuration:m.object({signingAuthority:TK.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),webhookUrl:m.string().url().optional().describe("The webhook URL to receive credential issuance events."),expiresInDays:m.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),delivery:m.object({suppress:m.boolean().optional().default(!1).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),template:m.object({id:m.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),model:m.object({issuer:m.object({name:m.string().optional().describe('The name of the organization (e.g., "State University").'),logoUrl:m.string().url().optional().describe("The URL of the organization's logo.")}).optional(),credential:m.object({name:m.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),type:m.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')}).optional(),recipient:m.object({name:m.string().optional().describe('The name of the recipient (e.g., "John Doe").')}).optional()}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")}),sse=m.object({issuanceId:m.string(),status:Rp,recipient:c7,claimUrl:m.string().url().optional(),recipientDid:m.string().optional()}),ase=m.object({credential:Pf.passthrough().or(oh.passthrough()).or(du.passthrough()).describe("The credential to issue."),configuration:m.object({publishableKey:m.string(),signingAuthorityName:m.string().optional()}).optional()}),Jv=m.union([m.string().regex(/^(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid domain (incl. subdomains), localhost, or IPv4, optionally with port"}),m.string().regex(/^https?:\/\/(?:(?:[a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,63}|localhost|\d{1,3}(?:\.\d{1,3}){3})(?::\d{1,5})?$/,{message:"Must be a valid http(s) origin"})]),CK=m.object({id:m.string(),name:m.string(),description:m.string().optional(),publishableKey:m.string(),whitelistedDomains:m.array(Jv).default([])}),fse=m.object({name:m.string(),description:m.string().optional(),whitelistedDomains:m.array(Jv).default([])}),cse=m.object({name:m.string().optional(),description:m.string().optional(),whitelistedDomains:m.array(Jv).optional(),rotatePublishableKey:m.boolean().optional()}),use=m.object({id:Et,name:Et,description:Et}).partial(),lse=Wr.extend({records:CK.array()}),hse=m.object({token:m.string(),contactMethodId:m.string(),autoVerifyContactMethod:m.boolean().optional().default(!1),createdAt:m.string(),expiresAt:m.string(),used:m.boolean()}),dse=m.object({id:m.string(),name:m.string().min(1),slug:m.string().min(1),createdAt:m.string().optional(),updatedAt:m.string().optional()}),ih=m.enum(["active","archived"]),u7=m.object({id:m.string(),statement:m.string(),description:m.string().optional(),code:m.string().optional(),icon:m.string().optional(),type:m.string().default("skill"),status:ih.default("active"),frameworkId:m.string().optional(),createdAt:m.string().optional(),updatedAt:m.string().optional()}),QA=m.object({id:Et,statement:Et,description:Et,code:Et,type:Et,status:ih.or(m.object({$in:ih.array()}))}).partial(),pse=m.union([m.object({$or:QA.array()}),QA]),Yv=m.enum(["active","archived"]),l7=m.object({id:m.string(),name:m.string(),description:m.string().optional(),image:m.string().optional(),sourceURI:m.string().url().optional(),status:Yv.default("active"),createdAt:m.string().optional(),updatedAt:m.string().optional()}),mse=Wr.extend({records:l7.array()}),Zv=u7.extend({children:m.array(m.lazy(()=>Zv)),hasChildren:m.boolean(),childrenCursor:m.string().nullable().optional()}).openapi({ref:"SkillTreeNode"}),kK=m.object({hasMore:m.boolean(),cursor:m.string().nullable(),records:m.array(Zv)}),pu=m.lazy(()=>m.object({id:m.string().optional(),statement:m.string(),description:m.string().optional(),code:m.string().optional(),icon:m.string().optional(),type:m.string().optional(),status:ih.optional(),children:m.array(pu).optional()})).openapi({ref:"SkillTreeNodeInput"}),bse=m.object({frameworkId:m.string()}),IK=m.object({id:m.string().optional(),name:m.string().min(1),description:m.string().optional(),image:m.string().optional(),sourceURI:m.string().url().optional(),status:Yv.optional(),skills:m.array(pu).optional(),boostUris:m.array(m.string()).optional()}),gse=m.object({id:m.string(),name:m.string().min(1).optional(),description:m.string().optional(),image:m.string().optional(),sourceURI:m.string().url().optional(),status:Yv.optional()}).refine(r=>r.name!==void 0||r.description!==void 0||r.image!==void 0||r.sourceURI!==void 0||r.status!==void 0,{message:"At least one field must be provided to update",path:["name"]}),vse=m.object({id:m.string()}),yse=m.object({frameworks:m.array(IK.extend({skills:m.array(pu).optional()})).min(1)}),xse=m.object({frameworkId:m.string(),profileId:m.string()}),wse=m.object({frameworkId:m.string()}),_se=Lo.array(),Ese=m.object({id:m.string()}),Ase=m.object({slug:m.string().min(1),name:m.string().min(1)}),Sse=m.object({frameworkId:m.string(),skill:pu,parentId:m.string().nullable().optional()}),Mse=m.object({frameworkId:m.string(),id:m.string(),statement:m.string().optional(),description:m.string().optional(),code:m.string().optional(),icon:m.string().optional(),type:m.string().optional(),status:ih.optional()}).refine(r=>r.statement!==void 0||r.description!==void 0||r.code!==void 0||r.icon!==void 0||r.type!==void 0||r.status!==void 0,{message:"At least one field must be provided to update a skill",path:["statement"]}),DK=m.enum(["recursive","reparent"]),Tse=m.object({frameworkId:m.string(),id:m.string(),strategy:DK.optional().default("reparent")}),Cse=m.object({frameworkId:m.string(),skills:m.array(pu).min(1),parentId:m.string().nullable().optional()}),kse=m.object({frameworkId:m.string(),skills:m.array(pu).min(0)}),Ise=m.object({created:m.number().int().min(0),updated:m.number().int().min(0),deleted:m.number().int().min(0),unchanged:m.number().int().min(0),total:m.number().int().min(0)}),Dse=m.object({frameworkId:m.string(),skillId:m.string().optional(),recursive:m.boolean().optional().default(!1),onlyCountCompetencies:m.boolean().optional().default(!1)}),Rse=m.object({count:m.number().int().min(0)}),Ose=m.object({frameworkId:m.string()}),Nse=m.object({skills:m.array(Zv)}),Pse=m.object({frameworkId:m.string(),skillId:m.string()}),Bse=m.object({path:m.array(u7)}),Lse=m.object({framework:l7,skills:kK});var Op=o(r=>`lc:ceramic:${r}`,"streamIdToCeramicURI");var Xv=m.string().refine(r=>r.split(":").length===3&&r.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(r=>r.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var h7={ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"};var Np=o(async(r,{ceramicEndpoint:e,defaultContentFamily:t}=h7)=>{let n=new Yl(e),i=o(async(R,I,B,Y)=>r.invoke.didResolver(R,Y),"learnCardResolver"),s={...I_.getResolver(),web:i},f=new hf({resolver:s});n.did=f;let u=r.invoke.getKey(),d=new Sl(h_(u));n.did.setProvider(d),await n.did.authenticate();let y=new Hl({ceramic:n}),w=o(async(R,I={},B={},Y)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=t),"pin"in B||(B.pin=!0),Y?.encrypt){r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",Y);let J=Y?.recipients||[];Y?.controllersCanDecrypt&&(J=[...J,...I.controllers]),R=await n?.did?.createDagJWE(R,d7.default.uniq(J))}return r.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,B),(await ei.create(n,R,I,B)).id.toString()},"publishContentToCeramic"),A=o(async R=>{let I=(await y.load(R))?.content;if(r.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await f.decryptDagJWE(I)}catch(B){throw r.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",B),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await Pf.or(oh).parseAsync(R),Op(await w(R,{},{},I))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,I)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(I)),uploadEncrypted:async(R,I,B)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...B?{recipients:B.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let B=await Xv.spa(I);if(!B.success)return;let Y=B.data.split(":")[2];try{return await Pf.or(oh).parseAsync(await A(Y))}catch(P){R.debug?.(P);return}}},methods:{publishContentToCeramic:async(R,I,B)=>Op(await w(I,{},{},B)),readContentFromCeramic:async(R,I)=>A(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var RK=Np;
823
823
  /*!
824
824
  * The buffer module from node.js, for the browser.
825
825
  *