@learncard/ceramic-plugin 1.0.9 → 1.0.11
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.
- package/dist/ceramic-plugin.cjs.development.js +103 -65
- package/dist/ceramic-plugin.cjs.development.js.map +2 -2
- package/dist/ceramic-plugin.cjs.production.min.js +97 -97
- package/dist/ceramic-plugin.cjs.production.min.js.map +2 -2
- package/dist/ceramic-plugin.esm.js +103 -65
- package/dist/ceramic-plugin.esm.js.map +2 -2
- package/dist/ceramic.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var Lk=Object.create;var nu=Object.defineProperty;var Bk=Object.getOwnPropertyDescriptor;var Uk=Object.getOwnPropertyNames;var $k=Object.getPrototypeOf,Fk=Object.prototype.hasOwnProperty;var o=(t,e)=>nu(t,"name",{value:e,configurable:!0});var jt=(t,e)=>()=>(t&&(e=t(t=0)),e);var De=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var r in e)nu(t,r,{get:e[r],enumerable:!0})},wy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Uk(e))!Fk.call(t,i)&&i!==r&&nu(t,i,{get:()=>e[i],enumerable:!(n=Bk(e,i))||n.enumerable});return t};var Lt=(t,e,r)=>(r=t!=null?Lk($k(t)):{},wy(e||!t||!t.__esModule?nu(r,"default",{value:t,enumerable:!0}):r,t)),gh=t=>wy(nu({},"__esModule",{value:!0}),t);var _y=De((Nf,iu)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,m="__lodash_placeholder__",v=1,x=2,S=4,O=1,R=2,D=1,P=2,J=4,L=8,W=16,Q=32,Y=64,oe=128,j=256,H=512,G=30,le="...",T=800,h=16,y=1,b=2,l=3,p=1/0,_=9007199254740991,A=17976931348623157e292,E=0/0,g=4294967295,C=g-1,N=g>>>1,w=[["ary",oe],["bind",D],["bindKey",P],["curry",L],["curryRight",W],["flip",H],["partial",Q],["partialRight",Y],["rearg",j]],k="[object Arguments]",he="[object Array]",I="[object AsyncFunction]",Z="[object Boolean]",se="[object Date]",q="[object DOMException]",F="[object Error]",ee="[object Function]",ne="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",re="[object Object]",Se="[object Promise]",ce="[object Proxy]",ve="[object RegExp]",V="[object Set]",pe="[object String]",Ce="[object Symbol]",He="[object Undefined]",Re="[object WeakMap]",Ve="[object WeakSet]",pr="[object ArrayBuffer]",ue="[object DataView]",ie="[object Float32Array]",$="[object Float64Array]",X="[object Int8Array]",me="[object Int16Array]",ye="[object Int32Array]",we="[object Uint8Array]",ke="[object Uint8ClampedArray]",It="[object Uint16Array]",Ue="[object Uint32Array]",Oe=/\b__p \+= '';/g,Bt=/\b(__p \+=) '' \+/g,je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Je=/&(?:amp|lt|gt|quot|#39);/g,Tn=/[&<>"']/g,nt=RegExp(Je.source),it=RegExp(Tn.source),Yn=/<%-([\s\S]+?)%>/g,ot=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,st=/^\w*$/,at=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cn=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(cn.source),Xe=/^\s+/,Zn=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,Qn=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,ei=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,Ft=/^0b[01]+$/i,qt=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ln=/^(?:0|[1-9]\d*)$/,hn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr=/($^)/,dn=/['\n\r\u2028\u2029\\]/g,ti="\\ud800-\\udfff",Ao="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",Mo="\\u20d0-\\u20ff",Xi=Ao+So+Mo,Zi="\\u2700-\\u27bf",Qi="a-z\\xdf-\\xf6\\xf8-\\xff",To="\\xac\\xb1\\xd7\\xf7",Co="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ko="\\u2000-\\u206f",Io=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vf="A-Z\\xc0-\\xd6\\xd8-\\xde",yf="\\ufe0e\\ufe0f",xf=To+Co+ko+Io,tp="['\u2019]",L9="["+ti+"]",r2="["+xf+"]",Dl="["+Xi+"]",n2="\\d+",B9="["+Zi+"]",i2="["+Qi+"]",o2="[^"+ti+xf+n2+Zi+Qi+vf+"]",rp="\\ud83c[\\udffb-\\udfff]",U9="(?:"+Dl+"|"+rp+")",s2="[^"+ti+"]",np="(?:\\ud83c[\\udde6-\\uddff]){2}",ip="[\\ud800-\\udbff][\\udc00-\\udfff]",wf="["+vf+"]",a2="\\u200d",f2="(?:"+i2+"|"+o2+")",$9="(?:"+wf+"|"+o2+")",c2="(?:"+tp+"(?:d|ll|m|re|s|t|ve))?",u2="(?:"+tp+"(?:D|LL|M|RE|S|T|VE))?",l2=U9+"?",h2="["+yf+"]?",F9="(?:"+a2+"(?:"+[s2,np,ip].join("|")+")"+h2+l2+")*",q9="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",H9="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",d2=h2+l2+F9,z9="(?:"+[B9,np,ip].join("|")+")"+d2,K9="(?:"+[s2+Dl+"?",Dl,np,ip,L9].join("|")+")",j9=RegExp(tp,"g"),G9=RegExp(Dl,"g"),op=RegExp(rp+"(?="+rp+")|"+K9+d2,"g"),V9=RegExp([wf+"?"+i2+"+"+c2+"(?="+[r2,wf,"$"].join("|")+")",$9+"+"+u2+"(?="+[r2,wf+f2,"$"].join("|")+")",wf+"?"+f2+"+"+c2,wf+"+"+u2,H9,q9,n2,z9].join("|"),"g"),W9=RegExp("["+a2+ti+Xi+yf+"]"),J9=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Y9=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],X9=-1,ir={};ir[ie]=ir[$]=ir[X]=ir[me]=ir[ye]=ir[we]=ir[ke]=ir[It]=ir[Ue]=!0,ir[k]=ir[he]=ir[pr]=ir[Z]=ir[ue]=ir[se]=ir[F]=ir[ee]=ir[ae]=ir[Ae]=ir[re]=ir[ve]=ir[V]=ir[pe]=ir[Re]=!1;var tr={};tr[k]=tr[he]=tr[pr]=tr[ue]=tr[Z]=tr[se]=tr[ie]=tr[$]=tr[X]=tr[me]=tr[ye]=tr[ae]=tr[Ae]=tr[re]=tr[ve]=tr[V]=tr[pe]=tr[Ce]=tr[we]=tr[ke]=tr[It]=tr[Ue]=!0,tr[F]=tr[ee]=tr[Re]=!1;var Z9={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Q9={"&":"&","<":"<",">":">",'"':""","'":"'"},e7={"&":"&","<":"<",">":">",""":'"',"'":"'"},t7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},r7=parseFloat,n7=parseInt,p2=typeof global=="object"&&global&&global.Object===Object&&global,i7=typeof self=="object"&&self&&self.Object===Object&&self,Er=p2||i7||Function("return this")(),sp=typeof Nf=="object"&&Nf&&!Nf.nodeType&&Nf,ha=sp&&typeof iu=="object"&&iu&&!iu.nodeType&&iu,m2=ha&&ha.exports===sp,ap=m2&&p2.process,ri=function(){try{var de=ha&&ha.require&&ha.require("util").types;return de||ap&&ap.binding&&ap.binding("util")}catch{}}(),b2=ri&&ri.isArrayBuffer,g2=ri&&ri.isDate,v2=ri&&ri.isMap,y2=ri&&ri.isRegExp,x2=ri&&ri.isSet,w2=ri&&ri.isTypedArray;function kn(de,Ee,xe){switch(xe.length){case 0:return de.call(Ee);case 1:return de.call(Ee,xe[0]);case 2:return de.call(Ee,xe[0],xe[1]);case 3:return de.call(Ee,xe[0],xe[1],xe[2])}return de.apply(Ee,xe)}o(kn,"apply");function o7(de,Ee,xe,qe){for(var bt=-1,Ht=de==null?0:de.length;++bt<Ht;){var xr=de[bt];Ee(qe,xr,xe(xr),de)}return qe}o(o7,"arrayAggregator");function ni(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe&&Ee(de[xe],xe,de)!==!1;);return de}o(ni,"arrayEach");function s7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(s7,"arrayEachRight");function _2(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe;)if(!Ee(de[xe],xe,de))return!1;return!0}o(_2,"arrayEvery");function ds(de,Ee){for(var xe=-1,qe=de==null?0:de.length,bt=0,Ht=[];++xe<qe;){var xr=de[xe];Ee(xr,xe,de)&&(Ht[bt++]=xr)}return Ht}o(ds,"arrayFilter");function Ol(de,Ee){var xe=de==null?0:de.length;return!!xe&&_f(de,Ee,0)>-1}o(Ol,"arrayIncludes");function fp(de,Ee,xe){for(var qe=-1,bt=de==null?0:de.length;++qe<bt;)if(xe(Ee,de[qe]))return!0;return!1}o(fp,"arrayIncludesWith");function sr(de,Ee){for(var xe=-1,qe=de==null?0:de.length,bt=Array(qe);++xe<qe;)bt[xe]=Ee(de[xe],xe,de);return bt}o(sr,"arrayMap");function ps(de,Ee){for(var xe=-1,qe=Ee.length,bt=de.length;++xe<qe;)de[bt+xe]=Ee[xe];return de}o(ps,"arrayPush");function cp(de,Ee,xe,qe){var bt=-1,Ht=de==null?0:de.length;for(qe&&Ht&&(xe=de[++bt]);++bt<Ht;)xe=Ee(xe,de[bt],bt,de);return xe}o(cp,"arrayReduce");function a7(de,Ee,xe,qe){var bt=de==null?0:de.length;for(qe&&bt&&(xe=de[--bt]);bt--;)xe=Ee(xe,de[bt],bt,de);return xe}o(a7,"arrayReduceRight");function up(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe;)if(Ee(de[xe],xe,de))return!0;return!1}o(up,"arraySome");var f7=lp("length");function c7(de){return de.split("")}o(c7,"asciiToArray");function u7(de){return de.match(lt)||[]}o(u7,"asciiWords");function E2(de,Ee,xe){var qe;return xe(de,function(bt,Ht,xr){if(Ee(bt,Ht,xr))return qe=Ht,!1}),qe}o(E2,"baseFindKey");function Rl(de,Ee,xe,qe){for(var bt=de.length,Ht=xe+(qe?1:-1);qe?Ht--:++Ht<bt;)if(Ee(de[Ht],Ht,de))return Ht;return-1}o(Rl,"baseFindIndex");function _f(de,Ee,xe){return Ee===Ee?_7(de,Ee,xe):Rl(de,A2,xe)}o(_f,"baseIndexOf");function l7(de,Ee,xe,qe){for(var bt=xe-1,Ht=de.length;++bt<Ht;)if(qe(de[bt],Ee))return bt;return-1}o(l7,"baseIndexOfWith");function A2(de){return de!==de}o(A2,"baseIsNaN");function S2(de,Ee){var xe=de==null?0:de.length;return xe?dp(de,Ee)/xe:E}o(S2,"baseMean");function lp(de){return function(Ee){return Ee==null?t:Ee[de]}}o(lp,"baseProperty");function hp(de){return function(Ee){return de==null?t:de[Ee]}}o(hp,"basePropertyOf");function M2(de,Ee,xe,qe,bt){return bt(de,function(Ht,xr,Zt){xe=qe?(qe=!1,Ht):Ee(xe,Ht,xr,Zt)}),xe}o(M2,"baseReduce");function h7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(h7,"baseSortBy");function dp(de,Ee){for(var xe,qe=-1,bt=de.length;++qe<bt;){var Ht=Ee(de[qe]);Ht!==t&&(xe=xe===t?Ht:xe+Ht)}return xe}o(dp,"baseSum");function pp(de,Ee){for(var xe=-1,qe=Array(de);++xe<de;)qe[xe]=Ee(xe);return qe}o(pp,"baseTimes");function d7(de,Ee){return sr(Ee,function(xe){return[xe,de[xe]]})}o(d7,"baseToPairs");function T2(de){return de&&de.slice(0,D2(de)+1).replace(Xe,"")}o(T2,"baseTrim");function In(de){return function(Ee){return de(Ee)}}o(In,"baseUnary");function mp(de,Ee){return sr(Ee,function(xe){return de[xe]})}o(mp,"baseValues");function Hc(de,Ee){return de.has(Ee)}o(Hc,"cacheHas");function C2(de,Ee){for(var xe=-1,qe=de.length;++xe<qe&&_f(Ee,de[xe],0)>-1;);return xe}o(C2,"charsStartIndex");function k2(de,Ee){for(var xe=de.length;xe--&&_f(Ee,de[xe],0)>-1;);return xe}o(k2,"charsEndIndex");function p7(de,Ee){for(var xe=de.length,qe=0;xe--;)de[xe]===Ee&&++qe;return qe}o(p7,"countHolders");var m7=hp(Z9),b7=hp(Q9);function g7(de){return"\\"+t7[de]}o(g7,"escapeStringChar");function v7(de,Ee){return de==null?t:de[Ee]}o(v7,"getValue");function Ef(de){return W9.test(de)}o(Ef,"hasUnicode");function y7(de){return J9.test(de)}o(y7,"hasUnicodeWord");function x7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(x7,"iteratorToArray");function bp(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe,bt){xe[++Ee]=[bt,qe]}),xe}o(bp,"mapToArray");function I2(de,Ee){return function(xe){return de(Ee(xe))}}o(I2,"overArg");function ms(de,Ee){for(var xe=-1,qe=de.length,bt=0,Ht=[];++xe<qe;){var xr=de[xe];(xr===Ee||xr===m)&&(de[xe]=m,Ht[bt++]=xe)}return Ht}o(ms,"replaceHolders");function Nl(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=qe}),xe}o(Nl,"setToArray");function w7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=[qe,qe]}),xe}o(w7,"setToPairs");function _7(de,Ee,xe){for(var qe=xe-1,bt=de.length;++qe<bt;)if(de[qe]===Ee)return qe;return-1}o(_7,"strictIndexOf");function E7(de,Ee,xe){for(var qe=xe+1;qe--;)if(de[qe]===Ee)return qe;return qe}o(E7,"strictLastIndexOf");function Af(de){return Ef(de)?S7(de):f7(de)}o(Af,"stringSize");function Ci(de){return Ef(de)?M7(de):c7(de)}o(Ci,"stringToArray");function D2(de){for(var Ee=de.length;Ee--&&Zn.test(de.charAt(Ee)););return Ee}o(D2,"trimmedEndIndex");var A7=hp(e7);function S7(de){for(var Ee=op.lastIndex=0;op.test(de);)++Ee;return Ee}o(S7,"unicodeSize");function M7(de){return de.match(op)||[]}o(M7,"unicodeToArray");function T7(de){return de.match(V9)||[]}o(T7,"unicodeWords");var C7=o(function de(Ee){Ee=Ee==null?Er:bs.defaults(Er.Object(),Ee,bs.pick(Er,Y9));var xe=Ee.Array,qe=Ee.Date,bt=Ee.Error,Ht=Ee.Function,xr=Ee.Math,Zt=Ee.Object,gp=Ee.RegExp,k7=Ee.String,ii=Ee.TypeError,Pl=xe.prototype,I7=Ht.prototype,Sf=Zt.prototype,Ll=Ee["__core-js_shared__"],Bl=I7.toString,Vt=Sf.hasOwnProperty,D7=0,O2=function(){var s=/[^.]+$/.exec(Ll&&Ll.keys&&Ll.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ul=Sf.toString,O7=Bl.call(Zt),R7=Er._,N7=gp("^"+Bl.call(Vt).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$l=m2?Ee.Buffer:t,gs=Ee.Symbol,Fl=Ee.Uint8Array,R2=$l?$l.allocUnsafe:t,ql=I2(Zt.getPrototypeOf,Zt),N2=Zt.create,P2=Sf.propertyIsEnumerable,Hl=Pl.splice,L2=gs?gs.isConcatSpreadable:t,zc=gs?gs.iterator:t,da=gs?gs.toStringTag:t,zl=function(){try{var s=va(Zt,"defineProperty");return s({},"",{}),s}catch{}}(),P7=Ee.clearTimeout!==Er.clearTimeout&&Ee.clearTimeout,L7=qe&&qe.now!==Er.Date.now&&qe.now,B7=Ee.setTimeout!==Er.setTimeout&&Ee.setTimeout,Kl=xr.ceil,jl=xr.floor,vp=Zt.getOwnPropertySymbols,U7=$l?$l.isBuffer:t,B2=Ee.isFinite,$7=Pl.join,F7=I2(Zt.keys,Zt),wr=xr.max,Kr=xr.min,q7=qe.now,H7=Ee.parseInt,U2=xr.random,z7=Pl.reverse,yp=va(Ee,"DataView"),Kc=va(Ee,"Map"),xp=va(Ee,"Promise"),Mf=va(Ee,"Set"),jc=va(Ee,"WeakMap"),Gc=va(Zt,"create"),Gl=jc&&new jc,Tf={},K7=ya(yp),j7=ya(Kc),G7=ya(xp),V7=ya(Mf),W7=ya(jc),Vl=gs?gs.prototype:t,Vc=Vl?Vl.valueOf:t,$2=Vl?Vl.toString:t;function z(s){if(fr(s)&&!vt(s)&&!(s instanceof Dt)){if(s instanceof oi)return s;if(Vt.call(s,"__wrapped__"))return Fv(s)}return new oi(s)}o(z,"lodash");var Cf=function(){function s(){}return o(s,"object"),function(f){if(!ar(f))return{};if(N2)return N2(f);s.prototype=f;var d=new s;return s.prototype=t,d}}();function Wl(){}o(Wl,"baseLodash");function oi(s,f){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=t}o(oi,"LodashWrapper"),z.templateSettings={escape:Yn,evaluate:ot,interpolate:et,variable:"",imports:{_:z}},z.prototype=Wl.prototype,z.prototype.constructor=z,oi.prototype=Cf(Wl.prototype),oi.prototype.constructor=oi;function Dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}o(Dt,"LazyWrapper");function J7(){var s=new Dt(this.__wrapped__);return s.__actions__=pn(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=pn(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=pn(this.__views__),s}o(J7,"lazyClone");function Y7(){if(this.__filtered__){var s=new Dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}o(Y7,"lazyReverse");function X7(){var s=this.__wrapped__.value(),f=this.__dir__,d=vt(s),M=f<0,B=d?s.length:0,K=cS(0,B,this.__views__),te=K.start,fe=K.end,be=fe-te,Me=M?fe:te-1,Te=this.__iteratees__,Ie=Te.length,Le=0,ze=Kr(be,this.__takeCount__);if(!d||!M&&B==be&&ze==be)return cv(s,this.__actions__);var Ze=[];e:for(;be--&&Le<ze;){Me+=f;for(var _t=-1,Qe=s[Me];++_t<Ie;){var Ct=Te[_t],Nt=Ct.iteratee,Rn=Ct.type,sn=Nt(Qe);if(Rn==b)Qe=sn;else if(!sn){if(Rn==y)continue e;break e}}Ze[Le++]=Qe}return Ze}o(X7,"lazyValue"),Dt.prototype=Cf(Wl.prototype),Dt.prototype.constructor=Dt;function pa(s){var f=-1,d=s==null?0:s.length;for(this.clear();++f<d;){var M=s[f];this.set(M[0],M[1])}}o(pa,"Hash");function Z7(){this.__data__=Gc?Gc(null):{},this.size=0}o(Z7,"hashClear");function Q7(s){var f=this.has(s)&&delete this.__data__[s];return this.size-=f?1:0,f}o(Q7,"hashDelete");function eA(s){var f=this.__data__;if(Gc){var d=f[s];return d===c?t:d}return Vt.call(f,s)?f[s]:t}o(eA,"hashGet");function tA(s){var f=this.__data__;return Gc?f[s]!==t:Vt.call(f,s)}o(tA,"hashHas");function rA(s,f){var d=this.__data__;return this.size+=this.has(s)?0:1,d[s]=Gc&&f===t?c:f,this}o(rA,"hashSet"),pa.prototype.clear=Z7,pa.prototype.delete=Q7,pa.prototype.get=eA,pa.prototype.has=tA,pa.prototype.set=rA;function Do(s){var f=-1,d=s==null?0:s.length;for(this.clear();++f<d;){var M=s[f];this.set(M[0],M[1])}}o(Do,"ListCache");function nA(){this.__data__=[],this.size=0}o(nA,"listCacheClear");function iA(s){var f=this.__data__,d=Jl(f,s);if(d<0)return!1;var M=f.length-1;return d==M?f.pop():Hl.call(f,d,1),--this.size,!0}o(iA,"listCacheDelete");function oA(s){var f=this.__data__,d=Jl(f,s);return d<0?t:f[d][1]}o(oA,"listCacheGet");function sA(s){return Jl(this.__data__,s)>-1}o(sA,"listCacheHas");function aA(s,f){var d=this.__data__,M=Jl(d,s);return M<0?(++this.size,d.push([s,f])):d[M][1]=f,this}o(aA,"listCacheSet"),Do.prototype.clear=nA,Do.prototype.delete=iA,Do.prototype.get=oA,Do.prototype.has=sA,Do.prototype.set=aA;function Oo(s){var f=-1,d=s==null?0:s.length;for(this.clear();++f<d;){var M=s[f];this.set(M[0],M[1])}}o(Oo,"MapCache");function fA(){this.size=0,this.__data__={hash:new pa,map:new(Kc||Do),string:new pa}}o(fA,"mapCacheClear");function cA(s){var f=ah(this,s).delete(s);return this.size-=f?1:0,f}o(cA,"mapCacheDelete");function uA(s){return ah(this,s).get(s)}o(uA,"mapCacheGet");function lA(s){return ah(this,s).has(s)}o(lA,"mapCacheHas");function hA(s,f){var d=ah(this,s),M=d.size;return d.set(s,f),this.size+=d.size==M?0:1,this}o(hA,"mapCacheSet"),Oo.prototype.clear=fA,Oo.prototype.delete=cA,Oo.prototype.get=uA,Oo.prototype.has=lA,Oo.prototype.set=hA;function ma(s){var f=-1,d=s==null?0:s.length;for(this.__data__=new Oo;++f<d;)this.add(s[f])}o(ma,"SetCache");function dA(s){return this.__data__.set(s,c),this}o(dA,"setCacheAdd");function pA(s){return this.__data__.has(s)}o(pA,"setCacheHas"),ma.prototype.add=ma.prototype.push=dA,ma.prototype.has=pA;function ki(s){var f=this.__data__=new Do(s);this.size=f.size}o(ki,"Stack");function mA(){this.__data__=new Do,this.size=0}o(mA,"stackClear");function bA(s){var f=this.__data__,d=f.delete(s);return this.size=f.size,d}o(bA,"stackDelete");function gA(s){return this.__data__.get(s)}o(gA,"stackGet");function vA(s){return this.__data__.has(s)}o(vA,"stackHas");function yA(s,f){var d=this.__data__;if(d instanceof Do){var M=d.__data__;if(!Kc||M.length<r-1)return M.push([s,f]),this.size=++d.size,this;d=this.__data__=new Oo(M)}return d.set(s,f),this.size=d.size,this}o(yA,"stackSet"),ki.prototype.clear=mA,ki.prototype.delete=bA,ki.prototype.get=gA,ki.prototype.has=vA,ki.prototype.set=yA;function F2(s,f){var d=vt(s),M=!d&&xa(s),B=!d&&!M&&_s(s),K=!d&&!M&&!B&&Of(s),te=d||M||B||K,fe=te?pp(s.length,k7):[],be=fe.length;for(var Me in s)(f||Vt.call(s,Me))&&!(te&&(Me=="length"||B&&(Me=="offset"||Me=="parent")||K&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||Lo(Me,be)))&&fe.push(Me);return fe}o(F2,"arrayLikeKeys");function q2(s){var f=s.length;return f?s[Dp(0,f-1)]:t}o(q2,"arraySample");function xA(s,f){return fh(pn(s),ba(f,0,s.length))}o(xA,"arraySampleSize");function wA(s){return fh(pn(s))}o(wA,"arrayShuffle");function wp(s,f,d){(d!==t&&!Ii(s[f],d)||d===t&&!(f in s))&&Ro(s,f,d)}o(wp,"assignMergeValue");function Wc(s,f,d){var M=s[f];(!(Vt.call(s,f)&&Ii(M,d))||d===t&&!(f in s))&&Ro(s,f,d)}o(Wc,"assignValue");function Jl(s,f){for(var d=s.length;d--;)if(Ii(s[d][0],f))return d;return-1}o(Jl,"assocIndexOf");function _A(s,f,d,M){return vs(s,function(B,K,te){f(M,B,d(B),te)}),M}o(_A,"baseAggregator");function H2(s,f){return s&&to(f,Ar(f),s)}o(H2,"baseAssign");function EA(s,f){return s&&to(f,bn(f),s)}o(EA,"baseAssignIn");function Ro(s,f,d){f=="__proto__"&&zl?zl(s,f,{configurable:!0,enumerable:!0,value:d,writable:!0}):s[f]=d}o(Ro,"baseAssignValue");function _p(s,f){for(var d=-1,M=f.length,B=xe(M),K=s==null;++d<M;)B[d]=K?t:rm(s,f[d]);return B}o(_p,"baseAt");function ba(s,f,d){return s===s&&(d!==t&&(s=s<=d?s:d),f!==t&&(s=s>=f?s:f)),s}o(ba,"baseClamp");function si(s,f,d,M,B,K){var te,fe=f&v,be=f&x,Me=f&S;if(d&&(te=B?d(s,M,B,K):d(s)),te!==t)return te;if(!ar(s))return s;var Te=vt(s);if(Te){if(te=lS(s),!fe)return pn(s,te)}else{var Ie=jr(s),Le=Ie==ee||Ie==ne;if(_s(s))return hv(s,fe);if(Ie==re||Ie==k||Le&&!B){if(te=be||Le?{}:Dv(s),!fe)return be?eS(s,EA(te,s)):QA(s,H2(te,s))}else{if(!tr[Ie])return B?s:{};te=hS(s,Ie,fe)}}K||(K=new ki);var ze=K.get(s);if(ze)return ze;K.set(s,te),sy(s)?s.forEach(function(Qe){te.add(si(Qe,f,d,Qe,s,K))}):iy(s)&&s.forEach(function(Qe,Ct){te.set(Ct,si(Qe,f,d,Ct,s,K))});var Ze=Me?be?Hp:qp:be?bn:Ar,_t=Te?t:Ze(s);return ni(_t||s,function(Qe,Ct){_t&&(Ct=Qe,Qe=s[Ct]),Wc(te,Ct,si(Qe,f,d,Ct,s,K))}),te}o(si,"baseClone");function AA(s){var f=Ar(s);return function(d){return z2(d,s,f)}}o(AA,"baseConforms");function z2(s,f,d){var M=d.length;if(s==null)return!M;for(s=Zt(s);M--;){var B=d[M],K=f[B],te=s[B];if(te===t&&!(B in s)||!K(te))return!1}return!0}o(z2,"baseConformsTo");function K2(s,f,d){if(typeof s!="function")throw new ii(i);return tu(function(){s.apply(t,d)},f)}o(K2,"baseDelay");function Jc(s,f,d,M){var B=-1,K=Ol,te=!0,fe=s.length,be=[],Me=f.length;if(!fe)return be;d&&(f=sr(f,In(d))),M?(K=fp,te=!1):f.length>=r&&(K=Hc,te=!1,f=new ma(f));e:for(;++B<fe;){var Te=s[B],Ie=d==null?Te:d(Te);if(Te=M||Te!==0?Te:0,te&&Ie===Ie){for(var Le=Me;Le--;)if(f[Le]===Ie)continue e;be.push(Te)}else K(f,Ie,M)||be.push(Te)}return be}o(Jc,"baseDifference");var vs=gv(eo),j2=gv(Ap,!0);function SA(s,f){var d=!0;return vs(s,function(M,B,K){return d=!!f(M,B,K),d}),d}o(SA,"baseEvery");function Yl(s,f,d){for(var M=-1,B=s.length;++M<B;){var K=s[M],te=f(K);if(te!=null&&(fe===t?te===te&&!On(te):d(te,fe)))var fe=te,be=K}return be}o(Yl,"baseExtremum");function MA(s,f,d,M){var B=s.length;for(d=wt(d),d<0&&(d=-d>B?0:B+d),M=M===t||M>B?B:wt(M),M<0&&(M+=B),M=d>M?0:fy(M);d<M;)s[d++]=f;return s}o(MA,"baseFill");function G2(s,f){var d=[];return vs(s,function(M,B,K){f(M,B,K)&&d.push(M)}),d}o(G2,"baseFilter");function Pr(s,f,d,M,B){var K=-1,te=s.length;for(d||(d=pS),B||(B=[]);++K<te;){var fe=s[K];f>0&&d(fe)?f>1?Pr(fe,f-1,d,M,B):ps(B,fe):M||(B[B.length]=fe)}return B}o(Pr,"baseFlatten");var Ep=vv(),V2=vv(!0);function eo(s,f){return s&&Ep(s,f,Ar)}o(eo,"baseForOwn");function Ap(s,f){return s&&V2(s,f,Ar)}o(Ap,"baseForOwnRight");function Xl(s,f){return ds(f,function(d){return Bo(s[d])})}o(Xl,"baseFunctions");function ga(s,f){f=xs(f,s);for(var d=0,M=f.length;s!=null&&d<M;)s=s[ro(f[d++])];return d&&d==M?s:t}o(ga,"baseGet");function W2(s,f,d){var M=f(s);return vt(s)?M:ps(M,d(s))}o(W2,"baseGetAllKeys");function nn(s){return s==null?s===t?He:ge:da&&da in Zt(s)?fS(s):wS(s)}o(nn,"baseGetTag");function Sp(s,f){return s>f}o(Sp,"baseGt");function TA(s,f){return s!=null&&Vt.call(s,f)}o(TA,"baseHas");function CA(s,f){return s!=null&&f in Zt(s)}o(CA,"baseHasIn");function kA(s,f,d){return s>=Kr(f,d)&&s<wr(f,d)}o(kA,"baseInRange");function Mp(s,f,d){for(var M=d?fp:Ol,B=s[0].length,K=s.length,te=K,fe=xe(K),be=1/0,Me=[];te--;){var Te=s[te];te&&f&&(Te=sr(Te,In(f))),be=Kr(Te.length,be),fe[te]=!d&&(f||B>=120&&Te.length>=120)?new ma(te&&Te):t}Te=s[0];var Ie=-1,Le=fe[0];e:for(;++Ie<B&&Me.length<be;){var ze=Te[Ie],Ze=f?f(ze):ze;if(ze=d||ze!==0?ze:0,!(Le?Hc(Le,Ze):M(Me,Ze,d))){for(te=K;--te;){var _t=fe[te];if(!(_t?Hc(_t,Ze):M(s[te],Ze,d)))continue e}Le&&Le.push(Ze),Me.push(ze)}}return Me}o(Mp,"baseIntersection");function IA(s,f,d,M){return eo(s,function(B,K,te){f(M,d(B),K,te)}),M}o(IA,"baseInverter");function Yc(s,f,d){f=xs(f,s),s=Pv(s,f);var M=s==null?s:s[ro(fi(f))];return M==null?t:kn(M,s,d)}o(Yc,"baseInvoke");function J2(s){return fr(s)&&nn(s)==k}o(J2,"baseIsArguments");function DA(s){return fr(s)&&nn(s)==pr}o(DA,"baseIsArrayBuffer");function OA(s){return fr(s)&&nn(s)==se}o(OA,"baseIsDate");function Xc(s,f,d,M,B){return s===f?!0:s==null||f==null||!fr(s)&&!fr(f)?s!==s&&f!==f:RA(s,f,d,M,Xc,B)}o(Xc,"baseIsEqual");function RA(s,f,d,M,B,K){var te=vt(s),fe=vt(f),be=te?he:jr(s),Me=fe?he:jr(f);be=be==k?re:be,Me=Me==k?re:Me;var Te=be==re,Ie=Me==re,Le=be==Me;if(Le&&_s(s)){if(!_s(f))return!1;te=!0,Te=!1}if(Le&&!Te)return K||(K=new ki),te||Of(s)?Cv(s,f,d,M,B,K):sS(s,f,be,d,M,B,K);if(!(d&O)){var ze=Te&&Vt.call(s,"__wrapped__"),Ze=Ie&&Vt.call(f,"__wrapped__");if(ze||Ze){var _t=ze?s.value():s,Qe=Ze?f.value():f;return K||(K=new ki),B(_t,Qe,d,M,K)}}return Le?(K||(K=new ki),aS(s,f,d,M,B,K)):!1}o(RA,"baseIsEqualDeep");function NA(s){return fr(s)&&jr(s)==ae}o(NA,"baseIsMap");function Tp(s,f,d,M){var B=d.length,K=B,te=!M;if(s==null)return!K;for(s=Zt(s);B--;){var fe=d[B];if(te&&fe[2]?fe[1]!==s[fe[0]]:!(fe[0]in s))return!1}for(;++B<K;){fe=d[B];var be=fe[0],Me=s[be],Te=fe[1];if(te&&fe[2]){if(Me===t&&!(be in s))return!1}else{var Ie=new ki;if(M)var Le=M(Me,Te,be,s,f,Ie);if(!(Le===t?Xc(Te,Me,O|R,M,Ie):Le))return!1}}return!0}o(Tp,"baseIsMatch");function Y2(s){if(!ar(s)||bS(s))return!1;var f=Bo(s)?N7:qt;return f.test(ya(s))}o(Y2,"baseIsNative");function PA(s){return fr(s)&&nn(s)==ve}o(PA,"baseIsRegExp");function LA(s){return fr(s)&&jr(s)==V}o(LA,"baseIsSet");function BA(s){return fr(s)&&ph(s.length)&&!!ir[nn(s)]}o(BA,"baseIsTypedArray");function X2(s){return typeof s=="function"?s:s==null?gn:typeof s=="object"?vt(s)?ev(s[0],s[1]):Q2(s):yy(s)}o(X2,"baseIteratee");function Cp(s){if(!eu(s))return F7(s);var f=[];for(var d in Zt(s))Vt.call(s,d)&&d!="constructor"&&f.push(d);return f}o(Cp,"baseKeys");function UA(s){if(!ar(s))return xS(s);var f=eu(s),d=[];for(var M in s)M=="constructor"&&(f||!Vt.call(s,M))||d.push(M);return d}o(UA,"baseKeysIn");function kp(s,f){return s<f}o(kp,"baseLt");function Z2(s,f){var d=-1,M=mn(s)?xe(s.length):[];return vs(s,function(B,K,te){M[++d]=f(B,K,te)}),M}o(Z2,"baseMap");function Q2(s){var f=Kp(s);return f.length==1&&f[0][2]?Rv(f[0][0],f[0][1]):function(d){return d===s||Tp(d,s,f)}}o(Q2,"baseMatches");function ev(s,f){return Gp(s)&&Ov(f)?Rv(ro(s),f):function(d){var M=rm(d,s);return M===t&&M===f?nm(d,s):Xc(f,M,O|R)}}o(ev,"baseMatchesProperty");function Zl(s,f,d,M,B){s!==f&&Ep(f,function(K,te){if(B||(B=new ki),ar(K))$A(s,f,te,d,Zl,M,B);else{var fe=M?M(Wp(s,te),K,te+"",s,f,B):t;fe===t&&(fe=K),wp(s,te,fe)}},bn)}o(Zl,"baseMerge");function $A(s,f,d,M,B,K,te){var fe=Wp(s,d),be=Wp(f,d),Me=te.get(be);if(Me){wp(s,d,Me);return}var Te=K?K(fe,be,d+"",s,f,te):t,Ie=Te===t;if(Ie){var Le=vt(be),ze=!Le&&_s(be),Ze=!Le&&!ze&&Of(be);Te=be,Le||ze||Ze?vt(fe)?Te=fe:mr(fe)?Te=pn(fe):ze?(Ie=!1,Te=hv(be,!0)):Ze?(Ie=!1,Te=dv(be,!0)):Te=[]:ru(be)||xa(be)?(Te=fe,xa(fe)?Te=cy(fe):(!ar(fe)||Bo(fe))&&(Te=Dv(be))):Ie=!1}Ie&&(te.set(be,Te),B(Te,be,M,K,te),te.delete(be)),wp(s,d,Te)}o($A,"baseMergeDeep");function tv(s,f){var d=s.length;if(!!d)return f+=f<0?d:0,Lo(f,d)?s[f]:t}o(tv,"baseNth");function rv(s,f,d){f.length?f=sr(f,function(K){return vt(K)?function(te){return ga(te,K.length===1?K[0]:K)}:K}):f=[gn];var M=-1;f=sr(f,In(Ye()));var B=Z2(s,function(K,te,fe){var be=sr(f,function(Me){return Me(K)});return{criteria:be,index:++M,value:K}});return h7(B,function(K,te){return ZA(K,te,d)})}o(rv,"baseOrderBy");function FA(s,f){return nv(s,f,function(d,M){return nm(s,M)})}o(FA,"basePick");function nv(s,f,d){for(var M=-1,B=f.length,K={};++M<B;){var te=f[M],fe=ga(s,te);d(fe,te)&&Zc(K,xs(te,s),fe)}return K}o(nv,"basePickBy");function qA(s){return function(f){return ga(f,s)}}o(qA,"basePropertyDeep");function Ip(s,f,d,M){var B=M?l7:_f,K=-1,te=f.length,fe=s;for(s===f&&(f=pn(f)),d&&(fe=sr(s,In(d)));++K<te;)for(var be=0,Me=f[K],Te=d?d(Me):Me;(be=B(fe,Te,be,M))>-1;)fe!==s&&Hl.call(fe,be,1),Hl.call(s,be,1);return s}o(Ip,"basePullAll");function iv(s,f){for(var d=s?f.length:0,M=d-1;d--;){var B=f[d];if(d==M||B!==K){var K=B;Lo(B)?Hl.call(s,B,1):Np(s,B)}}return s}o(iv,"basePullAt");function Dp(s,f){return s+jl(U2()*(f-s+1))}o(Dp,"baseRandom");function HA(s,f,d,M){for(var B=-1,K=wr(Kl((f-s)/(d||1)),0),te=xe(K);K--;)te[M?K:++B]=s,s+=d;return te}o(HA,"baseRange");function Op(s,f){var d="";if(!s||f<1||f>_)return d;do f%2&&(d+=s),f=jl(f/2),f&&(s+=s);while(f);return d}o(Op,"baseRepeat");function St(s,f){return Jp(Nv(s,f,gn),s+"")}o(St,"baseRest");function zA(s){return q2(Rf(s))}o(zA,"baseSample");function KA(s,f){var d=Rf(s);return fh(d,ba(f,0,d.length))}o(KA,"baseSampleSize");function Zc(s,f,d,M){if(!ar(s))return s;f=xs(f,s);for(var B=-1,K=f.length,te=K-1,fe=s;fe!=null&&++B<K;){var be=ro(f[B]),Me=d;if(be==="__proto__"||be==="constructor"||be==="prototype")return s;if(B!=te){var Te=fe[be];Me=M?M(Te,be,fe):t,Me===t&&(Me=ar(Te)?Te:Lo(f[B+1])?[]:{})}Wc(fe,be,Me),fe=fe[be]}return s}o(Zc,"baseSet");var ov=Gl?function(s,f){return Gl.set(s,f),s}:gn,jA=zl?function(s,f){return zl(s,"toString",{configurable:!0,enumerable:!1,value:om(f),writable:!0})}:gn;function GA(s){return fh(Rf(s))}o(GA,"baseShuffle");function ai(s,f,d){var M=-1,B=s.length;f<0&&(f=-f>B?0:B+f),d=d>B?B:d,d<0&&(d+=B),B=f>d?0:d-f>>>0,f>>>=0;for(var K=xe(B);++M<B;)K[M]=s[M+f];return K}o(ai,"baseSlice");function VA(s,f){var d;return vs(s,function(M,B,K){return d=f(M,B,K),!d}),!!d}o(VA,"baseSome");function Ql(s,f,d){var M=0,B=s==null?M:s.length;if(typeof f=="number"&&f===f&&B<=N){for(;M<B;){var K=M+B>>>1,te=s[K];te!==null&&!On(te)&&(d?te<=f:te<f)?M=K+1:B=K}return B}return Rp(s,f,gn,d)}o(Ql,"baseSortedIndex");function Rp(s,f,d,M){var B=0,K=s==null?0:s.length;if(K===0)return 0;f=d(f);for(var te=f!==f,fe=f===null,be=On(f),Me=f===t;B<K;){var Te=jl((B+K)/2),Ie=d(s[Te]),Le=Ie!==t,ze=Ie===null,Ze=Ie===Ie,_t=On(Ie);if(te)var Qe=M||Ze;else Me?Qe=Ze&&(M||Le):fe?Qe=Ze&&Le&&(M||!ze):be?Qe=Ze&&Le&&!ze&&(M||!_t):ze||_t?Qe=!1:Qe=M?Ie<=f:Ie<f;Qe?B=Te+1:K=Te}return Kr(K,C)}o(Rp,"baseSortedIndexBy");function sv(s,f){for(var d=-1,M=s.length,B=0,K=[];++d<M;){var te=s[d],fe=f?f(te):te;if(!d||!Ii(fe,be)){var be=fe;K[B++]=te===0?0:te}}return K}o(sv,"baseSortedUniq");function av(s){return typeof s=="number"?s:On(s)?E:+s}o(av,"baseToNumber");function Dn(s){if(typeof s=="string")return s;if(vt(s))return sr(s,Dn)+"";if(On(s))return $2?$2.call(s):"";var f=s+"";return f=="0"&&1/s==-p?"-0":f}o(Dn,"baseToString");function ys(s,f,d){var M=-1,B=Ol,K=s.length,te=!0,fe=[],be=fe;if(d)te=!1,B=fp;else if(K>=r){var Me=f?null:iS(s);if(Me)return Nl(Me);te=!1,B=Hc,be=new ma}else be=f?[]:fe;e:for(;++M<K;){var Te=s[M],Ie=f?f(Te):Te;if(Te=d||Te!==0?Te:0,te&&Ie===Ie){for(var Le=be.length;Le--;)if(be[Le]===Ie)continue e;f&&be.push(Ie),fe.push(Te)}else B(be,Ie,d)||(be!==fe&&be.push(Ie),fe.push(Te))}return fe}o(ys,"baseUniq");function Np(s,f){return f=xs(f,s),s=Pv(s,f),s==null||delete s[ro(fi(f))]}o(Np,"baseUnset");function fv(s,f,d,M){return Zc(s,f,d(ga(s,f)),M)}o(fv,"baseUpdate");function eh(s,f,d,M){for(var B=s.length,K=M?B:-1;(M?K--:++K<B)&&f(s[K],K,s););return d?ai(s,M?0:K,M?K+1:B):ai(s,M?K+1:0,M?B:K)}o(eh,"baseWhile");function cv(s,f){var d=s;return d instanceof Dt&&(d=d.value()),cp(f,function(M,B){return B.func.apply(B.thisArg,ps([M],B.args))},d)}o(cv,"baseWrapperValue");function Pp(s,f,d){var M=s.length;if(M<2)return M?ys(s[0]):[];for(var B=-1,K=xe(M);++B<M;)for(var te=s[B],fe=-1;++fe<M;)fe!=B&&(K[B]=Jc(K[B]||te,s[fe],f,d));return ys(Pr(K,1),f,d)}o(Pp,"baseXor");function uv(s,f,d){for(var M=-1,B=s.length,K=f.length,te={};++M<B;){var fe=M<K?f[M]:t;d(te,s[M],fe)}return te}o(uv,"baseZipObject");function Lp(s){return mr(s)?s:[]}o(Lp,"castArrayLikeObject");function Bp(s){return typeof s=="function"?s:gn}o(Bp,"castFunction");function xs(s,f){return vt(s)?s:Gp(s,f)?[s]:$v(Kt(s))}o(xs,"castPath");var WA=St;function ws(s,f,d){var M=s.length;return d=d===t?M:d,!f&&d>=M?s:ai(s,f,d)}o(ws,"castSlice");var lv=P7||function(s){return Er.clearTimeout(s)};function hv(s,f){if(f)return s.slice();var d=s.length,M=R2?R2(d):new s.constructor(d);return s.copy(M),M}o(hv,"cloneBuffer");function Up(s){var f=new s.constructor(s.byteLength);return new Fl(f).set(new Fl(s)),f}o(Up,"cloneArrayBuffer");function JA(s,f){var d=f?Up(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.byteLength)}o(JA,"cloneDataView");function YA(s){var f=new s.constructor(s.source,tt.exec(s));return f.lastIndex=s.lastIndex,f}o(YA,"cloneRegExp");function XA(s){return Vc?Zt(Vc.call(s)):{}}o(XA,"cloneSymbol");function dv(s,f){var d=f?Up(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.length)}o(dv,"cloneTypedArray");function pv(s,f){if(s!==f){var d=s!==t,M=s===null,B=s===s,K=On(s),te=f!==t,fe=f===null,be=f===f,Me=On(f);if(!fe&&!Me&&!K&&s>f||K&&te&&be&&!fe&&!Me||M&&te&&be||!d&&be||!B)return 1;if(!M&&!K&&!Me&&s<f||Me&&d&&B&&!M&&!K||fe&&d&&B||!te&&B||!be)return-1}return 0}o(pv,"compareAscending");function ZA(s,f,d){for(var M=-1,B=s.criteria,K=f.criteria,te=B.length,fe=d.length;++M<te;){var be=pv(B[M],K[M]);if(be){if(M>=fe)return be;var Me=d[M];return be*(Me=="desc"?-1:1)}}return s.index-f.index}o(ZA,"compareMultiple");function mv(s,f,d,M){for(var B=-1,K=s.length,te=d.length,fe=-1,be=f.length,Me=wr(K-te,0),Te=xe(be+Me),Ie=!M;++fe<be;)Te[fe]=f[fe];for(;++B<te;)(Ie||B<K)&&(Te[d[B]]=s[B]);for(;Me--;)Te[fe++]=s[B++];return Te}o(mv,"composeArgs");function bv(s,f,d,M){for(var B=-1,K=s.length,te=-1,fe=d.length,be=-1,Me=f.length,Te=wr(K-fe,0),Ie=xe(Te+Me),Le=!M;++B<Te;)Ie[B]=s[B];for(var ze=B;++be<Me;)Ie[ze+be]=f[be];for(;++te<fe;)(Le||B<K)&&(Ie[ze+d[te]]=s[B++]);return Ie}o(bv,"composeArgsRight");function pn(s,f){var d=-1,M=s.length;for(f||(f=xe(M));++d<M;)f[d]=s[d];return f}o(pn,"copyArray");function to(s,f,d,M){var B=!d;d||(d={});for(var K=-1,te=f.length;++K<te;){var fe=f[K],be=M?M(d[fe],s[fe],fe,d,s):t;be===t&&(be=s[fe]),B?Ro(d,fe,be):Wc(d,fe,be)}return d}o(to,"copyObject");function QA(s,f){return to(s,jp(s),f)}o(QA,"copySymbols");function eS(s,f){return to(s,kv(s),f)}o(eS,"copySymbolsIn");function th(s,f){return function(d,M){var B=vt(d)?o7:_A,K=f?f():{};return B(d,s,Ye(M,2),K)}}o(th,"createAggregator");function kf(s){return St(function(f,d){var M=-1,B=d.length,K=B>1?d[B-1]:t,te=B>2?d[2]:t;for(K=s.length>3&&typeof K=="function"?(B--,K):t,te&&on(d[0],d[1],te)&&(K=B<3?t:K,B=1),f=Zt(f);++M<B;){var fe=d[M];fe&&s(f,fe,M,K)}return f})}o(kf,"createAssigner");function gv(s,f){return function(d,M){if(d==null)return d;if(!mn(d))return s(d,M);for(var B=d.length,K=f?B:-1,te=Zt(d);(f?K--:++K<B)&&M(te[K],K,te)!==!1;);return d}}o(gv,"createBaseEach");function vv(s){return function(f,d,M){for(var B=-1,K=Zt(f),te=M(f),fe=te.length;fe--;){var be=te[s?fe:++B];if(d(K[be],be,K)===!1)break}return f}}o(vv,"createBaseFor");function tS(s,f,d){var M=f&D,B=Qc(s);function K(){var te=this&&this!==Er&&this instanceof K?B:s;return te.apply(M?d:this,arguments)}return o(K,"wrapper"),K}o(tS,"createBind");function yv(s){return function(f){f=Kt(f);var d=Ef(f)?Ci(f):t,M=d?d[0]:f.charAt(0),B=d?ws(d,1).join(""):f.slice(1);return M[s]()+B}}o(yv,"createCaseFirst");function If(s){return function(f){return cp(gy(by(f).replace(j9,"")),s,"")}}o(If,"createCompounder");function Qc(s){return function(){var f=arguments;switch(f.length){case 0:return new s;case 1:return new s(f[0]);case 2:return new s(f[0],f[1]);case 3:return new s(f[0],f[1],f[2]);case 4:return new s(f[0],f[1],f[2],f[3]);case 5:return new s(f[0],f[1],f[2],f[3],f[4]);case 6:return new s(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new s(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var d=Cf(s.prototype),M=s.apply(d,f);return ar(M)?M:d}}o(Qc,"createCtor");function rS(s,f,d){var M=Qc(s);function B(){for(var K=arguments.length,te=xe(K),fe=K,be=Df(B);fe--;)te[fe]=arguments[fe];var Me=K<3&&te[0]!==be&&te[K-1]!==be?[]:ms(te,be);if(K-=Me.length,K<d)return Av(s,f,rh,B.placeholder,t,te,Me,t,t,d-K);var Te=this&&this!==Er&&this instanceof B?M:s;return kn(Te,this,te)}return o(B,"wrapper"),B}o(rS,"createCurry");function xv(s){return function(f,d,M){var B=Zt(f);if(!mn(f)){var K=Ye(d,3);f=Ar(f),d=o(function(fe){return K(B[fe],fe,B)},"predicate")}var te=s(f,d,M);return te>-1?B[K?f[te]:te]:t}}o(xv,"createFind");function wv(s){return Po(function(f){var d=f.length,M=d,B=oi.prototype.thru;for(s&&f.reverse();M--;){var K=f[M];if(typeof K!="function")throw new ii(i);if(B&&!te&&sh(K)=="wrapper")var te=new oi([],!0)}for(M=te?M:d;++M<d;){K=f[M];var fe=sh(K),be=fe=="wrapper"?zp(K):t;be&&Vp(be[0])&&be[1]==(oe|L|Q|j)&&!be[4].length&&be[9]==1?te=te[sh(be[0])].apply(te,be[3]):te=K.length==1&&Vp(K)?te[fe]():te.thru(K)}return function(){var Me=arguments,Te=Me[0];if(te&&Me.length==1&&vt(Te))return te.plant(Te).value();for(var Ie=0,Le=d?f[Ie].apply(this,Me):Te;++Ie<d;)Le=f[Ie].call(this,Le);return Le}})}o(wv,"createFlow");function rh(s,f,d,M,B,K,te,fe,be,Me){var Te=f&oe,Ie=f&D,Le=f&P,ze=f&(L|W),Ze=f&H,_t=Le?t:Qc(s);function Qe(){for(var Ct=arguments.length,Nt=xe(Ct),Rn=Ct;Rn--;)Nt[Rn]=arguments[Rn];if(ze)var sn=Df(Qe),Nn=p7(Nt,sn);if(M&&(Nt=mv(Nt,M,B,ze)),K&&(Nt=bv(Nt,K,te,ze)),Ct-=Nn,ze&&Ct<Me){var br=ms(Nt,sn);return Av(s,f,rh,Qe.placeholder,d,Nt,br,fe,be,Me-Ct)}var Di=Ie?d:this,$o=Le?Di[s]:s;return Ct=Nt.length,fe?Nt=_S(Nt,fe):Ze&&Ct>1&&Nt.reverse(),Te&&be<Ct&&(Nt.length=be),this&&this!==Er&&this instanceof Qe&&($o=_t||Qc($o)),$o.apply(Di,Nt)}return o(Qe,"wrapper"),Qe}o(rh,"createHybrid");function _v(s,f){return function(d,M){return IA(d,s,f(M),{})}}o(_v,"createInverter");function nh(s,f){return function(d,M){var B;if(d===t&&M===t)return f;if(d!==t&&(B=d),M!==t){if(B===t)return M;typeof d=="string"||typeof M=="string"?(d=Dn(d),M=Dn(M)):(d=av(d),M=av(M)),B=s(d,M)}return B}}o(nh,"createMathOperation");function $p(s){return Po(function(f){return f=sr(f,In(Ye())),St(function(d){var M=this;return s(f,function(B){return kn(B,M,d)})})})}o($p,"createOver");function ih(s,f){f=f===t?" ":Dn(f);var d=f.length;if(d<2)return d?Op(f,s):f;var M=Op(f,Kl(s/Af(f)));return Ef(f)?ws(Ci(M),0,s).join(""):M.slice(0,s)}o(ih,"createPadding");function nS(s,f,d,M){var B=f&D,K=Qc(s);function te(){for(var fe=-1,be=arguments.length,Me=-1,Te=M.length,Ie=xe(Te+be),Le=this&&this!==Er&&this instanceof te?K:s;++Me<Te;)Ie[Me]=M[Me];for(;be--;)Ie[Me++]=arguments[++fe];return kn(Le,B?d:this,Ie)}return o(te,"wrapper"),te}o(nS,"createPartial");function Ev(s){return function(f,d,M){return M&&typeof M!="number"&&on(f,d,M)&&(d=M=t),f=Uo(f),d===t?(d=f,f=0):d=Uo(d),M=M===t?f<d?1:-1:Uo(M),HA(f,d,M,s)}}o(Ev,"createRange");function oh(s){return function(f,d){return typeof f=="string"&&typeof d=="string"||(f=ci(f),d=ci(d)),s(f,d)}}o(oh,"createRelationalOperation");function Av(s,f,d,M,B,K,te,fe,be,Me){var Te=f&L,Ie=Te?te:t,Le=Te?t:te,ze=Te?K:t,Ze=Te?t:K;f|=Te?Q:Y,f&=~(Te?Y:Q),f&J||(f&=~(D|P));var _t=[s,f,B,ze,Ie,Ze,Le,fe,be,Me],Qe=d.apply(t,_t);return Vp(s)&&Lv(Qe,_t),Qe.placeholder=M,Bv(Qe,s,f)}o(Av,"createRecurry");function Fp(s){var f=xr[s];return function(d,M){if(d=ci(d),M=M==null?0:Kr(wt(M),292),M&&B2(d)){var B=(Kt(d)+"e").split("e"),K=f(B[0]+"e"+(+B[1]+M));return B=(Kt(K)+"e").split("e"),+(B[0]+"e"+(+B[1]-M))}return f(d)}}o(Fp,"createRound");var iS=Mf&&1/Nl(new Mf([,-0]))[1]==p?function(s){return new Mf(s)}:fm;function Sv(s){return function(f){var d=jr(f);return d==ae?bp(f):d==V?w7(f):d7(f,s(f))}}o(Sv,"createToPairs");function No(s,f,d,M,B,K,te,fe){var be=f&P;if(!be&&typeof s!="function")throw new ii(i);var Me=M?M.length:0;if(Me||(f&=~(Q|Y),M=B=t),te=te===t?te:wr(wt(te),0),fe=fe===t?fe:wt(fe),Me-=B?B.length:0,f&Y){var Te=M,Ie=B;M=B=t}var Le=be?t:zp(s),ze=[s,f,d,M,B,Te,Ie,K,te,fe];if(Le&&yS(ze,Le),s=ze[0],f=ze[1],d=ze[2],M=ze[3],B=ze[4],fe=ze[9]=ze[9]===t?be?0:s.length:wr(ze[9]-Me,0),!fe&&f&(L|W)&&(f&=~(L|W)),!f||f==D)var Ze=tS(s,f,d);else f==L||f==W?Ze=rS(s,f,fe):(f==Q||f==(D|Q))&&!B.length?Ze=nS(s,f,d,M):Ze=rh.apply(t,ze);var _t=Le?ov:Lv;return Bv(_t(Ze,ze),s,f)}o(No,"createWrap");function Mv(s,f,d,M){return s===t||Ii(s,Sf[d])&&!Vt.call(M,d)?f:s}o(Mv,"customDefaultsAssignIn");function Tv(s,f,d,M,B,K){return ar(s)&&ar(f)&&(K.set(f,s),Zl(s,f,t,Tv,K),K.delete(f)),s}o(Tv,"customDefaultsMerge");function oS(s){return ru(s)?t:s}o(oS,"customOmitClone");function Cv(s,f,d,M,B,K){var te=d&O,fe=s.length,be=f.length;if(fe!=be&&!(te&&be>fe))return!1;var Me=K.get(s),Te=K.get(f);if(Me&&Te)return Me==f&&Te==s;var Ie=-1,Le=!0,ze=d&R?new ma:t;for(K.set(s,f),K.set(f,s);++Ie<fe;){var Ze=s[Ie],_t=f[Ie];if(M)var Qe=te?M(_t,Ze,Ie,f,s,K):M(Ze,_t,Ie,s,f,K);if(Qe!==t){if(Qe)continue;Le=!1;break}if(ze){if(!up(f,function(Ct,Nt){if(!Hc(ze,Nt)&&(Ze===Ct||B(Ze,Ct,d,M,K)))return ze.push(Nt)})){Le=!1;break}}else if(!(Ze===_t||B(Ze,_t,d,M,K))){Le=!1;break}}return K.delete(s),K.delete(f),Le}o(Cv,"equalArrays");function sS(s,f,d,M,B,K,te){switch(d){case ue:if(s.byteLength!=f.byteLength||s.byteOffset!=f.byteOffset)return!1;s=s.buffer,f=f.buffer;case pr:return!(s.byteLength!=f.byteLength||!K(new Fl(s),new Fl(f)));case Z:case se:case Ae:return Ii(+s,+f);case F:return s.name==f.name&&s.message==f.message;case ve:case pe:return s==f+"";case ae:var fe=bp;case V:var be=M&O;if(fe||(fe=Nl),s.size!=f.size&&!be)return!1;var Me=te.get(s);if(Me)return Me==f;M|=R,te.set(s,f);var Te=Cv(fe(s),fe(f),M,B,K,te);return te.delete(s),Te;case Ce:if(Vc)return Vc.call(s)==Vc.call(f)}return!1}o(sS,"equalByTag");function aS(s,f,d,M,B,K){var te=d&O,fe=qp(s),be=fe.length,Me=qp(f),Te=Me.length;if(be!=Te&&!te)return!1;for(var Ie=be;Ie--;){var Le=fe[Ie];if(!(te?Le in f:Vt.call(f,Le)))return!1}var ze=K.get(s),Ze=K.get(f);if(ze&&Ze)return ze==f&&Ze==s;var _t=!0;K.set(s,f),K.set(f,s);for(var Qe=te;++Ie<be;){Le=fe[Ie];var Ct=s[Le],Nt=f[Le];if(M)var Rn=te?M(Nt,Ct,Le,f,s,K):M(Ct,Nt,Le,s,f,K);if(!(Rn===t?Ct===Nt||B(Ct,Nt,d,M,K):Rn)){_t=!1;break}Qe||(Qe=Le=="constructor")}if(_t&&!Qe){var sn=s.constructor,Nn=f.constructor;sn!=Nn&&"constructor"in s&&"constructor"in f&&!(typeof sn=="function"&&sn instanceof sn&&typeof Nn=="function"&&Nn instanceof Nn)&&(_t=!1)}return K.delete(s),K.delete(f),_t}o(aS,"equalObjects");function Po(s){return Jp(Nv(s,t,zv),s+"")}o(Po,"flatRest");function qp(s){return W2(s,Ar,jp)}o(qp,"getAllKeys");function Hp(s){return W2(s,bn,kv)}o(Hp,"getAllKeysIn");var zp=Gl?function(s){return Gl.get(s)}:fm;function sh(s){for(var f=s.name+"",d=Tf[f],M=Vt.call(Tf,f)?d.length:0;M--;){var B=d[M],K=B.func;if(K==null||K==s)return B.name}return f}o(sh,"getFuncName");function Df(s){var f=Vt.call(z,"placeholder")?z:s;return f.placeholder}o(Df,"getHolder");function Ye(){var s=z.iteratee||sm;return s=s===sm?X2:s,arguments.length?s(arguments[0],arguments[1]):s}o(Ye,"getIteratee");function ah(s,f){var d=s.__data__;return mS(f)?d[typeof f=="string"?"string":"hash"]:d.map}o(ah,"getMapData");function Kp(s){for(var f=Ar(s),d=f.length;d--;){var M=f[d],B=s[M];f[d]=[M,B,Ov(B)]}return f}o(Kp,"getMatchData");function va(s,f){var d=v7(s,f);return Y2(d)?d:t}o(va,"getNative");function fS(s){var f=Vt.call(s,da),d=s[da];try{s[da]=t;var M=!0}catch{}var B=Ul.call(s);return M&&(f?s[da]=d:delete s[da]),B}o(fS,"getRawTag");var jp=vp?function(s){return s==null?[]:(s=Zt(s),ds(vp(s),function(f){return P2.call(s,f)}))}:cm,kv=vp?function(s){for(var f=[];s;)ps(f,jp(s)),s=ql(s);return f}:cm,jr=nn;(yp&&jr(new yp(new ArrayBuffer(1)))!=ue||Kc&&jr(new Kc)!=ae||xp&&jr(xp.resolve())!=Se||Mf&&jr(new Mf)!=V||jc&&jr(new jc)!=Re)&&(jr=o(function(s){var f=nn(s),d=f==re?s.constructor:t,M=d?ya(d):"";if(M)switch(M){case K7:return ue;case j7:return ae;case G7:return Se;case V7:return V;case W7:return Re}return f},"getTag"));function cS(s,f,d){for(var M=-1,B=d.length;++M<B;){var K=d[M],te=K.size;switch(K.type){case"drop":s+=te;break;case"dropRight":f-=te;break;case"take":f=Kr(f,s+te);break;case"takeRight":s=wr(s,f-te);break}}return{start:s,end:f}}o(cS,"getView");function uS(s){var f=s.match(ut);return f?f[1].split(Qn):[]}o(uS,"getWrapDetails");function Iv(s,f,d){f=xs(f,s);for(var M=-1,B=f.length,K=!1;++M<B;){var te=ro(f[M]);if(!(K=s!=null&&d(s,te)))break;s=s[te]}return K||++M!=B?K:(B=s==null?0:s.length,!!B&&ph(B)&&Lo(te,B)&&(vt(s)||xa(s)))}o(Iv,"hasPath");function lS(s){var f=s.length,d=new s.constructor(f);return f&&typeof s[0]=="string"&&Vt.call(s,"index")&&(d.index=s.index,d.input=s.input),d}o(lS,"initCloneArray");function Dv(s){return typeof s.constructor=="function"&&!eu(s)?Cf(ql(s)):{}}o(Dv,"initCloneObject");function hS(s,f,d){var M=s.constructor;switch(f){case pr:return Up(s);case Z:case se:return new M(+s);case ue:return JA(s,d);case ie:case $:case X:case me:case ye:case we:case ke:case It:case Ue:return dv(s,d);case ae:return new M;case Ae:case pe:return new M(s);case ve:return YA(s);case V:return new M;case Ce:return XA(s)}}o(hS,"initCloneByTag");function dS(s,f){var d=f.length;if(!d)return s;var M=d-1;return f[M]=(d>1?"& ":"")+f[M],f=f.join(d>2?", ":" "),s.replace(ct,`{
|
|
1
|
+
var Fk=Object.create;var iu=Object.defineProperty;var qk=Object.getOwnPropertyDescriptor;var Hk=Object.getOwnPropertyNames;var zk=Object.getPrototypeOf,Kk=Object.prototype.hasOwnProperty;var o=(t,e)=>iu(t,"name",{value:e,configurable:!0});var jt=(t,e)=>()=>(t&&(e=t(t=0)),e);var De=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var r in e)iu(t,r,{get:e[r],enumerable:!0})},Ey=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hk(e))!Kk.call(t,i)&&i!==r&&iu(t,i,{get:()=>e[i],enumerable:!(n=qk(e,i))||n.enumerable});return t};var Lt=(t,e,r)=>(r=t!=null?Fk(zk(t)):{},Ey(e||!t||!t.__esModule?iu(r,"default",{value:t,enumerable:!0}):r,t)),vh=t=>Ey(iu({},"__esModule",{value:!0}),t);var Ay=De((Pf,ou)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,m="__lodash_placeholder__",v=1,x=2,S=4,O=1,R=2,D=1,P=2,J=4,B=8,W=16,Q=32,Y=64,oe=128,j=256,H=512,G=30,le="...",T=800,h=16,y=1,b=2,l=3,p=1/0,_=9007199254740991,A=17976931348623157e292,E=0/0,g=4294967295,C=g-1,N=g>>>1,w=[["ary",oe],["bind",D],["bindKey",P],["curry",B],["curryRight",W],["flip",H],["partial",Q],["partialRight",Y],["rearg",j]],k="[object Arguments]",he="[object Array]",I="[object AsyncFunction]",Z="[object Boolean]",se="[object Date]",q="[object DOMException]",F="[object Error]",ee="[object Function]",ne="[object GeneratorFunction]",ae="[object Map]",Ae="[object Number]",ge="[object Null]",re="[object Object]",Se="[object Promise]",ce="[object Proxy]",ve="[object RegExp]",V="[object Set]",pe="[object String]",Ce="[object Symbol]",He="[object Undefined]",Re="[object WeakMap]",Ve="[object WeakSet]",pr="[object ArrayBuffer]",ue="[object DataView]",ie="[object Float32Array]",$="[object Float64Array]",X="[object Int8Array]",me="[object Int16Array]",ye="[object Int32Array]",we="[object Uint8Array]",ke="[object Uint8ClampedArray]",It="[object Uint16Array]",Ue="[object Uint32Array]",Oe=/\b__p \+= '';/g,Bt=/\b(__p \+=) '' \+/g,je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Je=/&(?:amp|lt|gt|quot|#39);/g,Tn=/[&<>"']/g,nt=RegExp(Je.source),it=RegExp(Tn.source),Yn=/<%-([\s\S]+?)%>/g,ot=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,st=/^\w*$/,at=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cn=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(cn.source),Xe=/^\s+/,Zn=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,Qn=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,ei=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,Cn=/^[-+]0x[0-9a-f]+$/i,Ft=/^0b[01]+$/i,qt=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ln=/^(?:0|[1-9]\d*)$/,hn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr=/($^)/,dn=/['\n\r\u2028\u2029\\]/g,ti="\\ud800-\\udfff",So="\\u0300-\\u036f",Mo="\\ufe20-\\ufe2f",To="\\u20d0-\\u20ff",Xi=So+Mo+To,Zi="\\u2700-\\u27bf",Qi="a-z\\xdf-\\xf6\\xf8-\\xff",Co="\\xac\\xb1\\xd7\\xf7",ko="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Io="\\u2000-\\u206f",Do=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yf="A-Z\\xc0-\\xd6\\xd8-\\xde",xf="\\ufe0e\\ufe0f",wf=Co+ko+Io+Do,np="['\u2019]",F9="["+ti+"]",i2="["+wf+"]",Ol="["+Xi+"]",o2="\\d+",q9="["+Zi+"]",s2="["+Qi+"]",a2="[^"+ti+wf+o2+Zi+Qi+yf+"]",ip="\\ud83c[\\udffb-\\udfff]",H9="(?:"+Ol+"|"+ip+")",f2="[^"+ti+"]",op="(?:\\ud83c[\\udde6-\\uddff]){2}",sp="[\\ud800-\\udbff][\\udc00-\\udfff]",_f="["+yf+"]",c2="\\u200d",u2="(?:"+s2+"|"+a2+")",z9="(?:"+_f+"|"+a2+")",l2="(?:"+np+"(?:d|ll|m|re|s|t|ve))?",h2="(?:"+np+"(?:D|LL|M|RE|S|T|VE))?",d2=H9+"?",p2="["+xf+"]?",K9="(?:"+c2+"(?:"+[f2,op,sp].join("|")+")"+p2+d2+")*",j9="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",G9="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",m2=p2+d2+K9,V9="(?:"+[q9,op,sp].join("|")+")"+m2,W9="(?:"+[f2+Ol+"?",Ol,op,sp,F9].join("|")+")",J9=RegExp(np,"g"),Y9=RegExp(Ol,"g"),ap=RegExp(ip+"(?="+ip+")|"+W9+m2,"g"),X9=RegExp([_f+"?"+s2+"+"+l2+"(?="+[i2,_f,"$"].join("|")+")",z9+"+"+h2+"(?="+[i2,_f+u2,"$"].join("|")+")",_f+"?"+u2+"+"+l2,_f+"+"+h2,G9,j9,o2,V9].join("|"),"g"),Z9=RegExp("["+c2+ti+Xi+xf+"]"),Q9=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,e7=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],t7=-1,ir={};ir[ie]=ir[$]=ir[X]=ir[me]=ir[ye]=ir[we]=ir[ke]=ir[It]=ir[Ue]=!0,ir[k]=ir[he]=ir[pr]=ir[Z]=ir[ue]=ir[se]=ir[F]=ir[ee]=ir[ae]=ir[Ae]=ir[re]=ir[ve]=ir[V]=ir[pe]=ir[Re]=!1;var tr={};tr[k]=tr[he]=tr[pr]=tr[ue]=tr[Z]=tr[se]=tr[ie]=tr[$]=tr[X]=tr[me]=tr[ye]=tr[ae]=tr[Ae]=tr[re]=tr[ve]=tr[V]=tr[pe]=tr[Ce]=tr[we]=tr[ke]=tr[It]=tr[Ue]=!0,tr[F]=tr[ee]=tr[Re]=!1;var r7={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},n7={"&":"&","<":"<",">":">",'"':""","'":"'"},i7={"&":"&","<":"<",">":">",""":'"',"'":"'"},o7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},s7=parseFloat,a7=parseInt,b2=typeof global=="object"&&global&&global.Object===Object&&global,f7=typeof self=="object"&&self&&self.Object===Object&&self,Er=b2||f7||Function("return this")(),fp=typeof Pf=="object"&&Pf&&!Pf.nodeType&&Pf,ha=fp&&typeof ou=="object"&&ou&&!ou.nodeType&&ou,g2=ha&&ha.exports===fp,cp=g2&&b2.process,ri=function(){try{var de=ha&&ha.require&&ha.require("util").types;return de||cp&&cp.binding&&cp.binding("util")}catch{}}(),v2=ri&&ri.isArrayBuffer,y2=ri&&ri.isDate,x2=ri&&ri.isMap,w2=ri&&ri.isRegExp,_2=ri&&ri.isSet,E2=ri&&ri.isTypedArray;function kn(de,Ee,xe){switch(xe.length){case 0:return de.call(Ee);case 1:return de.call(Ee,xe[0]);case 2:return de.call(Ee,xe[0],xe[1]);case 3:return de.call(Ee,xe[0],xe[1],xe[2])}return de.apply(Ee,xe)}o(kn,"apply");function c7(de,Ee,xe,qe){for(var bt=-1,Ht=de==null?0:de.length;++bt<Ht;){var xr=de[bt];Ee(qe,xr,xe(xr),de)}return qe}o(c7,"arrayAggregator");function ni(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe&&Ee(de[xe],xe,de)!==!1;);return de}o(ni,"arrayEach");function u7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(u7,"arrayEachRight");function A2(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe;)if(!Ee(de[xe],xe,de))return!1;return!0}o(A2,"arrayEvery");function ps(de,Ee){for(var xe=-1,qe=de==null?0:de.length,bt=0,Ht=[];++xe<qe;){var xr=de[xe];Ee(xr,xe,de)&&(Ht[bt++]=xr)}return Ht}o(ps,"arrayFilter");function Rl(de,Ee){var xe=de==null?0:de.length;return!!xe&&Ef(de,Ee,0)>-1}o(Rl,"arrayIncludes");function up(de,Ee,xe){for(var qe=-1,bt=de==null?0:de.length;++qe<bt;)if(xe(Ee,de[qe]))return!0;return!1}o(up,"arrayIncludesWith");function sr(de,Ee){for(var xe=-1,qe=de==null?0:de.length,bt=Array(qe);++xe<qe;)bt[xe]=Ee(de[xe],xe,de);return bt}o(sr,"arrayMap");function ms(de,Ee){for(var xe=-1,qe=Ee.length,bt=de.length;++xe<qe;)de[bt+xe]=Ee[xe];return de}o(ms,"arrayPush");function lp(de,Ee,xe,qe){var bt=-1,Ht=de==null?0:de.length;for(qe&&Ht&&(xe=de[++bt]);++bt<Ht;)xe=Ee(xe,de[bt],bt,de);return xe}o(lp,"arrayReduce");function l7(de,Ee,xe,qe){var bt=de==null?0:de.length;for(qe&&bt&&(xe=de[--bt]);bt--;)xe=Ee(xe,de[bt],bt,de);return xe}o(l7,"arrayReduceRight");function hp(de,Ee){for(var xe=-1,qe=de==null?0:de.length;++xe<qe;)if(Ee(de[xe],xe,de))return!0;return!1}o(hp,"arraySome");var h7=dp("length");function d7(de){return de.split("")}o(d7,"asciiToArray");function p7(de){return de.match(lt)||[]}o(p7,"asciiWords");function S2(de,Ee,xe){var qe;return xe(de,function(bt,Ht,xr){if(Ee(bt,Ht,xr))return qe=Ht,!1}),qe}o(S2,"baseFindKey");function Nl(de,Ee,xe,qe){for(var bt=de.length,Ht=xe+(qe?1:-1);qe?Ht--:++Ht<bt;)if(Ee(de[Ht],Ht,de))return Ht;return-1}o(Nl,"baseFindIndex");function Ef(de,Ee,xe){return Ee===Ee?M7(de,Ee,xe):Nl(de,M2,xe)}o(Ef,"baseIndexOf");function m7(de,Ee,xe,qe){for(var bt=xe-1,Ht=de.length;++bt<Ht;)if(qe(de[bt],Ee))return bt;return-1}o(m7,"baseIndexOfWith");function M2(de){return de!==de}o(M2,"baseIsNaN");function T2(de,Ee){var xe=de==null?0:de.length;return xe?mp(de,Ee)/xe:E}o(T2,"baseMean");function dp(de){return function(Ee){return Ee==null?t:Ee[de]}}o(dp,"baseProperty");function pp(de){return function(Ee){return de==null?t:de[Ee]}}o(pp,"basePropertyOf");function C2(de,Ee,xe,qe,bt){return bt(de,function(Ht,xr,Zt){xe=qe?(qe=!1,Ht):Ee(xe,Ht,xr,Zt)}),xe}o(C2,"baseReduce");function b7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(b7,"baseSortBy");function mp(de,Ee){for(var xe,qe=-1,bt=de.length;++qe<bt;){var Ht=Ee(de[qe]);Ht!==t&&(xe=xe===t?Ht:xe+Ht)}return xe}o(mp,"baseSum");function bp(de,Ee){for(var xe=-1,qe=Array(de);++xe<de;)qe[xe]=Ee(xe);return qe}o(bp,"baseTimes");function g7(de,Ee){return sr(Ee,function(xe){return[xe,de[xe]]})}o(g7,"baseToPairs");function k2(de){return de&&de.slice(0,R2(de)+1).replace(Xe,"")}o(k2,"baseTrim");function In(de){return function(Ee){return de(Ee)}}o(In,"baseUnary");function gp(de,Ee){return sr(Ee,function(xe){return de[xe]})}o(gp,"baseValues");function zc(de,Ee){return de.has(Ee)}o(zc,"cacheHas");function I2(de,Ee){for(var xe=-1,qe=de.length;++xe<qe&&Ef(Ee,de[xe],0)>-1;);return xe}o(I2,"charsStartIndex");function D2(de,Ee){for(var xe=de.length;xe--&&Ef(Ee,de[xe],0)>-1;);return xe}o(D2,"charsEndIndex");function v7(de,Ee){for(var xe=de.length,qe=0;xe--;)de[xe]===Ee&&++qe;return qe}o(v7,"countHolders");var y7=pp(r7),x7=pp(n7);function w7(de){return"\\"+o7[de]}o(w7,"escapeStringChar");function _7(de,Ee){return de==null?t:de[Ee]}o(_7,"getValue");function Af(de){return Z9.test(de)}o(Af,"hasUnicode");function E7(de){return Q9.test(de)}o(E7,"hasUnicodeWord");function A7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(A7,"iteratorToArray");function vp(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe,bt){xe[++Ee]=[bt,qe]}),xe}o(vp,"mapToArray");function O2(de,Ee){return function(xe){return de(Ee(xe))}}o(O2,"overArg");function bs(de,Ee){for(var xe=-1,qe=de.length,bt=0,Ht=[];++xe<qe;){var xr=de[xe];(xr===Ee||xr===m)&&(de[xe]=m,Ht[bt++]=xe)}return Ht}o(bs,"replaceHolders");function Pl(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=qe}),xe}o(Pl,"setToArray");function S7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=[qe,qe]}),xe}o(S7,"setToPairs");function M7(de,Ee,xe){for(var qe=xe-1,bt=de.length;++qe<bt;)if(de[qe]===Ee)return qe;return-1}o(M7,"strictIndexOf");function T7(de,Ee,xe){for(var qe=xe+1;qe--;)if(de[qe]===Ee)return qe;return qe}o(T7,"strictLastIndexOf");function Sf(de){return Af(de)?k7(de):h7(de)}o(Sf,"stringSize");function Ci(de){return Af(de)?I7(de):d7(de)}o(Ci,"stringToArray");function R2(de){for(var Ee=de.length;Ee--&&Zn.test(de.charAt(Ee)););return Ee}o(R2,"trimmedEndIndex");var C7=pp(i7);function k7(de){for(var Ee=ap.lastIndex=0;ap.test(de);)++Ee;return Ee}o(k7,"unicodeSize");function I7(de){return de.match(ap)||[]}o(I7,"unicodeToArray");function D7(de){return de.match(X9)||[]}o(D7,"unicodeWords");var O7=o(function de(Ee){Ee=Ee==null?Er:gs.defaults(Er.Object(),Ee,gs.pick(Er,e7));var xe=Ee.Array,qe=Ee.Date,bt=Ee.Error,Ht=Ee.Function,xr=Ee.Math,Zt=Ee.Object,yp=Ee.RegExp,R7=Ee.String,ii=Ee.TypeError,Ll=xe.prototype,N7=Ht.prototype,Mf=Zt.prototype,Bl=Ee["__core-js_shared__"],Ul=N7.toString,Vt=Mf.hasOwnProperty,P7=0,N2=function(){var s=/[^.]+$/.exec(Bl&&Bl.keys&&Bl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),$l=Mf.toString,L7=Ul.call(Zt),B7=Er._,U7=yp("^"+Ul.call(Vt).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fl=g2?Ee.Buffer:t,vs=Ee.Symbol,ql=Ee.Uint8Array,P2=Fl?Fl.allocUnsafe:t,Hl=O2(Zt.getPrototypeOf,Zt),L2=Zt.create,B2=Mf.propertyIsEnumerable,zl=Ll.splice,U2=vs?vs.isConcatSpreadable:t,Kc=vs?vs.iterator:t,da=vs?vs.toStringTag:t,Kl=function(){try{var s=va(Zt,"defineProperty");return s({},"",{}),s}catch{}}(),$7=Ee.clearTimeout!==Er.clearTimeout&&Ee.clearTimeout,F7=qe&&qe.now!==Er.Date.now&&qe.now,q7=Ee.setTimeout!==Er.setTimeout&&Ee.setTimeout,jl=xr.ceil,Gl=xr.floor,xp=Zt.getOwnPropertySymbols,H7=Fl?Fl.isBuffer:t,$2=Ee.isFinite,z7=Ll.join,K7=O2(Zt.keys,Zt),wr=xr.max,Kr=xr.min,j7=qe.now,G7=Ee.parseInt,F2=xr.random,V7=Ll.reverse,wp=va(Ee,"DataView"),jc=va(Ee,"Map"),_p=va(Ee,"Promise"),Tf=va(Ee,"Set"),Gc=va(Ee,"WeakMap"),Vc=va(Zt,"create"),Vl=Gc&&new Gc,Cf={},W7=ya(wp),J7=ya(jc),Y7=ya(_p),X7=ya(Tf),Z7=ya(Gc),Wl=vs?vs.prototype:t,Wc=Wl?Wl.valueOf:t,q2=Wl?Wl.toString:t;function z(s){if(fr(s)&&!vt(s)&&!(s instanceof Dt)){if(s instanceof oi)return s;if(Vt.call(s,"__wrapped__"))return Hv(s)}return new oi(s)}o(z,"lodash");var kf=function(){function s(){}return o(s,"object"),function(f){if(!ar(f))return{};if(L2)return L2(f);s.prototype=f;var d=new s;return s.prototype=t,d}}();function Jl(){}o(Jl,"baseLodash");function oi(s,f){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=t}o(oi,"LodashWrapper"),z.templateSettings={escape:Yn,evaluate:ot,interpolate:et,variable:"",imports:{_:z}},z.prototype=Jl.prototype,z.prototype.constructor=z,oi.prototype=kf(Jl.prototype),oi.prototype.constructor=oi;function Dt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}o(Dt,"LazyWrapper");function Q7(){var s=new Dt(this.__wrapped__);return s.__actions__=pn(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=pn(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=pn(this.__views__),s}o(Q7,"lazyClone");function eA(){if(this.__filtered__){var s=new Dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}o(eA,"lazyReverse");function tA(){var s=this.__wrapped__.value(),f=this.__dir__,d=vt(s),M=f<0,U=d?s.length:0,K=dS(0,U,this.__views__),te=K.start,fe=K.end,be=fe-te,Me=M?fe:te-1,Te=this.__iteratees__,Ie=Te.length,Le=0,ze=Kr(be,this.__takeCount__);if(!d||!M&&U==be&&ze==be)return lv(s,this.__actions__);var Ze=[];e:for(;be--&&Le<ze;){Me+=f;for(var _t=-1,Qe=s[Me];++_t<Ie;){var Ct=Te[_t],Nt=Ct.iteratee,Rn=Ct.type,sn=Nt(Qe);if(Rn==b)Qe=sn;else if(!sn){if(Rn==y)continue e;break e}}Ze[Le++]=Qe}return Ze}o(tA,"lazyValue"),Dt.prototype=kf(Jl.prototype),Dt.prototype.constructor=Dt;function pa(s){var f=-1,d=s==null?0:s.length;for(this.clear();++f<d;){var M=s[f];this.set(M[0],M[1])}}o(pa,"Hash");function rA(){this.__data__=Vc?Vc(null):{},this.size=0}o(rA,"hashClear");function nA(s){var f=this.has(s)&&delete this.__data__[s];return this.size-=f?1:0,f}o(nA,"hashDelete");function iA(s){var f=this.__data__;if(Vc){var d=f[s];return d===c?t:d}return Vt.call(f,s)?f[s]:t}o(iA,"hashGet");function oA(s){var f=this.__data__;return Vc?f[s]!==t:Vt.call(f,s)}o(oA,"hashHas");function sA(s,f){var d=this.__data__;return this.size+=this.has(s)?0:1,d[s]=Vc&&f===t?c:f,this}o(sA,"hashSet"),pa.prototype.clear=rA,pa.prototype.delete=nA,pa.prototype.get=iA,pa.prototype.has=oA,pa.prototype.set=sA;function Oo(s){var f=-1,d=s==null?0:s.length;for(this.clear();++f<d;){var M=s[f];this.set(M[0],M[1])}}o(Oo,"ListCache");function aA(){this.__data__=[],this.size=0}o(aA,"listCacheClear");function fA(s){var f=this.__data__,d=Yl(f,s);if(d<0)return!1;var M=f.length-1;return d==M?f.pop():zl.call(f,d,1),--this.size,!0}o(fA,"listCacheDelete");function cA(s){var f=this.__data__,d=Yl(f,s);return d<0?t:f[d][1]}o(cA,"listCacheGet");function uA(s){return Yl(this.__data__,s)>-1}o(uA,"listCacheHas");function lA(s,f){var d=this.__data__,M=Yl(d,s);return M<0?(++this.size,d.push([s,f])):d[M][1]=f,this}o(lA,"listCacheSet"),Oo.prototype.clear=aA,Oo.prototype.delete=fA,Oo.prototype.get=cA,Oo.prototype.has=uA,Oo.prototype.set=lA;function Ro(s){var f=-1,d=s==null?0:s.length;for(this.clear();++f<d;){var M=s[f];this.set(M[0],M[1])}}o(Ro,"MapCache");function hA(){this.size=0,this.__data__={hash:new pa,map:new(jc||Oo),string:new pa}}o(hA,"mapCacheClear");function dA(s){var f=fh(this,s).delete(s);return this.size-=f?1:0,f}o(dA,"mapCacheDelete");function pA(s){return fh(this,s).get(s)}o(pA,"mapCacheGet");function mA(s){return fh(this,s).has(s)}o(mA,"mapCacheHas");function bA(s,f){var d=fh(this,s),M=d.size;return d.set(s,f),this.size+=d.size==M?0:1,this}o(bA,"mapCacheSet"),Ro.prototype.clear=hA,Ro.prototype.delete=dA,Ro.prototype.get=pA,Ro.prototype.has=mA,Ro.prototype.set=bA;function ma(s){var f=-1,d=s==null?0:s.length;for(this.__data__=new Ro;++f<d;)this.add(s[f])}o(ma,"SetCache");function gA(s){return this.__data__.set(s,c),this}o(gA,"setCacheAdd");function vA(s){return this.__data__.has(s)}o(vA,"setCacheHas"),ma.prototype.add=ma.prototype.push=gA,ma.prototype.has=vA;function ki(s){var f=this.__data__=new Oo(s);this.size=f.size}o(ki,"Stack");function yA(){this.__data__=new Oo,this.size=0}o(yA,"stackClear");function xA(s){var f=this.__data__,d=f.delete(s);return this.size=f.size,d}o(xA,"stackDelete");function wA(s){return this.__data__.get(s)}o(wA,"stackGet");function _A(s){return this.__data__.has(s)}o(_A,"stackHas");function EA(s,f){var d=this.__data__;if(d instanceof Oo){var M=d.__data__;if(!jc||M.length<r-1)return M.push([s,f]),this.size=++d.size,this;d=this.__data__=new Ro(M)}return d.set(s,f),this.size=d.size,this}o(EA,"stackSet"),ki.prototype.clear=yA,ki.prototype.delete=xA,ki.prototype.get=wA,ki.prototype.has=_A,ki.prototype.set=EA;function H2(s,f){var d=vt(s),M=!d&&xa(s),U=!d&&!M&&Es(s),K=!d&&!M&&!U&&Rf(s),te=d||M||U||K,fe=te?bp(s.length,R7):[],be=fe.length;for(var Me in s)(f||Vt.call(s,Me))&&!(te&&(Me=="length"||U&&(Me=="offset"||Me=="parent")||K&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||Bo(Me,be)))&&fe.push(Me);return fe}o(H2,"arrayLikeKeys");function z2(s){var f=s.length;return f?s[Rp(0,f-1)]:t}o(z2,"arraySample");function AA(s,f){return ch(pn(s),ba(f,0,s.length))}o(AA,"arraySampleSize");function SA(s){return ch(pn(s))}o(SA,"arrayShuffle");function Ep(s,f,d){(d!==t&&!Ii(s[f],d)||d===t&&!(f in s))&&No(s,f,d)}o(Ep,"assignMergeValue");function Jc(s,f,d){var M=s[f];(!(Vt.call(s,f)&&Ii(M,d))||d===t&&!(f in s))&&No(s,f,d)}o(Jc,"assignValue");function Yl(s,f){for(var d=s.length;d--;)if(Ii(s[d][0],f))return d;return-1}o(Yl,"assocIndexOf");function MA(s,f,d,M){return ys(s,function(U,K,te){f(M,U,d(U),te)}),M}o(MA,"baseAggregator");function K2(s,f){return s&&to(f,Ar(f),s)}o(K2,"baseAssign");function TA(s,f){return s&&to(f,bn(f),s)}o(TA,"baseAssignIn");function No(s,f,d){f=="__proto__"&&Kl?Kl(s,f,{configurable:!0,enumerable:!0,value:d,writable:!0}):s[f]=d}o(No,"baseAssignValue");function Ap(s,f){for(var d=-1,M=f.length,U=xe(M),K=s==null;++d<M;)U[d]=K?t:im(s,f[d]);return U}o(Ap,"baseAt");function ba(s,f,d){return s===s&&(d!==t&&(s=s<=d?s:d),f!==t&&(s=s>=f?s:f)),s}o(ba,"baseClamp");function si(s,f,d,M,U,K){var te,fe=f&v,be=f&x,Me=f&S;if(d&&(te=U?d(s,M,U,K):d(s)),te!==t)return te;if(!ar(s))return s;var Te=vt(s);if(Te){if(te=mS(s),!fe)return pn(s,te)}else{var Ie=jr(s),Le=Ie==ee||Ie==ne;if(Es(s))return pv(s,fe);if(Ie==re||Ie==k||Le&&!U){if(te=be||Le?{}:Rv(s),!fe)return be?iS(s,TA(te,s)):nS(s,K2(te,s))}else{if(!tr[Ie])return U?s:{};te=bS(s,Ie,fe)}}K||(K=new ki);var ze=K.get(s);if(ze)return ze;K.set(s,te),fy(s)?s.forEach(function(Qe){te.add(si(Qe,f,d,Qe,s,K))}):sy(s)&&s.forEach(function(Qe,Ct){te.set(Ct,si(Qe,f,d,Ct,s,K))});var Ze=Me?be?Kp:zp:be?bn:Ar,_t=Te?t:Ze(s);return ni(_t||s,function(Qe,Ct){_t&&(Ct=Qe,Qe=s[Ct]),Jc(te,Ct,si(Qe,f,d,Ct,s,K))}),te}o(si,"baseClone");function CA(s){var f=Ar(s);return function(d){return j2(d,s,f)}}o(CA,"baseConforms");function j2(s,f,d){var M=d.length;if(s==null)return!M;for(s=Zt(s);M--;){var U=d[M],K=f[U],te=s[U];if(te===t&&!(U in s)||!K(te))return!1}return!0}o(j2,"baseConformsTo");function G2(s,f,d){if(typeof s!="function")throw new ii(i);return ru(function(){s.apply(t,d)},f)}o(G2,"baseDelay");function Yc(s,f,d,M){var U=-1,K=Rl,te=!0,fe=s.length,be=[],Me=f.length;if(!fe)return be;d&&(f=sr(f,In(d))),M?(K=up,te=!1):f.length>=r&&(K=zc,te=!1,f=new ma(f));e:for(;++U<fe;){var Te=s[U],Ie=d==null?Te:d(Te);if(Te=M||Te!==0?Te:0,te&&Ie===Ie){for(var Le=Me;Le--;)if(f[Le]===Ie)continue e;be.push(Te)}else K(f,Ie,M)||be.push(Te)}return be}o(Yc,"baseDifference");var ys=yv(eo),V2=yv(Mp,!0);function kA(s,f){var d=!0;return ys(s,function(M,U,K){return d=!!f(M,U,K),d}),d}o(kA,"baseEvery");function Xl(s,f,d){for(var M=-1,U=s.length;++M<U;){var K=s[M],te=f(K);if(te!=null&&(fe===t?te===te&&!On(te):d(te,fe)))var fe=te,be=K}return be}o(Xl,"baseExtremum");function IA(s,f,d,M){var U=s.length;for(d=wt(d),d<0&&(d=-d>U?0:U+d),M=M===t||M>U?U:wt(M),M<0&&(M+=U),M=d>M?0:uy(M);d<M;)s[d++]=f;return s}o(IA,"baseFill");function W2(s,f){var d=[];return ys(s,function(M,U,K){f(M,U,K)&&d.push(M)}),d}o(W2,"baseFilter");function Pr(s,f,d,M,U){var K=-1,te=s.length;for(d||(d=vS),U||(U=[]);++K<te;){var fe=s[K];f>0&&d(fe)?f>1?Pr(fe,f-1,d,M,U):ms(U,fe):M||(U[U.length]=fe)}return U}o(Pr,"baseFlatten");var Sp=xv(),J2=xv(!0);function eo(s,f){return s&&Sp(s,f,Ar)}o(eo,"baseForOwn");function Mp(s,f){return s&&J2(s,f,Ar)}o(Mp,"baseForOwnRight");function Zl(s,f){return ps(f,function(d){return Uo(s[d])})}o(Zl,"baseFunctions");function ga(s,f){f=ws(f,s);for(var d=0,M=f.length;s!=null&&d<M;)s=s[ro(f[d++])];return d&&d==M?s:t}o(ga,"baseGet");function Y2(s,f,d){var M=f(s);return vt(s)?M:ms(M,d(s))}o(Y2,"baseGetAllKeys");function nn(s){return s==null?s===t?He:ge:da&&da in Zt(s)?hS(s):SS(s)}o(nn,"baseGetTag");function Tp(s,f){return s>f}o(Tp,"baseGt");function DA(s,f){return s!=null&&Vt.call(s,f)}o(DA,"baseHas");function OA(s,f){return s!=null&&f in Zt(s)}o(OA,"baseHasIn");function RA(s,f,d){return s>=Kr(f,d)&&s<wr(f,d)}o(RA,"baseInRange");function Cp(s,f,d){for(var M=d?up:Rl,U=s[0].length,K=s.length,te=K,fe=xe(K),be=1/0,Me=[];te--;){var Te=s[te];te&&f&&(Te=sr(Te,In(f))),be=Kr(Te.length,be),fe[te]=!d&&(f||U>=120&&Te.length>=120)?new ma(te&&Te):t}Te=s[0];var Ie=-1,Le=fe[0];e:for(;++Ie<U&&Me.length<be;){var ze=Te[Ie],Ze=f?f(ze):ze;if(ze=d||ze!==0?ze:0,!(Le?zc(Le,Ze):M(Me,Ze,d))){for(te=K;--te;){var _t=fe[te];if(!(_t?zc(_t,Ze):M(s[te],Ze,d)))continue e}Le&&Le.push(Ze),Me.push(ze)}}return Me}o(Cp,"baseIntersection");function NA(s,f,d,M){return eo(s,function(U,K,te){f(M,d(U),K,te)}),M}o(NA,"baseInverter");function Xc(s,f,d){f=ws(f,s),s=Bv(s,f);var M=s==null?s:s[ro(fi(f))];return M==null?t:kn(M,s,d)}o(Xc,"baseInvoke");function X2(s){return fr(s)&&nn(s)==k}o(X2,"baseIsArguments");function PA(s){return fr(s)&&nn(s)==pr}o(PA,"baseIsArrayBuffer");function LA(s){return fr(s)&&nn(s)==se}o(LA,"baseIsDate");function Zc(s,f,d,M,U){return s===f?!0:s==null||f==null||!fr(s)&&!fr(f)?s!==s&&f!==f:BA(s,f,d,M,Zc,U)}o(Zc,"baseIsEqual");function BA(s,f,d,M,U,K){var te=vt(s),fe=vt(f),be=te?he:jr(s),Me=fe?he:jr(f);be=be==k?re:be,Me=Me==k?re:Me;var Te=be==re,Ie=Me==re,Le=be==Me;if(Le&&Es(s)){if(!Es(f))return!1;te=!0,Te=!1}if(Le&&!Te)return K||(K=new ki),te||Rf(s)?Iv(s,f,d,M,U,K):uS(s,f,be,d,M,U,K);if(!(d&O)){var ze=Te&&Vt.call(s,"__wrapped__"),Ze=Ie&&Vt.call(f,"__wrapped__");if(ze||Ze){var _t=ze?s.value():s,Qe=Ze?f.value():f;return K||(K=new ki),U(_t,Qe,d,M,K)}}return Le?(K||(K=new ki),lS(s,f,d,M,U,K)):!1}o(BA,"baseIsEqualDeep");function UA(s){return fr(s)&&jr(s)==ae}o(UA,"baseIsMap");function kp(s,f,d,M){var U=d.length,K=U,te=!M;if(s==null)return!K;for(s=Zt(s);U--;){var fe=d[U];if(te&&fe[2]?fe[1]!==s[fe[0]]:!(fe[0]in s))return!1}for(;++U<K;){fe=d[U];var be=fe[0],Me=s[be],Te=fe[1];if(te&&fe[2]){if(Me===t&&!(be in s))return!1}else{var Ie=new ki;if(M)var Le=M(Me,Te,be,s,f,Ie);if(!(Le===t?Zc(Te,Me,O|R,M,Ie):Le))return!1}}return!0}o(kp,"baseIsMatch");function Z2(s){if(!ar(s)||xS(s))return!1;var f=Uo(s)?U7:qt;return f.test(ya(s))}o(Z2,"baseIsNative");function $A(s){return fr(s)&&nn(s)==ve}o($A,"baseIsRegExp");function FA(s){return fr(s)&&jr(s)==V}o(FA,"baseIsSet");function qA(s){return fr(s)&&mh(s.length)&&!!ir[nn(s)]}o(qA,"baseIsTypedArray");function Q2(s){return typeof s=="function"?s:s==null?gn:typeof s=="object"?vt(s)?rv(s[0],s[1]):tv(s):wy(s)}o(Q2,"baseIteratee");function Ip(s){if(!tu(s))return K7(s);var f=[];for(var d in Zt(s))Vt.call(s,d)&&d!="constructor"&&f.push(d);return f}o(Ip,"baseKeys");function HA(s){if(!ar(s))return AS(s);var f=tu(s),d=[];for(var M in s)M=="constructor"&&(f||!Vt.call(s,M))||d.push(M);return d}o(HA,"baseKeysIn");function Dp(s,f){return s<f}o(Dp,"baseLt");function ev(s,f){var d=-1,M=mn(s)?xe(s.length):[];return ys(s,function(U,K,te){M[++d]=f(U,K,te)}),M}o(ev,"baseMap");function tv(s){var f=Gp(s);return f.length==1&&f[0][2]?Pv(f[0][0],f[0][1]):function(d){return d===s||kp(d,s,f)}}o(tv,"baseMatches");function rv(s,f){return Wp(s)&&Nv(f)?Pv(ro(s),f):function(d){var M=im(d,s);return M===t&&M===f?om(d,s):Zc(f,M,O|R)}}o(rv,"baseMatchesProperty");function Ql(s,f,d,M,U){s!==f&&Sp(f,function(K,te){if(U||(U=new ki),ar(K))zA(s,f,te,d,Ql,M,U);else{var fe=M?M(Yp(s,te),K,te+"",s,f,U):t;fe===t&&(fe=K),Ep(s,te,fe)}},bn)}o(Ql,"baseMerge");function zA(s,f,d,M,U,K,te){var fe=Yp(s,d),be=Yp(f,d),Me=te.get(be);if(Me){Ep(s,d,Me);return}var Te=K?K(fe,be,d+"",s,f,te):t,Ie=Te===t;if(Ie){var Le=vt(be),ze=!Le&&Es(be),Ze=!Le&&!ze&&Rf(be);Te=be,Le||ze||Ze?vt(fe)?Te=fe:mr(fe)?Te=pn(fe):ze?(Ie=!1,Te=pv(be,!0)):Ze?(Ie=!1,Te=mv(be,!0)):Te=[]:nu(be)||xa(be)?(Te=fe,xa(fe)?Te=ly(fe):(!ar(fe)||Uo(fe))&&(Te=Rv(be))):Ie=!1}Ie&&(te.set(be,Te),U(Te,be,M,K,te),te.delete(be)),Ep(s,d,Te)}o(zA,"baseMergeDeep");function nv(s,f){var d=s.length;if(!!d)return f+=f<0?d:0,Bo(f,d)?s[f]:t}o(nv,"baseNth");function iv(s,f,d){f.length?f=sr(f,function(K){return vt(K)?function(te){return ga(te,K.length===1?K[0]:K)}:K}):f=[gn];var M=-1;f=sr(f,In(Ye()));var U=ev(s,function(K,te,fe){var be=sr(f,function(Me){return Me(K)});return{criteria:be,index:++M,value:K}});return b7(U,function(K,te){return rS(K,te,d)})}o(iv,"baseOrderBy");function KA(s,f){return ov(s,f,function(d,M){return om(s,M)})}o(KA,"basePick");function ov(s,f,d){for(var M=-1,U=f.length,K={};++M<U;){var te=f[M],fe=ga(s,te);d(fe,te)&&Qc(K,ws(te,s),fe)}return K}o(ov,"basePickBy");function jA(s){return function(f){return ga(f,s)}}o(jA,"basePropertyDeep");function Op(s,f,d,M){var U=M?m7:Ef,K=-1,te=f.length,fe=s;for(s===f&&(f=pn(f)),d&&(fe=sr(s,In(d)));++K<te;)for(var be=0,Me=f[K],Te=d?d(Me):Me;(be=U(fe,Te,be,M))>-1;)fe!==s&&zl.call(fe,be,1),zl.call(s,be,1);return s}o(Op,"basePullAll");function sv(s,f){for(var d=s?f.length:0,M=d-1;d--;){var U=f[d];if(d==M||U!==K){var K=U;Bo(U)?zl.call(s,U,1):Lp(s,U)}}return s}o(sv,"basePullAt");function Rp(s,f){return s+Gl(F2()*(f-s+1))}o(Rp,"baseRandom");function GA(s,f,d,M){for(var U=-1,K=wr(jl((f-s)/(d||1)),0),te=xe(K);K--;)te[M?K:++U]=s,s+=d;return te}o(GA,"baseRange");function Np(s,f){var d="";if(!s||f<1||f>_)return d;do f%2&&(d+=s),f=Gl(f/2),f&&(s+=s);while(f);return d}o(Np,"baseRepeat");function St(s,f){return Xp(Lv(s,f,gn),s+"")}o(St,"baseRest");function VA(s){return z2(Nf(s))}o(VA,"baseSample");function WA(s,f){var d=Nf(s);return ch(d,ba(f,0,d.length))}o(WA,"baseSampleSize");function Qc(s,f,d,M){if(!ar(s))return s;f=ws(f,s);for(var U=-1,K=f.length,te=K-1,fe=s;fe!=null&&++U<K;){var be=ro(f[U]),Me=d;if(be==="__proto__"||be==="constructor"||be==="prototype")return s;if(U!=te){var Te=fe[be];Me=M?M(Te,be,fe):t,Me===t&&(Me=ar(Te)?Te:Bo(f[U+1])?[]:{})}Jc(fe,be,Me),fe=fe[be]}return s}o(Qc,"baseSet");var av=Vl?function(s,f){return Vl.set(s,f),s}:gn,JA=Kl?function(s,f){return Kl(s,"toString",{configurable:!0,enumerable:!1,value:am(f),writable:!0})}:gn;function YA(s){return ch(Nf(s))}o(YA,"baseShuffle");function ai(s,f,d){var M=-1,U=s.length;f<0&&(f=-f>U?0:U+f),d=d>U?U:d,d<0&&(d+=U),U=f>d?0:d-f>>>0,f>>>=0;for(var K=xe(U);++M<U;)K[M]=s[M+f];return K}o(ai,"baseSlice");function XA(s,f){var d;return ys(s,function(M,U,K){return d=f(M,U,K),!d}),!!d}o(XA,"baseSome");function eh(s,f,d){var M=0,U=s==null?M:s.length;if(typeof f=="number"&&f===f&&U<=N){for(;M<U;){var K=M+U>>>1,te=s[K];te!==null&&!On(te)&&(d?te<=f:te<f)?M=K+1:U=K}return U}return Pp(s,f,gn,d)}o(eh,"baseSortedIndex");function Pp(s,f,d,M){var U=0,K=s==null?0:s.length;if(K===0)return 0;f=d(f);for(var te=f!==f,fe=f===null,be=On(f),Me=f===t;U<K;){var Te=Gl((U+K)/2),Ie=d(s[Te]),Le=Ie!==t,ze=Ie===null,Ze=Ie===Ie,_t=On(Ie);if(te)var Qe=M||Ze;else Me?Qe=Ze&&(M||Le):fe?Qe=Ze&&Le&&(M||!ze):be?Qe=Ze&&Le&&!ze&&(M||!_t):ze||_t?Qe=!1:Qe=M?Ie<=f:Ie<f;Qe?U=Te+1:K=Te}return Kr(K,C)}o(Pp,"baseSortedIndexBy");function fv(s,f){for(var d=-1,M=s.length,U=0,K=[];++d<M;){var te=s[d],fe=f?f(te):te;if(!d||!Ii(fe,be)){var be=fe;K[U++]=te===0?0:te}}return K}o(fv,"baseSortedUniq");function cv(s){return typeof s=="number"?s:On(s)?E:+s}o(cv,"baseToNumber");function Dn(s){if(typeof s=="string")return s;if(vt(s))return sr(s,Dn)+"";if(On(s))return q2?q2.call(s):"";var f=s+"";return f=="0"&&1/s==-p?"-0":f}o(Dn,"baseToString");function xs(s,f,d){var M=-1,U=Rl,K=s.length,te=!0,fe=[],be=fe;if(d)te=!1,U=up;else if(K>=r){var Me=f?null:fS(s);if(Me)return Pl(Me);te=!1,U=zc,be=new ma}else be=f?[]:fe;e:for(;++M<K;){var Te=s[M],Ie=f?f(Te):Te;if(Te=d||Te!==0?Te:0,te&&Ie===Ie){for(var Le=be.length;Le--;)if(be[Le]===Ie)continue e;f&&be.push(Ie),fe.push(Te)}else U(be,Ie,d)||(be!==fe&&be.push(Ie),fe.push(Te))}return fe}o(xs,"baseUniq");function Lp(s,f){return f=ws(f,s),s=Bv(s,f),s==null||delete s[ro(fi(f))]}o(Lp,"baseUnset");function uv(s,f,d,M){return Qc(s,f,d(ga(s,f)),M)}o(uv,"baseUpdate");function th(s,f,d,M){for(var U=s.length,K=M?U:-1;(M?K--:++K<U)&&f(s[K],K,s););return d?ai(s,M?0:K,M?K+1:U):ai(s,M?K+1:0,M?U:K)}o(th,"baseWhile");function lv(s,f){var d=s;return d instanceof Dt&&(d=d.value()),lp(f,function(M,U){return U.func.apply(U.thisArg,ms([M],U.args))},d)}o(lv,"baseWrapperValue");function Bp(s,f,d){var M=s.length;if(M<2)return M?xs(s[0]):[];for(var U=-1,K=xe(M);++U<M;)for(var te=s[U],fe=-1;++fe<M;)fe!=U&&(K[U]=Yc(K[U]||te,s[fe],f,d));return xs(Pr(K,1),f,d)}o(Bp,"baseXor");function hv(s,f,d){for(var M=-1,U=s.length,K=f.length,te={};++M<U;){var fe=M<K?f[M]:t;d(te,s[M],fe)}return te}o(hv,"baseZipObject");function Up(s){return mr(s)?s:[]}o(Up,"castArrayLikeObject");function $p(s){return typeof s=="function"?s:gn}o($p,"castFunction");function ws(s,f){return vt(s)?s:Wp(s,f)?[s]:qv(Kt(s))}o(ws,"castPath");var ZA=St;function _s(s,f,d){var M=s.length;return d=d===t?M:d,!f&&d>=M?s:ai(s,f,d)}o(_s,"castSlice");var dv=$7||function(s){return Er.clearTimeout(s)};function pv(s,f){if(f)return s.slice();var d=s.length,M=P2?P2(d):new s.constructor(d);return s.copy(M),M}o(pv,"cloneBuffer");function Fp(s){var f=new s.constructor(s.byteLength);return new ql(f).set(new ql(s)),f}o(Fp,"cloneArrayBuffer");function QA(s,f){var d=f?Fp(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.byteLength)}o(QA,"cloneDataView");function eS(s){var f=new s.constructor(s.source,tt.exec(s));return f.lastIndex=s.lastIndex,f}o(eS,"cloneRegExp");function tS(s){return Wc?Zt(Wc.call(s)):{}}o(tS,"cloneSymbol");function mv(s,f){var d=f?Fp(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.length)}o(mv,"cloneTypedArray");function bv(s,f){if(s!==f){var d=s!==t,M=s===null,U=s===s,K=On(s),te=f!==t,fe=f===null,be=f===f,Me=On(f);if(!fe&&!Me&&!K&&s>f||K&&te&&be&&!fe&&!Me||M&&te&&be||!d&&be||!U)return 1;if(!M&&!K&&!Me&&s<f||Me&&d&&U&&!M&&!K||fe&&d&&U||!te&&U||!be)return-1}return 0}o(bv,"compareAscending");function rS(s,f,d){for(var M=-1,U=s.criteria,K=f.criteria,te=U.length,fe=d.length;++M<te;){var be=bv(U[M],K[M]);if(be){if(M>=fe)return be;var Me=d[M];return be*(Me=="desc"?-1:1)}}return s.index-f.index}o(rS,"compareMultiple");function gv(s,f,d,M){for(var U=-1,K=s.length,te=d.length,fe=-1,be=f.length,Me=wr(K-te,0),Te=xe(be+Me),Ie=!M;++fe<be;)Te[fe]=f[fe];for(;++U<te;)(Ie||U<K)&&(Te[d[U]]=s[U]);for(;Me--;)Te[fe++]=s[U++];return Te}o(gv,"composeArgs");function vv(s,f,d,M){for(var U=-1,K=s.length,te=-1,fe=d.length,be=-1,Me=f.length,Te=wr(K-fe,0),Ie=xe(Te+Me),Le=!M;++U<Te;)Ie[U]=s[U];for(var ze=U;++be<Me;)Ie[ze+be]=f[be];for(;++te<fe;)(Le||U<K)&&(Ie[ze+d[te]]=s[U++]);return Ie}o(vv,"composeArgsRight");function pn(s,f){var d=-1,M=s.length;for(f||(f=xe(M));++d<M;)f[d]=s[d];return f}o(pn,"copyArray");function to(s,f,d,M){var U=!d;d||(d={});for(var K=-1,te=f.length;++K<te;){var fe=f[K],be=M?M(d[fe],s[fe],fe,d,s):t;be===t&&(be=s[fe]),U?No(d,fe,be):Jc(d,fe,be)}return d}o(to,"copyObject");function nS(s,f){return to(s,Vp(s),f)}o(nS,"copySymbols");function iS(s,f){return to(s,Dv(s),f)}o(iS,"copySymbolsIn");function rh(s,f){return function(d,M){var U=vt(d)?c7:MA,K=f?f():{};return U(d,s,Ye(M,2),K)}}o(rh,"createAggregator");function If(s){return St(function(f,d){var M=-1,U=d.length,K=U>1?d[U-1]:t,te=U>2?d[2]:t;for(K=s.length>3&&typeof K=="function"?(U--,K):t,te&&on(d[0],d[1],te)&&(K=U<3?t:K,U=1),f=Zt(f);++M<U;){var fe=d[M];fe&&s(f,fe,M,K)}return f})}o(If,"createAssigner");function yv(s,f){return function(d,M){if(d==null)return d;if(!mn(d))return s(d,M);for(var U=d.length,K=f?U:-1,te=Zt(d);(f?K--:++K<U)&&M(te[K],K,te)!==!1;);return d}}o(yv,"createBaseEach");function xv(s){return function(f,d,M){for(var U=-1,K=Zt(f),te=M(f),fe=te.length;fe--;){var be=te[s?fe:++U];if(d(K[be],be,K)===!1)break}return f}}o(xv,"createBaseFor");function oS(s,f,d){var M=f&D,U=eu(s);function K(){var te=this&&this!==Er&&this instanceof K?U:s;return te.apply(M?d:this,arguments)}return o(K,"wrapper"),K}o(oS,"createBind");function wv(s){return function(f){f=Kt(f);var d=Af(f)?Ci(f):t,M=d?d[0]:f.charAt(0),U=d?_s(d,1).join(""):f.slice(1);return M[s]()+U}}o(wv,"createCaseFirst");function Df(s){return function(f){return lp(yy(vy(f).replace(J9,"")),s,"")}}o(Df,"createCompounder");function eu(s){return function(){var f=arguments;switch(f.length){case 0:return new s;case 1:return new s(f[0]);case 2:return new s(f[0],f[1]);case 3:return new s(f[0],f[1],f[2]);case 4:return new s(f[0],f[1],f[2],f[3]);case 5:return new s(f[0],f[1],f[2],f[3],f[4]);case 6:return new s(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new s(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var d=kf(s.prototype),M=s.apply(d,f);return ar(M)?M:d}}o(eu,"createCtor");function sS(s,f,d){var M=eu(s);function U(){for(var K=arguments.length,te=xe(K),fe=K,be=Of(U);fe--;)te[fe]=arguments[fe];var Me=K<3&&te[0]!==be&&te[K-1]!==be?[]:bs(te,be);if(K-=Me.length,K<d)return Mv(s,f,nh,U.placeholder,t,te,Me,t,t,d-K);var Te=this&&this!==Er&&this instanceof U?M:s;return kn(Te,this,te)}return o(U,"wrapper"),U}o(sS,"createCurry");function _v(s){return function(f,d,M){var U=Zt(f);if(!mn(f)){var K=Ye(d,3);f=Ar(f),d=o(function(fe){return K(U[fe],fe,U)},"predicate")}var te=s(f,d,M);return te>-1?U[K?f[te]:te]:t}}o(_v,"createFind");function Ev(s){return Lo(function(f){var d=f.length,M=d,U=oi.prototype.thru;for(s&&f.reverse();M--;){var K=f[M];if(typeof K!="function")throw new ii(i);if(U&&!te&&ah(K)=="wrapper")var te=new oi([],!0)}for(M=te?M:d;++M<d;){K=f[M];var fe=ah(K),be=fe=="wrapper"?jp(K):t;be&&Jp(be[0])&&be[1]==(oe|B|Q|j)&&!be[4].length&&be[9]==1?te=te[ah(be[0])].apply(te,be[3]):te=K.length==1&&Jp(K)?te[fe]():te.thru(K)}return function(){var Me=arguments,Te=Me[0];if(te&&Me.length==1&&vt(Te))return te.plant(Te).value();for(var Ie=0,Le=d?f[Ie].apply(this,Me):Te;++Ie<d;)Le=f[Ie].call(this,Le);return Le}})}o(Ev,"createFlow");function nh(s,f,d,M,U,K,te,fe,be,Me){var Te=f&oe,Ie=f&D,Le=f&P,ze=f&(B|W),Ze=f&H,_t=Le?t:eu(s);function Qe(){for(var Ct=arguments.length,Nt=xe(Ct),Rn=Ct;Rn--;)Nt[Rn]=arguments[Rn];if(ze)var sn=Of(Qe),Nn=v7(Nt,sn);if(M&&(Nt=gv(Nt,M,U,ze)),K&&(Nt=vv(Nt,K,te,ze)),Ct-=Nn,ze&&Ct<Me){var br=bs(Nt,sn);return Mv(s,f,nh,Qe.placeholder,d,Nt,br,fe,be,Me-Ct)}var Di=Ie?d:this,Fo=Le?Di[s]:s;return Ct=Nt.length,fe?Nt=MS(Nt,fe):Ze&&Ct>1&&Nt.reverse(),Te&&be<Ct&&(Nt.length=be),this&&this!==Er&&this instanceof Qe&&(Fo=_t||eu(Fo)),Fo.apply(Di,Nt)}return o(Qe,"wrapper"),Qe}o(nh,"createHybrid");function Av(s,f){return function(d,M){return NA(d,s,f(M),{})}}o(Av,"createInverter");function ih(s,f){return function(d,M){var U;if(d===t&&M===t)return f;if(d!==t&&(U=d),M!==t){if(U===t)return M;typeof d=="string"||typeof M=="string"?(d=Dn(d),M=Dn(M)):(d=cv(d),M=cv(M)),U=s(d,M)}return U}}o(ih,"createMathOperation");function qp(s){return Lo(function(f){return f=sr(f,In(Ye())),St(function(d){var M=this;return s(f,function(U){return kn(U,M,d)})})})}o(qp,"createOver");function oh(s,f){f=f===t?" ":Dn(f);var d=f.length;if(d<2)return d?Np(f,s):f;var M=Np(f,jl(s/Sf(f)));return Af(f)?_s(Ci(M),0,s).join(""):M.slice(0,s)}o(oh,"createPadding");function aS(s,f,d,M){var U=f&D,K=eu(s);function te(){for(var fe=-1,be=arguments.length,Me=-1,Te=M.length,Ie=xe(Te+be),Le=this&&this!==Er&&this instanceof te?K:s;++Me<Te;)Ie[Me]=M[Me];for(;be--;)Ie[Me++]=arguments[++fe];return kn(Le,U?d:this,Ie)}return o(te,"wrapper"),te}o(aS,"createPartial");function Sv(s){return function(f,d,M){return M&&typeof M!="number"&&on(f,d,M)&&(d=M=t),f=$o(f),d===t?(d=f,f=0):d=$o(d),M=M===t?f<d?1:-1:$o(M),GA(f,d,M,s)}}o(Sv,"createRange");function sh(s){return function(f,d){return typeof f=="string"&&typeof d=="string"||(f=ci(f),d=ci(d)),s(f,d)}}o(sh,"createRelationalOperation");function Mv(s,f,d,M,U,K,te,fe,be,Me){var Te=f&B,Ie=Te?te:t,Le=Te?t:te,ze=Te?K:t,Ze=Te?t:K;f|=Te?Q:Y,f&=~(Te?Y:Q),f&J||(f&=~(D|P));var _t=[s,f,U,ze,Ie,Ze,Le,fe,be,Me],Qe=d.apply(t,_t);return Jp(s)&&Uv(Qe,_t),Qe.placeholder=M,$v(Qe,s,f)}o(Mv,"createRecurry");function Hp(s){var f=xr[s];return function(d,M){if(d=ci(d),M=M==null?0:Kr(wt(M),292),M&&$2(d)){var U=(Kt(d)+"e").split("e"),K=f(U[0]+"e"+(+U[1]+M));return U=(Kt(K)+"e").split("e"),+(U[0]+"e"+(+U[1]-M))}return f(d)}}o(Hp,"createRound");var fS=Tf&&1/Pl(new Tf([,-0]))[1]==p?function(s){return new Tf(s)}:um;function Tv(s){return function(f){var d=jr(f);return d==ae?vp(f):d==V?S7(f):g7(f,s(f))}}o(Tv,"createToPairs");function Po(s,f,d,M,U,K,te,fe){var be=f&P;if(!be&&typeof s!="function")throw new ii(i);var Me=M?M.length:0;if(Me||(f&=~(Q|Y),M=U=t),te=te===t?te:wr(wt(te),0),fe=fe===t?fe:wt(fe),Me-=U?U.length:0,f&Y){var Te=M,Ie=U;M=U=t}var Le=be?t:jp(s),ze=[s,f,d,M,U,Te,Ie,K,te,fe];if(Le&&ES(ze,Le),s=ze[0],f=ze[1],d=ze[2],M=ze[3],U=ze[4],fe=ze[9]=ze[9]===t?be?0:s.length:wr(ze[9]-Me,0),!fe&&f&(B|W)&&(f&=~(B|W)),!f||f==D)var Ze=oS(s,f,d);else f==B||f==W?Ze=sS(s,f,fe):(f==Q||f==(D|Q))&&!U.length?Ze=aS(s,f,d,M):Ze=nh.apply(t,ze);var _t=Le?av:Uv;return $v(_t(Ze,ze),s,f)}o(Po,"createWrap");function Cv(s,f,d,M){return s===t||Ii(s,Mf[d])&&!Vt.call(M,d)?f:s}o(Cv,"customDefaultsAssignIn");function kv(s,f,d,M,U,K){return ar(s)&&ar(f)&&(K.set(f,s),Ql(s,f,t,kv,K),K.delete(f)),s}o(kv,"customDefaultsMerge");function cS(s){return nu(s)?t:s}o(cS,"customOmitClone");function Iv(s,f,d,M,U,K){var te=d&O,fe=s.length,be=f.length;if(fe!=be&&!(te&&be>fe))return!1;var Me=K.get(s),Te=K.get(f);if(Me&&Te)return Me==f&&Te==s;var Ie=-1,Le=!0,ze=d&R?new ma:t;for(K.set(s,f),K.set(f,s);++Ie<fe;){var Ze=s[Ie],_t=f[Ie];if(M)var Qe=te?M(_t,Ze,Ie,f,s,K):M(Ze,_t,Ie,s,f,K);if(Qe!==t){if(Qe)continue;Le=!1;break}if(ze){if(!hp(f,function(Ct,Nt){if(!zc(ze,Nt)&&(Ze===Ct||U(Ze,Ct,d,M,K)))return ze.push(Nt)})){Le=!1;break}}else if(!(Ze===_t||U(Ze,_t,d,M,K))){Le=!1;break}}return K.delete(s),K.delete(f),Le}o(Iv,"equalArrays");function uS(s,f,d,M,U,K,te){switch(d){case ue:if(s.byteLength!=f.byteLength||s.byteOffset!=f.byteOffset)return!1;s=s.buffer,f=f.buffer;case pr:return!(s.byteLength!=f.byteLength||!K(new ql(s),new ql(f)));case Z:case se:case Ae:return Ii(+s,+f);case F:return s.name==f.name&&s.message==f.message;case ve:case pe:return s==f+"";case ae:var fe=vp;case V:var be=M&O;if(fe||(fe=Pl),s.size!=f.size&&!be)return!1;var Me=te.get(s);if(Me)return Me==f;M|=R,te.set(s,f);var Te=Iv(fe(s),fe(f),M,U,K,te);return te.delete(s),Te;case Ce:if(Wc)return Wc.call(s)==Wc.call(f)}return!1}o(uS,"equalByTag");function lS(s,f,d,M,U,K){var te=d&O,fe=zp(s),be=fe.length,Me=zp(f),Te=Me.length;if(be!=Te&&!te)return!1;for(var Ie=be;Ie--;){var Le=fe[Ie];if(!(te?Le in f:Vt.call(f,Le)))return!1}var ze=K.get(s),Ze=K.get(f);if(ze&&Ze)return ze==f&&Ze==s;var _t=!0;K.set(s,f),K.set(f,s);for(var Qe=te;++Ie<be;){Le=fe[Ie];var Ct=s[Le],Nt=f[Le];if(M)var Rn=te?M(Nt,Ct,Le,f,s,K):M(Ct,Nt,Le,s,f,K);if(!(Rn===t?Ct===Nt||U(Ct,Nt,d,M,K):Rn)){_t=!1;break}Qe||(Qe=Le=="constructor")}if(_t&&!Qe){var sn=s.constructor,Nn=f.constructor;sn!=Nn&&"constructor"in s&&"constructor"in f&&!(typeof sn=="function"&&sn instanceof sn&&typeof Nn=="function"&&Nn instanceof Nn)&&(_t=!1)}return K.delete(s),K.delete(f),_t}o(lS,"equalObjects");function Lo(s){return Xp(Lv(s,t,jv),s+"")}o(Lo,"flatRest");function zp(s){return Y2(s,Ar,Vp)}o(zp,"getAllKeys");function Kp(s){return Y2(s,bn,Dv)}o(Kp,"getAllKeysIn");var jp=Vl?function(s){return Vl.get(s)}:um;function ah(s){for(var f=s.name+"",d=Cf[f],M=Vt.call(Cf,f)?d.length:0;M--;){var U=d[M],K=U.func;if(K==null||K==s)return U.name}return f}o(ah,"getFuncName");function Of(s){var f=Vt.call(z,"placeholder")?z:s;return f.placeholder}o(Of,"getHolder");function Ye(){var s=z.iteratee||fm;return s=s===fm?Q2:s,arguments.length?s(arguments[0],arguments[1]):s}o(Ye,"getIteratee");function fh(s,f){var d=s.__data__;return yS(f)?d[typeof f=="string"?"string":"hash"]:d.map}o(fh,"getMapData");function Gp(s){for(var f=Ar(s),d=f.length;d--;){var M=f[d],U=s[M];f[d]=[M,U,Nv(U)]}return f}o(Gp,"getMatchData");function va(s,f){var d=_7(s,f);return Z2(d)?d:t}o(va,"getNative");function hS(s){var f=Vt.call(s,da),d=s[da];try{s[da]=t;var M=!0}catch{}var U=$l.call(s);return M&&(f?s[da]=d:delete s[da]),U}o(hS,"getRawTag");var Vp=xp?function(s){return s==null?[]:(s=Zt(s),ps(xp(s),function(f){return B2.call(s,f)}))}:lm,Dv=xp?function(s){for(var f=[];s;)ms(f,Vp(s)),s=Hl(s);return f}:lm,jr=nn;(wp&&jr(new wp(new ArrayBuffer(1)))!=ue||jc&&jr(new jc)!=ae||_p&&jr(_p.resolve())!=Se||Tf&&jr(new Tf)!=V||Gc&&jr(new Gc)!=Re)&&(jr=o(function(s){var f=nn(s),d=f==re?s.constructor:t,M=d?ya(d):"";if(M)switch(M){case W7:return ue;case J7:return ae;case Y7:return Se;case X7:return V;case Z7:return Re}return f},"getTag"));function dS(s,f,d){for(var M=-1,U=d.length;++M<U;){var K=d[M],te=K.size;switch(K.type){case"drop":s+=te;break;case"dropRight":f-=te;break;case"take":f=Kr(f,s+te);break;case"takeRight":s=wr(s,f-te);break}}return{start:s,end:f}}o(dS,"getView");function pS(s){var f=s.match(ut);return f?f[1].split(Qn):[]}o(pS,"getWrapDetails");function Ov(s,f,d){f=ws(f,s);for(var M=-1,U=f.length,K=!1;++M<U;){var te=ro(f[M]);if(!(K=s!=null&&d(s,te)))break;s=s[te]}return K||++M!=U?K:(U=s==null?0:s.length,!!U&&mh(U)&&Bo(te,U)&&(vt(s)||xa(s)))}o(Ov,"hasPath");function mS(s){var f=s.length,d=new s.constructor(f);return f&&typeof s[0]=="string"&&Vt.call(s,"index")&&(d.index=s.index,d.input=s.input),d}o(mS,"initCloneArray");function Rv(s){return typeof s.constructor=="function"&&!tu(s)?kf(Hl(s)):{}}o(Rv,"initCloneObject");function bS(s,f,d){var M=s.constructor;switch(f){case pr:return Fp(s);case Z:case se:return new M(+s);case ue:return QA(s,d);case ie:case $:case X:case me:case ye:case we:case ke:case It:case Ue:return mv(s,d);case ae:return new M;case Ae:case pe:return new M(s);case ve:return eS(s);case V:return new M;case Ce:return tS(s)}}o(bS,"initCloneByTag");function gS(s,f){var d=f.length;if(!d)return s;var M=d-1;return f[M]=(d>1?"& ":"")+f[M],f=f.join(d>2?", ":" "),s.replace(ct,`{
|
|
2
2
|
/* [wrapped with `+f+`] */
|
|
3
|
-
`)}o(dS,"insertWrapDetails");function pS(s){return vt(s)||xa(s)||!!(L2&&s&&s[L2])}o(pS,"isFlattenable");function Lo(s,f){var d=typeof s;return f=f??_,!!f&&(d=="number"||d!="symbol"&&ln.test(s))&&s>-1&&s%1==0&&s<f}o(Lo,"isIndex");function on(s,f,d){if(!ar(d))return!1;var M=typeof f;return(M=="number"?mn(d)&&Lo(f,d.length):M=="string"&&f in d)?Ii(d[f],s):!1}o(on,"isIterateeCall");function Gp(s,f){if(vt(s))return!1;var d=typeof s;return d=="number"||d=="symbol"||d=="boolean"||s==null||On(s)?!0:st.test(s)||!Xn.test(s)||f!=null&&s in Zt(f)}o(Gp,"isKey");function mS(s){var f=typeof s;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?s!=="__proto__":s===null}o(mS,"isKeyable");function Vp(s){var f=sh(s),d=z[f];if(typeof d!="function"||!(f in Dt.prototype))return!1;if(s===d)return!0;var M=zp(d);return!!M&&s===M[0]}o(Vp,"isLaziable");function bS(s){return!!O2&&O2 in s}o(bS,"isMasked");var gS=Ll?Bo:um;function eu(s){var f=s&&s.constructor,d=typeof f=="function"&&f.prototype||Sf;return s===d}o(eu,"isPrototype");function Ov(s){return s===s&&!ar(s)}o(Ov,"isStrictComparable");function Rv(s,f){return function(d){return d==null?!1:d[s]===f&&(f!==t||s in Zt(d))}}o(Rv,"matchesStrictComparable");function vS(s){var f=hh(s,function(M){return d.size===u&&d.clear(),M}),d=f.cache;return f}o(vS,"memoizeCapped");function yS(s,f){var d=s[1],M=f[1],B=d|M,K=B<(D|P|oe),te=M==oe&&d==L||M==oe&&d==j&&s[7].length<=f[8]||M==(oe|j)&&f[7].length<=f[8]&&d==L;if(!(K||te))return s;M&D&&(s[2]=f[2],B|=d&D?0:J);var fe=f[3];if(fe){var be=s[3];s[3]=be?mv(be,fe,f[4]):fe,s[4]=be?ms(s[3],m):f[4]}return fe=f[5],fe&&(be=s[5],s[5]=be?bv(be,fe,f[6]):fe,s[6]=be?ms(s[5],m):f[6]),fe=f[7],fe&&(s[7]=fe),M&oe&&(s[8]=s[8]==null?f[8]:Kr(s[8],f[8])),s[9]==null&&(s[9]=f[9]),s[0]=f[0],s[1]=B,s}o(yS,"mergeData");function xS(s){var f=[];if(s!=null)for(var d in Zt(s))f.push(d);return f}o(xS,"nativeKeysIn");function wS(s){return Ul.call(s)}o(wS,"objectToString");function Nv(s,f,d){return f=wr(f===t?s.length-1:f,0),function(){for(var M=arguments,B=-1,K=wr(M.length-f,0),te=xe(K);++B<K;)te[B]=M[f+B];B=-1;for(var fe=xe(f+1);++B<f;)fe[B]=M[B];return fe[f]=d(te),kn(s,this,fe)}}o(Nv,"overRest");function Pv(s,f){return f.length<2?s:ga(s,ai(f,0,-1))}o(Pv,"parent");function _S(s,f){for(var d=s.length,M=Kr(f.length,d),B=pn(s);M--;){var K=f[M];s[M]=Lo(K,d)?B[K]:t}return s}o(_S,"reorder");function Wp(s,f){if(!(f==="constructor"&&typeof s[f]=="function")&&f!="__proto__")return s[f]}o(Wp,"safeGet");var Lv=Uv(ov),tu=B7||function(s,f){return Er.setTimeout(s,f)},Jp=Uv(jA);function Bv(s,f,d){var M=f+"";return Jp(s,dS(M,ES(uS(M),d)))}o(Bv,"setWrapToString");function Uv(s){var f=0,d=0;return function(){var M=q7(),B=h-(M-d);if(d=M,B>0){if(++f>=T)return arguments[0]}else f=0;return s.apply(t,arguments)}}o(Uv,"shortOut");function fh(s,f){var d=-1,M=s.length,B=M-1;for(f=f===t?M:f;++d<f;){var K=Dp(d,B),te=s[K];s[K]=s[d],s[d]=te}return s.length=f,s}o(fh,"shuffleSelf");var $v=vS(function(s){var f=[];return s.charCodeAt(0)===46&&f.push(""),s.replace(at,function(d,M,B,K){f.push(B?K.replace(ei,"$1"):M||d)}),f});function ro(s){if(typeof s=="string"||On(s))return s;var f=s+"";return f=="0"&&1/s==-p?"-0":f}o(ro,"toKey");function ya(s){if(s!=null){try{return Bl.call(s)}catch{}try{return s+""}catch{}}return""}o(ya,"toSource");function ES(s,f){return ni(w,function(d){var M="_."+d[0];f&d[1]&&!Ol(s,M)&&s.push(M)}),s.sort()}o(ES,"updateWrapDetails");function Fv(s){if(s instanceof Dt)return s.clone();var f=new oi(s.__wrapped__,s.__chain__);return f.__actions__=pn(s.__actions__),f.__index__=s.__index__,f.__values__=s.__values__,f}o(Fv,"wrapperClone");function AS(s,f,d){(d?on(s,f,d):f===t)?f=1:f=wr(wt(f),0);var M=s==null?0:s.length;if(!M||f<1)return[];for(var B=0,K=0,te=xe(Kl(M/f));B<M;)te[K++]=ai(s,B,B+=f);return te}o(AS,"chunk");function SS(s){for(var f=-1,d=s==null?0:s.length,M=0,B=[];++f<d;){var K=s[f];K&&(B[M++]=K)}return B}o(SS,"compact");function MS(){var s=arguments.length;if(!s)return[];for(var f=xe(s-1),d=arguments[0],M=s;M--;)f[M-1]=arguments[M];return ps(vt(d)?pn(d):[d],Pr(f,1))}o(MS,"concat");var TS=St(function(s,f){return mr(s)?Jc(s,Pr(f,1,mr,!0)):[]}),CS=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Jc(s,Pr(f,1,mr,!0),Ye(d,2)):[]}),kS=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Jc(s,Pr(f,1,mr,!0),t,d):[]});function IS(s,f,d){var M=s==null?0:s.length;return M?(f=d||f===t?1:wt(f),ai(s,f<0?0:f,M)):[]}o(IS,"drop");function DS(s,f,d){var M=s==null?0:s.length;return M?(f=d||f===t?1:wt(f),f=M-f,ai(s,0,f<0?0:f)):[]}o(DS,"dropRight");function OS(s,f){return s&&s.length?eh(s,Ye(f,3),!0,!0):[]}o(OS,"dropRightWhile");function RS(s,f){return s&&s.length?eh(s,Ye(f,3),!0):[]}o(RS,"dropWhile");function NS(s,f,d,M){var B=s==null?0:s.length;return B?(d&&typeof d!="number"&&on(s,f,d)&&(d=0,M=B),MA(s,f,d,M)):[]}o(NS,"fill");function qv(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var B=d==null?0:wt(d);return B<0&&(B=wr(M+B,0)),Rl(s,Ye(f,3),B)}o(qv,"findIndex");function Hv(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var B=M-1;return d!==t&&(B=wt(d),B=d<0?wr(M+B,0):Kr(B,M-1)),Rl(s,Ye(f,3),B,!0)}o(Hv,"findLastIndex");function zv(s){var f=s==null?0:s.length;return f?Pr(s,1):[]}o(zv,"flatten");function PS(s){var f=s==null?0:s.length;return f?Pr(s,p):[]}o(PS,"flattenDeep");function LS(s,f){var d=s==null?0:s.length;return d?(f=f===t?1:wt(f),Pr(s,f)):[]}o(LS,"flattenDepth");function BS(s){for(var f=-1,d=s==null?0:s.length,M={};++f<d;){var B=s[f];M[B[0]]=B[1]}return M}o(BS,"fromPairs");function Kv(s){return s&&s.length?s[0]:t}o(Kv,"head");function US(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var B=d==null?0:wt(d);return B<0&&(B=wr(M+B,0)),_f(s,f,B)}o(US,"indexOf");function $S(s){var f=s==null?0:s.length;return f?ai(s,0,-1):[]}o($S,"initial");var FS=St(function(s){var f=sr(s,Lp);return f.length&&f[0]===s[0]?Mp(f):[]}),qS=St(function(s){var f=fi(s),d=sr(s,Lp);return f===fi(d)?f=t:d.pop(),d.length&&d[0]===s[0]?Mp(d,Ye(f,2)):[]}),HS=St(function(s){var f=fi(s),d=sr(s,Lp);return f=typeof f=="function"?f:t,f&&d.pop(),d.length&&d[0]===s[0]?Mp(d,t,f):[]});function zS(s,f){return s==null?"":$7.call(s,f)}o(zS,"join");function fi(s){var f=s==null?0:s.length;return f?s[f-1]:t}o(fi,"last");function KS(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var B=M;return d!==t&&(B=wt(d),B=B<0?wr(M+B,0):Kr(B,M-1)),f===f?E7(s,f,B):Rl(s,A2,B,!0)}o(KS,"lastIndexOf");function jS(s,f){return s&&s.length?tv(s,wt(f)):t}o(jS,"nth");var GS=St(jv);function jv(s,f){return s&&s.length&&f&&f.length?Ip(s,f):s}o(jv,"pullAll");function VS(s,f,d){return s&&s.length&&f&&f.length?Ip(s,f,Ye(d,2)):s}o(VS,"pullAllBy");function WS(s,f,d){return s&&s.length&&f&&f.length?Ip(s,f,t,d):s}o(WS,"pullAllWith");var JS=Po(function(s,f){var d=s==null?0:s.length,M=_p(s,f);return iv(s,sr(f,function(B){return Lo(B,d)?+B:B}).sort(pv)),M});function YS(s,f){var d=[];if(!(s&&s.length))return d;var M=-1,B=[],K=s.length;for(f=Ye(f,3);++M<K;){var te=s[M];f(te,M,s)&&(d.push(te),B.push(M))}return iv(s,B),d}o(YS,"remove");function Yp(s){return s==null?s:z7.call(s)}o(Yp,"reverse");function XS(s,f,d){var M=s==null?0:s.length;return M?(d&&typeof d!="number"&&on(s,f,d)?(f=0,d=M):(f=f==null?0:wt(f),d=d===t?M:wt(d)),ai(s,f,d)):[]}o(XS,"slice");function ZS(s,f){return Ql(s,f)}o(ZS,"sortedIndex");function QS(s,f,d){return Rp(s,f,Ye(d,2))}o(QS,"sortedIndexBy");function eM(s,f){var d=s==null?0:s.length;if(d){var M=Ql(s,f);if(M<d&&Ii(s[M],f))return M}return-1}o(eM,"sortedIndexOf");function tM(s,f){return Ql(s,f,!0)}o(tM,"sortedLastIndex");function rM(s,f,d){return Rp(s,f,Ye(d,2),!0)}o(rM,"sortedLastIndexBy");function nM(s,f){var d=s==null?0:s.length;if(d){var M=Ql(s,f,!0)-1;if(Ii(s[M],f))return M}return-1}o(nM,"sortedLastIndexOf");function iM(s){return s&&s.length?sv(s):[]}o(iM,"sortedUniq");function oM(s,f){return s&&s.length?sv(s,Ye(f,2)):[]}o(oM,"sortedUniqBy");function sM(s){var f=s==null?0:s.length;return f?ai(s,1,f):[]}o(sM,"tail");function aM(s,f,d){return s&&s.length?(f=d||f===t?1:wt(f),ai(s,0,f<0?0:f)):[]}o(aM,"take");function fM(s,f,d){var M=s==null?0:s.length;return M?(f=d||f===t?1:wt(f),f=M-f,ai(s,f<0?0:f,M)):[]}o(fM,"takeRight");function cM(s,f){return s&&s.length?eh(s,Ye(f,3),!1,!0):[]}o(cM,"takeRightWhile");function uM(s,f){return s&&s.length?eh(s,Ye(f,3)):[]}o(uM,"takeWhile");var lM=St(function(s){return ys(Pr(s,1,mr,!0))}),hM=St(function(s){var f=fi(s);return mr(f)&&(f=t),ys(Pr(s,1,mr,!0),Ye(f,2))}),dM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,ys(Pr(s,1,mr,!0),t,f)});function pM(s){return s&&s.length?ys(s):[]}o(pM,"uniq");function mM(s,f){return s&&s.length?ys(s,Ye(f,2)):[]}o(mM,"uniqBy");function bM(s,f){return f=typeof f=="function"?f:t,s&&s.length?ys(s,t,f):[]}o(bM,"uniqWith");function Xp(s){if(!(s&&s.length))return[];var f=0;return s=ds(s,function(d){if(mr(d))return f=wr(d.length,f),!0}),pp(f,function(d){return sr(s,lp(d))})}o(Xp,"unzip");function Gv(s,f){if(!(s&&s.length))return[];var d=Xp(s);return f==null?d:sr(d,function(M){return kn(f,t,M)})}o(Gv,"unzipWith");var gM=St(function(s,f){return mr(s)?Jc(s,f):[]}),vM=St(function(s){return Pp(ds(s,mr))}),yM=St(function(s){var f=fi(s);return mr(f)&&(f=t),Pp(ds(s,mr),Ye(f,2))}),xM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,Pp(ds(s,mr),t,f)}),wM=St(Xp);function _M(s,f){return uv(s||[],f||[],Wc)}o(_M,"zipObject");function EM(s,f){return uv(s||[],f||[],Zc)}o(EM,"zipObjectDeep");var AM=St(function(s){var f=s.length,d=f>1?s[f-1]:t;return d=typeof d=="function"?(s.pop(),d):t,Gv(s,d)});function Vv(s){var f=z(s);return f.__chain__=!0,f}o(Vv,"chain");function SM(s,f){return f(s),s}o(SM,"tap");function ch(s,f){return f(s)}o(ch,"thru");var MM=Po(function(s){var f=s.length,d=f?s[0]:0,M=this.__wrapped__,B=o(function(K){return _p(K,s)},"interceptor");return f>1||this.__actions__.length||!(M instanceof Dt)||!Lo(d)?this.thru(B):(M=M.slice(d,+d+(f?1:0)),M.__actions__.push({func:ch,args:[B],thisArg:t}),new oi(M,this.__chain__).thru(function(K){return f&&!K.length&&K.push(t),K}))});function TM(){return Vv(this)}o(TM,"wrapperChain");function CM(){return new oi(this.value(),this.__chain__)}o(CM,"wrapperCommit");function kM(){this.__values__===t&&(this.__values__=ay(this.value()));var s=this.__index__>=this.__values__.length,f=s?t:this.__values__[this.__index__++];return{done:s,value:f}}o(kM,"wrapperNext");function IM(){return this}o(IM,"wrapperToIterator");function DM(s){for(var f,d=this;d instanceof Wl;){var M=Fv(d);M.__index__=0,M.__values__=t,f?B.__wrapped__=M:f=M;var B=M;d=d.__wrapped__}return B.__wrapped__=s,f}o(DM,"wrapperPlant");function OM(){var s=this.__wrapped__;if(s instanceof Dt){var f=s;return this.__actions__.length&&(f=new Dt(this)),f=f.reverse(),f.__actions__.push({func:ch,args:[Yp],thisArg:t}),new oi(f,this.__chain__)}return this.thru(Yp)}o(OM,"wrapperReverse");function RM(){return cv(this.__wrapped__,this.__actions__)}o(RM,"wrapperValue");var NM=th(function(s,f,d){Vt.call(s,d)?++s[d]:Ro(s,d,1)});function PM(s,f,d){var M=vt(s)?_2:SA;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(PM,"every");function LM(s,f){var d=vt(s)?ds:G2;return d(s,Ye(f,3))}o(LM,"filter");var BM=xv(qv),UM=xv(Hv);function $M(s,f){return Pr(uh(s,f),1)}o($M,"flatMap");function FM(s,f){return Pr(uh(s,f),p)}o(FM,"flatMapDeep");function qM(s,f,d){return d=d===t?1:wt(d),Pr(uh(s,f),d)}o(qM,"flatMapDepth");function Wv(s,f){var d=vt(s)?ni:vs;return d(s,Ye(f,3))}o(Wv,"forEach");function Jv(s,f){var d=vt(s)?s7:j2;return d(s,Ye(f,3))}o(Jv,"forEachRight");var HM=th(function(s,f,d){Vt.call(s,d)?s[d].push(f):Ro(s,d,[f])});function zM(s,f,d,M){s=mn(s)?s:Rf(s),d=d&&!M?wt(d):0;var B=s.length;return d<0&&(d=wr(B+d,0)),mh(s)?d<=B&&s.indexOf(f,d)>-1:!!B&&_f(s,f,d)>-1}o(zM,"includes");var KM=St(function(s,f,d){var M=-1,B=typeof f=="function",K=mn(s)?xe(s.length):[];return vs(s,function(te){K[++M]=B?kn(f,te,d):Yc(te,f,d)}),K}),jM=th(function(s,f,d){Ro(s,d,f)});function uh(s,f){var d=vt(s)?sr:Z2;return d(s,Ye(f,3))}o(uh,"map");function GM(s,f,d,M){return s==null?[]:(vt(f)||(f=f==null?[]:[f]),d=M?t:d,vt(d)||(d=d==null?[]:[d]),rv(s,f,d))}o(GM,"orderBy");var VM=th(function(s,f,d){s[d?0:1].push(f)},function(){return[[],[]]});function WM(s,f,d){var M=vt(s)?cp:M2,B=arguments.length<3;return M(s,Ye(f,4),d,B,vs)}o(WM,"reduce");function JM(s,f,d){var M=vt(s)?a7:M2,B=arguments.length<3;return M(s,Ye(f,4),d,B,j2)}o(JM,"reduceRight");function YM(s,f){var d=vt(s)?ds:G2;return d(s,dh(Ye(f,3)))}o(YM,"reject");function XM(s){var f=vt(s)?q2:zA;return f(s)}o(XM,"sample");function ZM(s,f,d){(d?on(s,f,d):f===t)?f=1:f=wt(f);var M=vt(s)?xA:KA;return M(s,f)}o(ZM,"sampleSize");function QM(s){var f=vt(s)?wA:GA;return f(s)}o(QM,"shuffle");function eT(s){if(s==null)return 0;if(mn(s))return mh(s)?Af(s):s.length;var f=jr(s);return f==ae||f==V?s.size:Cp(s).length}o(eT,"size");function tT(s,f,d){var M=vt(s)?up:VA;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(tT,"some");var rT=St(function(s,f){if(s==null)return[];var d=f.length;return d>1&&on(s,f[0],f[1])?f=[]:d>2&&on(f[0],f[1],f[2])&&(f=[f[0]]),rv(s,Pr(f,1),[])}),lh=L7||function(){return Er.Date.now()};function nT(s,f){if(typeof f!="function")throw new ii(i);return s=wt(s),function(){if(--s<1)return f.apply(this,arguments)}}o(nT,"after");function Yv(s,f,d){return f=d?t:f,f=s&&f==null?s.length:f,No(s,oe,t,t,t,t,f)}o(Yv,"ary");function Xv(s,f){var d;if(typeof f!="function")throw new ii(i);return s=wt(s),function(){return--s>0&&(d=f.apply(this,arguments)),s<=1&&(f=t),d}}o(Xv,"before");var Zp=St(function(s,f,d){var M=D;if(d.length){var B=ms(d,Df(Zp));M|=Q}return No(s,M,f,d,B)}),Zv=St(function(s,f,d){var M=D|P;if(d.length){var B=ms(d,Df(Zv));M|=Q}return No(f,M,s,d,B)});function Qv(s,f,d){f=d?t:f;var M=No(s,L,t,t,t,t,t,f);return M.placeholder=Qv.placeholder,M}o(Qv,"curry");function ey(s,f,d){f=d?t:f;var M=No(s,W,t,t,t,t,t,f);return M.placeholder=ey.placeholder,M}o(ey,"curryRight");function ty(s,f,d){var M,B,K,te,fe,be,Me=0,Te=!1,Ie=!1,Le=!0;if(typeof s!="function")throw new ii(i);f=ci(f)||0,ar(d)&&(Te=!!d.leading,Ie="maxWait"in d,K=Ie?wr(ci(d.maxWait)||0,f):K,Le="trailing"in d?!!d.trailing:Le);function ze(br){var Di=M,$o=B;return M=B=t,Me=br,te=s.apply($o,Di),te}o(ze,"invokeFunc");function Ze(br){return Me=br,fe=tu(Ct,f),Te?ze(br):te}o(Ze,"leadingEdge");function _t(br){var Di=br-be,$o=br-Me,xy=f-Di;return Ie?Kr(xy,K-$o):xy}o(_t,"remainingWait");function Qe(br){var Di=br-be,$o=br-Me;return be===t||Di>=f||Di<0||Ie&&$o>=K}o(Qe,"shouldInvoke");function Ct(){var br=lh();if(Qe(br))return Nt(br);fe=tu(Ct,_t(br))}o(Ct,"timerExpired");function Nt(br){return fe=t,Le&&M?ze(br):(M=B=t,te)}o(Nt,"trailingEdge");function Rn(){fe!==t&&lv(fe),Me=0,M=be=B=fe=t}o(Rn,"cancel");function sn(){return fe===t?te:Nt(lh())}o(sn,"flush");function Nn(){var br=lh(),Di=Qe(br);if(M=arguments,B=this,be=br,Di){if(fe===t)return Ze(be);if(Ie)return lv(fe),fe=tu(Ct,f),ze(be)}return fe===t&&(fe=tu(Ct,f)),te}return o(Nn,"debounced"),Nn.cancel=Rn,Nn.flush=sn,Nn}o(ty,"debounce");var iT=St(function(s,f){return K2(s,1,f)}),oT=St(function(s,f,d){return K2(s,ci(f)||0,d)});function sT(s){return No(s,H)}o(sT,"flip");function hh(s,f){if(typeof s!="function"||f!=null&&typeof f!="function")throw new ii(i);var d=o(function(){var M=arguments,B=f?f.apply(this,M):M[0],K=d.cache;if(K.has(B))return K.get(B);var te=s.apply(this,M);return d.cache=K.set(B,te)||K,te},"memoized");return d.cache=new(hh.Cache||Oo),d}o(hh,"memoize"),hh.Cache=Oo;function dh(s){if(typeof s!="function")throw new ii(i);return function(){var f=arguments;switch(f.length){case 0:return!s.call(this);case 1:return!s.call(this,f[0]);case 2:return!s.call(this,f[0],f[1]);case 3:return!s.call(this,f[0],f[1],f[2])}return!s.apply(this,f)}}o(dh,"negate");function aT(s){return Xv(2,s)}o(aT,"once");var fT=WA(function(s,f){f=f.length==1&&vt(f[0])?sr(f[0],In(Ye())):sr(Pr(f,1),In(Ye()));var d=f.length;return St(function(M){for(var B=-1,K=Kr(M.length,d);++B<K;)M[B]=f[B].call(this,M[B]);return kn(s,this,M)})}),Qp=St(function(s,f){var d=ms(f,Df(Qp));return No(s,Q,t,f,d)}),ry=St(function(s,f){var d=ms(f,Df(ry));return No(s,Y,t,f,d)}),cT=Po(function(s,f){return No(s,j,t,t,t,f)});function uT(s,f){if(typeof s!="function")throw new ii(i);return f=f===t?f:wt(f),St(s,f)}o(uT,"rest");function lT(s,f){if(typeof s!="function")throw new ii(i);return f=f==null?0:wr(wt(f),0),St(function(d){var M=d[f],B=ws(d,0,f);return M&&ps(B,M),kn(s,this,B)})}o(lT,"spread");function hT(s,f,d){var M=!0,B=!0;if(typeof s!="function")throw new ii(i);return ar(d)&&(M="leading"in d?!!d.leading:M,B="trailing"in d?!!d.trailing:B),ty(s,f,{leading:M,maxWait:f,trailing:B})}o(hT,"throttle");function dT(s){return Yv(s,1)}o(dT,"unary");function pT(s,f){return Qp(Bp(f),s)}o(pT,"wrap");function mT(){if(!arguments.length)return[];var s=arguments[0];return vt(s)?s:[s]}o(mT,"castArray");function bT(s){return si(s,S)}o(bT,"clone");function gT(s,f){return f=typeof f=="function"?f:t,si(s,S,f)}o(gT,"cloneWith");function vT(s){return si(s,v|S)}o(vT,"cloneDeep");function yT(s,f){return f=typeof f=="function"?f:t,si(s,v|S,f)}o(yT,"cloneDeepWith");function xT(s,f){return f==null||z2(s,f,Ar(f))}o(xT,"conformsTo");function Ii(s,f){return s===f||s!==s&&f!==f}o(Ii,"eq");var wT=oh(Sp),_T=oh(function(s,f){return s>=f}),xa=J2(function(){return arguments}())?J2:function(s){return fr(s)&&Vt.call(s,"callee")&&!P2.call(s,"callee")},vt=xe.isArray,ET=b2?In(b2):DA;function mn(s){return s!=null&&ph(s.length)&&!Bo(s)}o(mn,"isArrayLike");function mr(s){return fr(s)&&mn(s)}o(mr,"isArrayLikeObject");function AT(s){return s===!0||s===!1||fr(s)&&nn(s)==Z}o(AT,"isBoolean");var _s=U7||um,ST=g2?In(g2):OA;function MT(s){return fr(s)&&s.nodeType===1&&!ru(s)}o(MT,"isElement");function TT(s){if(s==null)return!0;if(mn(s)&&(vt(s)||typeof s=="string"||typeof s.splice=="function"||_s(s)||Of(s)||xa(s)))return!s.length;var f=jr(s);if(f==ae||f==V)return!s.size;if(eu(s))return!Cp(s).length;for(var d in s)if(Vt.call(s,d))return!1;return!0}o(TT,"isEmpty");function CT(s,f){return Xc(s,f)}o(CT,"isEqual");function kT(s,f,d){d=typeof d=="function"?d:t;var M=d?d(s,f):t;return M===t?Xc(s,f,t,d):!!M}o(kT,"isEqualWith");function em(s){if(!fr(s))return!1;var f=nn(s);return f==F||f==q||typeof s.message=="string"&&typeof s.name=="string"&&!ru(s)}o(em,"isError");function IT(s){return typeof s=="number"&&B2(s)}o(IT,"isFinite");function Bo(s){if(!ar(s))return!1;var f=nn(s);return f==ee||f==ne||f==I||f==ce}o(Bo,"isFunction");function ny(s){return typeof s=="number"&&s==wt(s)}o(ny,"isInteger");function ph(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=_}o(ph,"isLength");function ar(s){var f=typeof s;return s!=null&&(f=="object"||f=="function")}o(ar,"isObject");function fr(s){return s!=null&&typeof s=="object"}o(fr,"isObjectLike");var iy=v2?In(v2):NA;function DT(s,f){return s===f||Tp(s,f,Kp(f))}o(DT,"isMatch");function OT(s,f,d){return d=typeof d=="function"?d:t,Tp(s,f,Kp(f),d)}o(OT,"isMatchWith");function RT(s){return oy(s)&&s!=+s}o(RT,"isNaN");function NT(s){if(gS(s))throw new bt(n);return Y2(s)}o(NT,"isNative");function PT(s){return s===null}o(PT,"isNull");function LT(s){return s==null}o(LT,"isNil");function oy(s){return typeof s=="number"||fr(s)&&nn(s)==Ae}o(oy,"isNumber");function ru(s){if(!fr(s)||nn(s)!=re)return!1;var f=ql(s);if(f===null)return!0;var d=Vt.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&Bl.call(d)==O7}o(ru,"isPlainObject");var tm=y2?In(y2):PA;function BT(s){return ny(s)&&s>=-_&&s<=_}o(BT,"isSafeInteger");var sy=x2?In(x2):LA;function mh(s){return typeof s=="string"||!vt(s)&&fr(s)&&nn(s)==pe}o(mh,"isString");function On(s){return typeof s=="symbol"||fr(s)&&nn(s)==Ce}o(On,"isSymbol");var Of=w2?In(w2):BA;function UT(s){return s===t}o(UT,"isUndefined");function $T(s){return fr(s)&&jr(s)==Re}o($T,"isWeakMap");function FT(s){return fr(s)&&nn(s)==Ve}o(FT,"isWeakSet");var qT=oh(kp),HT=oh(function(s,f){return s<=f});function ay(s){if(!s)return[];if(mn(s))return mh(s)?Ci(s):pn(s);if(zc&&s[zc])return x7(s[zc]());var f=jr(s),d=f==ae?bp:f==V?Nl:Rf;return d(s)}o(ay,"toArray");function Uo(s){if(!s)return s===0?s:0;if(s=ci(s),s===p||s===-p){var f=s<0?-1:1;return f*A}return s===s?s:0}o(Uo,"toFinite");function wt(s){var f=Uo(s),d=f%1;return f===f?d?f-d:f:0}o(wt,"toInteger");function fy(s){return s?ba(wt(s),0,g):0}o(fy,"toLength");function ci(s){if(typeof s=="number")return s;if(On(s))return E;if(ar(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=ar(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=T2(s);var d=Ft.test(s);return d||un.test(s)?n7(s.slice(2),d?2:8):Cn.test(s)?E:+s}o(ci,"toNumber");function cy(s){return to(s,bn(s))}o(cy,"toPlainObject");function zT(s){return s?ba(wt(s),-_,_):s===0?s:0}o(zT,"toSafeInteger");function Kt(s){return s==null?"":Dn(s)}o(Kt,"toString");var KT=kf(function(s,f){if(eu(f)||mn(f)){to(f,Ar(f),s);return}for(var d in f)Vt.call(f,d)&&Wc(s,d,f[d])}),uy=kf(function(s,f){to(f,bn(f),s)}),bh=kf(function(s,f,d,M){to(f,bn(f),s,M)}),jT=kf(function(s,f,d,M){to(f,Ar(f),s,M)}),GT=Po(_p);function VT(s,f){var d=Cf(s);return f==null?d:H2(d,f)}o(VT,"create");var WT=St(function(s,f){s=Zt(s);var d=-1,M=f.length,B=M>2?f[2]:t;for(B&&on(f[0],f[1],B)&&(M=1);++d<M;)for(var K=f[d],te=bn(K),fe=-1,be=te.length;++fe<be;){var Me=te[fe],Te=s[Me];(Te===t||Ii(Te,Sf[Me])&&!Vt.call(s,Me))&&(s[Me]=K[Me])}return s}),JT=St(function(s){return s.push(t,Tv),kn(ly,t,s)});function YT(s,f){return E2(s,Ye(f,3),eo)}o(YT,"findKey");function XT(s,f){return E2(s,Ye(f,3),Ap)}o(XT,"findLastKey");function ZT(s,f){return s==null?s:Ep(s,Ye(f,3),bn)}o(ZT,"forIn");function QT(s,f){return s==null?s:V2(s,Ye(f,3),bn)}o(QT,"forInRight");function eC(s,f){return s&&eo(s,Ye(f,3))}o(eC,"forOwn");function tC(s,f){return s&&Ap(s,Ye(f,3))}o(tC,"forOwnRight");function rC(s){return s==null?[]:Xl(s,Ar(s))}o(rC,"functions");function nC(s){return s==null?[]:Xl(s,bn(s))}o(nC,"functionsIn");function rm(s,f,d){var M=s==null?t:ga(s,f);return M===t?d:M}o(rm,"get");function iC(s,f){return s!=null&&Iv(s,f,TA)}o(iC,"has");function nm(s,f){return s!=null&&Iv(s,f,CA)}o(nm,"hasIn");var oC=_v(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=Ul.call(f)),s[f]=d},om(gn)),sC=_v(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=Ul.call(f)),Vt.call(s,f)?s[f].push(d):s[f]=[d]},Ye),aC=St(Yc);function Ar(s){return mn(s)?F2(s):Cp(s)}o(Ar,"keys");function bn(s){return mn(s)?F2(s,!0):UA(s)}o(bn,"keysIn");function fC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,B,K){Ro(d,f(M,B,K),M)}),d}o(fC,"mapKeys");function cC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,B,K){Ro(d,B,f(M,B,K))}),d}o(cC,"mapValues");var uC=kf(function(s,f,d){Zl(s,f,d)}),ly=kf(function(s,f,d,M){Zl(s,f,d,M)}),lC=Po(function(s,f){var d={};if(s==null)return d;var M=!1;f=sr(f,function(K){return K=xs(K,s),M||(M=K.length>1),K}),to(s,Hp(s),d),M&&(d=si(d,v|x|S,oS));for(var B=f.length;B--;)Np(d,f[B]);return d});function hC(s,f){return hy(s,dh(Ye(f)))}o(hC,"omitBy");var dC=Po(function(s,f){return s==null?{}:FA(s,f)});function hy(s,f){if(s==null)return{};var d=sr(Hp(s),function(M){return[M]});return f=Ye(f),nv(s,d,function(M,B){return f(M,B[0])})}o(hy,"pickBy");function pC(s,f,d){f=xs(f,s);var M=-1,B=f.length;for(B||(B=1,s=t);++M<B;){var K=s==null?t:s[ro(f[M])];K===t&&(M=B,K=d),s=Bo(K)?K.call(s):K}return s}o(pC,"result");function mC(s,f,d){return s==null?s:Zc(s,f,d)}o(mC,"set");function bC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:Zc(s,f,d,M)}o(bC,"setWith");var dy=Sv(Ar),py=Sv(bn);function gC(s,f,d){var M=vt(s),B=M||_s(s)||Of(s);if(f=Ye(f,4),d==null){var K=s&&s.constructor;B?d=M?new K:[]:ar(s)?d=Bo(K)?Cf(ql(s)):{}:d={}}return(B?ni:eo)(s,function(te,fe,be){return f(d,te,fe,be)}),d}o(gC,"transform");function vC(s,f){return s==null?!0:Np(s,f)}o(vC,"unset");function yC(s,f,d){return s==null?s:fv(s,f,Bp(d))}o(yC,"update");function xC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:fv(s,f,Bp(d),M)}o(xC,"updateWith");function Rf(s){return s==null?[]:mp(s,Ar(s))}o(Rf,"values");function wC(s){return s==null?[]:mp(s,bn(s))}o(wC,"valuesIn");function _C(s,f,d){return d===t&&(d=f,f=t),d!==t&&(d=ci(d),d=d===d?d:0),f!==t&&(f=ci(f),f=f===f?f:0),ba(ci(s),f,d)}o(_C,"clamp");function EC(s,f,d){return f=Uo(f),d===t?(d=f,f=0):d=Uo(d),s=ci(s),kA(s,f,d)}o(EC,"inRange");function AC(s,f,d){if(d&&typeof d!="boolean"&&on(s,f,d)&&(f=d=t),d===t&&(typeof f=="boolean"?(d=f,f=t):typeof s=="boolean"&&(d=s,s=t)),s===t&&f===t?(s=0,f=1):(s=Uo(s),f===t?(f=s,s=0):f=Uo(f)),s>f){var M=s;s=f,f=M}if(d||s%1||f%1){var B=U2();return Kr(s+B*(f-s+r7("1e-"+((B+"").length-1))),f)}return Dp(s,f)}o(AC,"random");var SC=If(function(s,f,d){return f=f.toLowerCase(),s+(d?my(f):f)});function my(s){return im(Kt(s).toLowerCase())}o(my,"capitalize");function by(s){return s=Kt(s),s&&s.replace(hn,m7).replace(G9,"")}o(by,"deburr");function MC(s,f,d){s=Kt(s),f=Dn(f);var M=s.length;d=d===t?M:ba(wt(d),0,M);var B=d;return d-=f.length,d>=0&&s.slice(d,B)==f}o(MC,"endsWith");function TC(s){return s=Kt(s),s&&it.test(s)?s.replace(Tn,b7):s}o(TC,"escape");function CC(s){return s=Kt(s),s&&ft.test(s)?s.replace(cn,"\\$&"):s}o(CC,"escapeRegExp");var kC=If(function(s,f,d){return s+(d?"-":"")+f.toLowerCase()}),IC=If(function(s,f,d){return s+(d?" ":"")+f.toLowerCase()}),DC=yv("toLowerCase");function OC(s,f,d){s=Kt(s),f=wt(f);var M=f?Af(s):0;if(!f||M>=f)return s;var B=(f-M)/2;return ih(jl(B),d)+s+ih(Kl(B),d)}o(OC,"pad");function RC(s,f,d){s=Kt(s),f=wt(f);var M=f?Af(s):0;return f&&M<f?s+ih(f-M,d):s}o(RC,"padEnd");function NC(s,f,d){s=Kt(s),f=wt(f);var M=f?Af(s):0;return f&&M<f?ih(f-M,d)+s:s}o(NC,"padStart");function PC(s,f,d){return d||f==null?f=0:f&&(f=+f),H7(Kt(s).replace(Xe,""),f||0)}o(PC,"parseInt");function LC(s,f,d){return(d?on(s,f,d):f===t)?f=1:f=wt(f),Op(Kt(s),f)}o(LC,"repeat");function BC(){var s=arguments,f=Kt(s[0]);return s.length<3?f:f.replace(s[1],s[2])}o(BC,"replace");var UC=If(function(s,f,d){return s+(d?"_":"")+f.toLowerCase()});function $C(s,f,d){return d&&typeof d!="number"&&on(s,f,d)&&(f=d=t),d=d===t?g:d>>>0,d?(s=Kt(s),s&&(typeof f=="string"||f!=null&&!tm(f))&&(f=Dn(f),!f&&Ef(s))?ws(Ci(s),0,d):s.split(f,d)):[]}o($C,"split");var FC=If(function(s,f,d){return s+(d?" ":"")+im(f)});function qC(s,f,d){return s=Kt(s),d=d==null?0:ba(wt(d),0,s.length),f=Dn(f),s.slice(d,d+f.length)==f}o(qC,"startsWith");function HC(s,f,d){var M=z.templateSettings;d&&on(s,f,d)&&(f=t),s=Kt(s),f=bh({},f,M,Mv);var B=bh({},f.imports,M.imports,Mv),K=Ar(B),te=mp(B,K),fe,be,Me=0,Te=f.interpolate||Nr,Ie="__p += '",Le=gp((f.escape||Nr).source+"|"+Te.source+"|"+(Te===et?dt:Nr).source+"|"+(f.evaluate||Nr).source+"|$","g"),ze="//# sourceURL="+(Vt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++X9+"]")+`
|
|
4
|
-
`;s.replace(Le,function(Qe,Ct,Nt,Rn,sn,Nn){return Nt||(Nt=Rn),Ie+=s.slice(Me,Nn).replace(dn,
|
|
3
|
+
`)}o(gS,"insertWrapDetails");function vS(s){return vt(s)||xa(s)||!!(U2&&s&&s[U2])}o(vS,"isFlattenable");function Bo(s,f){var d=typeof s;return f=f??_,!!f&&(d=="number"||d!="symbol"&&ln.test(s))&&s>-1&&s%1==0&&s<f}o(Bo,"isIndex");function on(s,f,d){if(!ar(d))return!1;var M=typeof f;return(M=="number"?mn(d)&&Bo(f,d.length):M=="string"&&f in d)?Ii(d[f],s):!1}o(on,"isIterateeCall");function Wp(s,f){if(vt(s))return!1;var d=typeof s;return d=="number"||d=="symbol"||d=="boolean"||s==null||On(s)?!0:st.test(s)||!Xn.test(s)||f!=null&&s in Zt(f)}o(Wp,"isKey");function yS(s){var f=typeof s;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?s!=="__proto__":s===null}o(yS,"isKeyable");function Jp(s){var f=ah(s),d=z[f];if(typeof d!="function"||!(f in Dt.prototype))return!1;if(s===d)return!0;var M=jp(d);return!!M&&s===M[0]}o(Jp,"isLaziable");function xS(s){return!!N2&&N2 in s}o(xS,"isMasked");var wS=Bl?Uo:hm;function tu(s){var f=s&&s.constructor,d=typeof f=="function"&&f.prototype||Mf;return s===d}o(tu,"isPrototype");function Nv(s){return s===s&&!ar(s)}o(Nv,"isStrictComparable");function Pv(s,f){return function(d){return d==null?!1:d[s]===f&&(f!==t||s in Zt(d))}}o(Pv,"matchesStrictComparable");function _S(s){var f=dh(s,function(M){return d.size===u&&d.clear(),M}),d=f.cache;return f}o(_S,"memoizeCapped");function ES(s,f){var d=s[1],M=f[1],U=d|M,K=U<(D|P|oe),te=M==oe&&d==B||M==oe&&d==j&&s[7].length<=f[8]||M==(oe|j)&&f[7].length<=f[8]&&d==B;if(!(K||te))return s;M&D&&(s[2]=f[2],U|=d&D?0:J);var fe=f[3];if(fe){var be=s[3];s[3]=be?gv(be,fe,f[4]):fe,s[4]=be?bs(s[3],m):f[4]}return fe=f[5],fe&&(be=s[5],s[5]=be?vv(be,fe,f[6]):fe,s[6]=be?bs(s[5],m):f[6]),fe=f[7],fe&&(s[7]=fe),M&oe&&(s[8]=s[8]==null?f[8]:Kr(s[8],f[8])),s[9]==null&&(s[9]=f[9]),s[0]=f[0],s[1]=U,s}o(ES,"mergeData");function AS(s){var f=[];if(s!=null)for(var d in Zt(s))f.push(d);return f}o(AS,"nativeKeysIn");function SS(s){return $l.call(s)}o(SS,"objectToString");function Lv(s,f,d){return f=wr(f===t?s.length-1:f,0),function(){for(var M=arguments,U=-1,K=wr(M.length-f,0),te=xe(K);++U<K;)te[U]=M[f+U];U=-1;for(var fe=xe(f+1);++U<f;)fe[U]=M[U];return fe[f]=d(te),kn(s,this,fe)}}o(Lv,"overRest");function Bv(s,f){return f.length<2?s:ga(s,ai(f,0,-1))}o(Bv,"parent");function MS(s,f){for(var d=s.length,M=Kr(f.length,d),U=pn(s);M--;){var K=f[M];s[M]=Bo(K,d)?U[K]:t}return s}o(MS,"reorder");function Yp(s,f){if(!(f==="constructor"&&typeof s[f]=="function")&&f!="__proto__")return s[f]}o(Yp,"safeGet");var Uv=Fv(av),ru=q7||function(s,f){return Er.setTimeout(s,f)},Xp=Fv(JA);function $v(s,f,d){var M=f+"";return Xp(s,gS(M,TS(pS(M),d)))}o($v,"setWrapToString");function Fv(s){var f=0,d=0;return function(){var M=j7(),U=h-(M-d);if(d=M,U>0){if(++f>=T)return arguments[0]}else f=0;return s.apply(t,arguments)}}o(Fv,"shortOut");function ch(s,f){var d=-1,M=s.length,U=M-1;for(f=f===t?M:f;++d<f;){var K=Rp(d,U),te=s[K];s[K]=s[d],s[d]=te}return s.length=f,s}o(ch,"shuffleSelf");var qv=_S(function(s){var f=[];return s.charCodeAt(0)===46&&f.push(""),s.replace(at,function(d,M,U,K){f.push(U?K.replace(ei,"$1"):M||d)}),f});function ro(s){if(typeof s=="string"||On(s))return s;var f=s+"";return f=="0"&&1/s==-p?"-0":f}o(ro,"toKey");function ya(s){if(s!=null){try{return Ul.call(s)}catch{}try{return s+""}catch{}}return""}o(ya,"toSource");function TS(s,f){return ni(w,function(d){var M="_."+d[0];f&d[1]&&!Rl(s,M)&&s.push(M)}),s.sort()}o(TS,"updateWrapDetails");function Hv(s){if(s instanceof Dt)return s.clone();var f=new oi(s.__wrapped__,s.__chain__);return f.__actions__=pn(s.__actions__),f.__index__=s.__index__,f.__values__=s.__values__,f}o(Hv,"wrapperClone");function CS(s,f,d){(d?on(s,f,d):f===t)?f=1:f=wr(wt(f),0);var M=s==null?0:s.length;if(!M||f<1)return[];for(var U=0,K=0,te=xe(jl(M/f));U<M;)te[K++]=ai(s,U,U+=f);return te}o(CS,"chunk");function kS(s){for(var f=-1,d=s==null?0:s.length,M=0,U=[];++f<d;){var K=s[f];K&&(U[M++]=K)}return U}o(kS,"compact");function IS(){var s=arguments.length;if(!s)return[];for(var f=xe(s-1),d=arguments[0],M=s;M--;)f[M-1]=arguments[M];return ms(vt(d)?pn(d):[d],Pr(f,1))}o(IS,"concat");var DS=St(function(s,f){return mr(s)?Yc(s,Pr(f,1,mr,!0)):[]}),OS=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Yc(s,Pr(f,1,mr,!0),Ye(d,2)):[]}),RS=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Yc(s,Pr(f,1,mr,!0),t,d):[]});function NS(s,f,d){var M=s==null?0:s.length;return M?(f=d||f===t?1:wt(f),ai(s,f<0?0:f,M)):[]}o(NS,"drop");function PS(s,f,d){var M=s==null?0:s.length;return M?(f=d||f===t?1:wt(f),f=M-f,ai(s,0,f<0?0:f)):[]}o(PS,"dropRight");function LS(s,f){return s&&s.length?th(s,Ye(f,3),!0,!0):[]}o(LS,"dropRightWhile");function BS(s,f){return s&&s.length?th(s,Ye(f,3),!0):[]}o(BS,"dropWhile");function US(s,f,d,M){var U=s==null?0:s.length;return U?(d&&typeof d!="number"&&on(s,f,d)&&(d=0,M=U),IA(s,f,d,M)):[]}o(US,"fill");function zv(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var U=d==null?0:wt(d);return U<0&&(U=wr(M+U,0)),Nl(s,Ye(f,3),U)}o(zv,"findIndex");function Kv(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var U=M-1;return d!==t&&(U=wt(d),U=d<0?wr(M+U,0):Kr(U,M-1)),Nl(s,Ye(f,3),U,!0)}o(Kv,"findLastIndex");function jv(s){var f=s==null?0:s.length;return f?Pr(s,1):[]}o(jv,"flatten");function $S(s){var f=s==null?0:s.length;return f?Pr(s,p):[]}o($S,"flattenDeep");function FS(s,f){var d=s==null?0:s.length;return d?(f=f===t?1:wt(f),Pr(s,f)):[]}o(FS,"flattenDepth");function qS(s){for(var f=-1,d=s==null?0:s.length,M={};++f<d;){var U=s[f];M[U[0]]=U[1]}return M}o(qS,"fromPairs");function Gv(s){return s&&s.length?s[0]:t}o(Gv,"head");function HS(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var U=d==null?0:wt(d);return U<0&&(U=wr(M+U,0)),Ef(s,f,U)}o(HS,"indexOf");function zS(s){var f=s==null?0:s.length;return f?ai(s,0,-1):[]}o(zS,"initial");var KS=St(function(s){var f=sr(s,Up);return f.length&&f[0]===s[0]?Cp(f):[]}),jS=St(function(s){var f=fi(s),d=sr(s,Up);return f===fi(d)?f=t:d.pop(),d.length&&d[0]===s[0]?Cp(d,Ye(f,2)):[]}),GS=St(function(s){var f=fi(s),d=sr(s,Up);return f=typeof f=="function"?f:t,f&&d.pop(),d.length&&d[0]===s[0]?Cp(d,t,f):[]});function VS(s,f){return s==null?"":z7.call(s,f)}o(VS,"join");function fi(s){var f=s==null?0:s.length;return f?s[f-1]:t}o(fi,"last");function WS(s,f,d){var M=s==null?0:s.length;if(!M)return-1;var U=M;return d!==t&&(U=wt(d),U=U<0?wr(M+U,0):Kr(U,M-1)),f===f?T7(s,f,U):Nl(s,M2,U,!0)}o(WS,"lastIndexOf");function JS(s,f){return s&&s.length?nv(s,wt(f)):t}o(JS,"nth");var YS=St(Vv);function Vv(s,f){return s&&s.length&&f&&f.length?Op(s,f):s}o(Vv,"pullAll");function XS(s,f,d){return s&&s.length&&f&&f.length?Op(s,f,Ye(d,2)):s}o(XS,"pullAllBy");function ZS(s,f,d){return s&&s.length&&f&&f.length?Op(s,f,t,d):s}o(ZS,"pullAllWith");var QS=Lo(function(s,f){var d=s==null?0:s.length,M=Ap(s,f);return sv(s,sr(f,function(U){return Bo(U,d)?+U:U}).sort(bv)),M});function eM(s,f){var d=[];if(!(s&&s.length))return d;var M=-1,U=[],K=s.length;for(f=Ye(f,3);++M<K;){var te=s[M];f(te,M,s)&&(d.push(te),U.push(M))}return sv(s,U),d}o(eM,"remove");function Zp(s){return s==null?s:V7.call(s)}o(Zp,"reverse");function tM(s,f,d){var M=s==null?0:s.length;return M?(d&&typeof d!="number"&&on(s,f,d)?(f=0,d=M):(f=f==null?0:wt(f),d=d===t?M:wt(d)),ai(s,f,d)):[]}o(tM,"slice");function rM(s,f){return eh(s,f)}o(rM,"sortedIndex");function nM(s,f,d){return Pp(s,f,Ye(d,2))}o(nM,"sortedIndexBy");function iM(s,f){var d=s==null?0:s.length;if(d){var M=eh(s,f);if(M<d&&Ii(s[M],f))return M}return-1}o(iM,"sortedIndexOf");function oM(s,f){return eh(s,f,!0)}o(oM,"sortedLastIndex");function sM(s,f,d){return Pp(s,f,Ye(d,2),!0)}o(sM,"sortedLastIndexBy");function aM(s,f){var d=s==null?0:s.length;if(d){var M=eh(s,f,!0)-1;if(Ii(s[M],f))return M}return-1}o(aM,"sortedLastIndexOf");function fM(s){return s&&s.length?fv(s):[]}o(fM,"sortedUniq");function cM(s,f){return s&&s.length?fv(s,Ye(f,2)):[]}o(cM,"sortedUniqBy");function uM(s){var f=s==null?0:s.length;return f?ai(s,1,f):[]}o(uM,"tail");function lM(s,f,d){return s&&s.length?(f=d||f===t?1:wt(f),ai(s,0,f<0?0:f)):[]}o(lM,"take");function hM(s,f,d){var M=s==null?0:s.length;return M?(f=d||f===t?1:wt(f),f=M-f,ai(s,f<0?0:f,M)):[]}o(hM,"takeRight");function dM(s,f){return s&&s.length?th(s,Ye(f,3),!1,!0):[]}o(dM,"takeRightWhile");function pM(s,f){return s&&s.length?th(s,Ye(f,3)):[]}o(pM,"takeWhile");var mM=St(function(s){return xs(Pr(s,1,mr,!0))}),bM=St(function(s){var f=fi(s);return mr(f)&&(f=t),xs(Pr(s,1,mr,!0),Ye(f,2))}),gM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,xs(Pr(s,1,mr,!0),t,f)});function vM(s){return s&&s.length?xs(s):[]}o(vM,"uniq");function yM(s,f){return s&&s.length?xs(s,Ye(f,2)):[]}o(yM,"uniqBy");function xM(s,f){return f=typeof f=="function"?f:t,s&&s.length?xs(s,t,f):[]}o(xM,"uniqWith");function Qp(s){if(!(s&&s.length))return[];var f=0;return s=ps(s,function(d){if(mr(d))return f=wr(d.length,f),!0}),bp(f,function(d){return sr(s,dp(d))})}o(Qp,"unzip");function Wv(s,f){if(!(s&&s.length))return[];var d=Qp(s);return f==null?d:sr(d,function(M){return kn(f,t,M)})}o(Wv,"unzipWith");var wM=St(function(s,f){return mr(s)?Yc(s,f):[]}),_M=St(function(s){return Bp(ps(s,mr))}),EM=St(function(s){var f=fi(s);return mr(f)&&(f=t),Bp(ps(s,mr),Ye(f,2))}),AM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,Bp(ps(s,mr),t,f)}),SM=St(Qp);function MM(s,f){return hv(s||[],f||[],Jc)}o(MM,"zipObject");function TM(s,f){return hv(s||[],f||[],Qc)}o(TM,"zipObjectDeep");var CM=St(function(s){var f=s.length,d=f>1?s[f-1]:t;return d=typeof d=="function"?(s.pop(),d):t,Wv(s,d)});function Jv(s){var f=z(s);return f.__chain__=!0,f}o(Jv,"chain");function kM(s,f){return f(s),s}o(kM,"tap");function uh(s,f){return f(s)}o(uh,"thru");var IM=Lo(function(s){var f=s.length,d=f?s[0]:0,M=this.__wrapped__,U=o(function(K){return Ap(K,s)},"interceptor");return f>1||this.__actions__.length||!(M instanceof Dt)||!Bo(d)?this.thru(U):(M=M.slice(d,+d+(f?1:0)),M.__actions__.push({func:uh,args:[U],thisArg:t}),new oi(M,this.__chain__).thru(function(K){return f&&!K.length&&K.push(t),K}))});function DM(){return Jv(this)}o(DM,"wrapperChain");function OM(){return new oi(this.value(),this.__chain__)}o(OM,"wrapperCommit");function RM(){this.__values__===t&&(this.__values__=cy(this.value()));var s=this.__index__>=this.__values__.length,f=s?t:this.__values__[this.__index__++];return{done:s,value:f}}o(RM,"wrapperNext");function NM(){return this}o(NM,"wrapperToIterator");function PM(s){for(var f,d=this;d instanceof Jl;){var M=Hv(d);M.__index__=0,M.__values__=t,f?U.__wrapped__=M:f=M;var U=M;d=d.__wrapped__}return U.__wrapped__=s,f}o(PM,"wrapperPlant");function LM(){var s=this.__wrapped__;if(s instanceof Dt){var f=s;return this.__actions__.length&&(f=new Dt(this)),f=f.reverse(),f.__actions__.push({func:uh,args:[Zp],thisArg:t}),new oi(f,this.__chain__)}return this.thru(Zp)}o(LM,"wrapperReverse");function BM(){return lv(this.__wrapped__,this.__actions__)}o(BM,"wrapperValue");var UM=rh(function(s,f,d){Vt.call(s,d)?++s[d]:No(s,d,1)});function $M(s,f,d){var M=vt(s)?A2:kA;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o($M,"every");function FM(s,f){var d=vt(s)?ps:W2;return d(s,Ye(f,3))}o(FM,"filter");var qM=_v(zv),HM=_v(Kv);function zM(s,f){return Pr(lh(s,f),1)}o(zM,"flatMap");function KM(s,f){return Pr(lh(s,f),p)}o(KM,"flatMapDeep");function jM(s,f,d){return d=d===t?1:wt(d),Pr(lh(s,f),d)}o(jM,"flatMapDepth");function Yv(s,f){var d=vt(s)?ni:ys;return d(s,Ye(f,3))}o(Yv,"forEach");function Xv(s,f){var d=vt(s)?u7:V2;return d(s,Ye(f,3))}o(Xv,"forEachRight");var GM=rh(function(s,f,d){Vt.call(s,d)?s[d].push(f):No(s,d,[f])});function VM(s,f,d,M){s=mn(s)?s:Nf(s),d=d&&!M?wt(d):0;var U=s.length;return d<0&&(d=wr(U+d,0)),bh(s)?d<=U&&s.indexOf(f,d)>-1:!!U&&Ef(s,f,d)>-1}o(VM,"includes");var WM=St(function(s,f,d){var M=-1,U=typeof f=="function",K=mn(s)?xe(s.length):[];return ys(s,function(te){K[++M]=U?kn(f,te,d):Xc(te,f,d)}),K}),JM=rh(function(s,f,d){No(s,d,f)});function lh(s,f){var d=vt(s)?sr:ev;return d(s,Ye(f,3))}o(lh,"map");function YM(s,f,d,M){return s==null?[]:(vt(f)||(f=f==null?[]:[f]),d=M?t:d,vt(d)||(d=d==null?[]:[d]),iv(s,f,d))}o(YM,"orderBy");var XM=rh(function(s,f,d){s[d?0:1].push(f)},function(){return[[],[]]});function ZM(s,f,d){var M=vt(s)?lp:C2,U=arguments.length<3;return M(s,Ye(f,4),d,U,ys)}o(ZM,"reduce");function QM(s,f,d){var M=vt(s)?l7:C2,U=arguments.length<3;return M(s,Ye(f,4),d,U,V2)}o(QM,"reduceRight");function eT(s,f){var d=vt(s)?ps:W2;return d(s,ph(Ye(f,3)))}o(eT,"reject");function tT(s){var f=vt(s)?z2:VA;return f(s)}o(tT,"sample");function rT(s,f,d){(d?on(s,f,d):f===t)?f=1:f=wt(f);var M=vt(s)?AA:WA;return M(s,f)}o(rT,"sampleSize");function nT(s){var f=vt(s)?SA:YA;return f(s)}o(nT,"shuffle");function iT(s){if(s==null)return 0;if(mn(s))return bh(s)?Sf(s):s.length;var f=jr(s);return f==ae||f==V?s.size:Ip(s).length}o(iT,"size");function oT(s,f,d){var M=vt(s)?hp:XA;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(oT,"some");var sT=St(function(s,f){if(s==null)return[];var d=f.length;return d>1&&on(s,f[0],f[1])?f=[]:d>2&&on(f[0],f[1],f[2])&&(f=[f[0]]),iv(s,Pr(f,1),[])}),hh=F7||function(){return Er.Date.now()};function aT(s,f){if(typeof f!="function")throw new ii(i);return s=wt(s),function(){if(--s<1)return f.apply(this,arguments)}}o(aT,"after");function Zv(s,f,d){return f=d?t:f,f=s&&f==null?s.length:f,Po(s,oe,t,t,t,t,f)}o(Zv,"ary");function Qv(s,f){var d;if(typeof f!="function")throw new ii(i);return s=wt(s),function(){return--s>0&&(d=f.apply(this,arguments)),s<=1&&(f=t),d}}o(Qv,"before");var em=St(function(s,f,d){var M=D;if(d.length){var U=bs(d,Of(em));M|=Q}return Po(s,M,f,d,U)}),ey=St(function(s,f,d){var M=D|P;if(d.length){var U=bs(d,Of(ey));M|=Q}return Po(f,M,s,d,U)});function ty(s,f,d){f=d?t:f;var M=Po(s,B,t,t,t,t,t,f);return M.placeholder=ty.placeholder,M}o(ty,"curry");function ry(s,f,d){f=d?t:f;var M=Po(s,W,t,t,t,t,t,f);return M.placeholder=ry.placeholder,M}o(ry,"curryRight");function ny(s,f,d){var M,U,K,te,fe,be,Me=0,Te=!1,Ie=!1,Le=!0;if(typeof s!="function")throw new ii(i);f=ci(f)||0,ar(d)&&(Te=!!d.leading,Ie="maxWait"in d,K=Ie?wr(ci(d.maxWait)||0,f):K,Le="trailing"in d?!!d.trailing:Le);function ze(br){var Di=M,Fo=U;return M=U=t,Me=br,te=s.apply(Fo,Di),te}o(ze,"invokeFunc");function Ze(br){return Me=br,fe=ru(Ct,f),Te?ze(br):te}o(Ze,"leadingEdge");function _t(br){var Di=br-be,Fo=br-Me,_y=f-Di;return Ie?Kr(_y,K-Fo):_y}o(_t,"remainingWait");function Qe(br){var Di=br-be,Fo=br-Me;return be===t||Di>=f||Di<0||Ie&&Fo>=K}o(Qe,"shouldInvoke");function Ct(){var br=hh();if(Qe(br))return Nt(br);fe=ru(Ct,_t(br))}o(Ct,"timerExpired");function Nt(br){return fe=t,Le&&M?ze(br):(M=U=t,te)}o(Nt,"trailingEdge");function Rn(){fe!==t&&dv(fe),Me=0,M=be=U=fe=t}o(Rn,"cancel");function sn(){return fe===t?te:Nt(hh())}o(sn,"flush");function Nn(){var br=hh(),Di=Qe(br);if(M=arguments,U=this,be=br,Di){if(fe===t)return Ze(be);if(Ie)return dv(fe),fe=ru(Ct,f),ze(be)}return fe===t&&(fe=ru(Ct,f)),te}return o(Nn,"debounced"),Nn.cancel=Rn,Nn.flush=sn,Nn}o(ny,"debounce");var fT=St(function(s,f){return G2(s,1,f)}),cT=St(function(s,f,d){return G2(s,ci(f)||0,d)});function uT(s){return Po(s,H)}o(uT,"flip");function dh(s,f){if(typeof s!="function"||f!=null&&typeof f!="function")throw new ii(i);var d=o(function(){var M=arguments,U=f?f.apply(this,M):M[0],K=d.cache;if(K.has(U))return K.get(U);var te=s.apply(this,M);return d.cache=K.set(U,te)||K,te},"memoized");return d.cache=new(dh.Cache||Ro),d}o(dh,"memoize"),dh.Cache=Ro;function ph(s){if(typeof s!="function")throw new ii(i);return function(){var f=arguments;switch(f.length){case 0:return!s.call(this);case 1:return!s.call(this,f[0]);case 2:return!s.call(this,f[0],f[1]);case 3:return!s.call(this,f[0],f[1],f[2])}return!s.apply(this,f)}}o(ph,"negate");function lT(s){return Qv(2,s)}o(lT,"once");var hT=ZA(function(s,f){f=f.length==1&&vt(f[0])?sr(f[0],In(Ye())):sr(Pr(f,1),In(Ye()));var d=f.length;return St(function(M){for(var U=-1,K=Kr(M.length,d);++U<K;)M[U]=f[U].call(this,M[U]);return kn(s,this,M)})}),tm=St(function(s,f){var d=bs(f,Of(tm));return Po(s,Q,t,f,d)}),iy=St(function(s,f){var d=bs(f,Of(iy));return Po(s,Y,t,f,d)}),dT=Lo(function(s,f){return Po(s,j,t,t,t,f)});function pT(s,f){if(typeof s!="function")throw new ii(i);return f=f===t?f:wt(f),St(s,f)}o(pT,"rest");function mT(s,f){if(typeof s!="function")throw new ii(i);return f=f==null?0:wr(wt(f),0),St(function(d){var M=d[f],U=_s(d,0,f);return M&&ms(U,M),kn(s,this,U)})}o(mT,"spread");function bT(s,f,d){var M=!0,U=!0;if(typeof s!="function")throw new ii(i);return ar(d)&&(M="leading"in d?!!d.leading:M,U="trailing"in d?!!d.trailing:U),ny(s,f,{leading:M,maxWait:f,trailing:U})}o(bT,"throttle");function gT(s){return Zv(s,1)}o(gT,"unary");function vT(s,f){return tm($p(f),s)}o(vT,"wrap");function yT(){if(!arguments.length)return[];var s=arguments[0];return vt(s)?s:[s]}o(yT,"castArray");function xT(s){return si(s,S)}o(xT,"clone");function wT(s,f){return f=typeof f=="function"?f:t,si(s,S,f)}o(wT,"cloneWith");function _T(s){return si(s,v|S)}o(_T,"cloneDeep");function ET(s,f){return f=typeof f=="function"?f:t,si(s,v|S,f)}o(ET,"cloneDeepWith");function AT(s,f){return f==null||j2(s,f,Ar(f))}o(AT,"conformsTo");function Ii(s,f){return s===f||s!==s&&f!==f}o(Ii,"eq");var ST=sh(Tp),MT=sh(function(s,f){return s>=f}),xa=X2(function(){return arguments}())?X2:function(s){return fr(s)&&Vt.call(s,"callee")&&!B2.call(s,"callee")},vt=xe.isArray,TT=v2?In(v2):PA;function mn(s){return s!=null&&mh(s.length)&&!Uo(s)}o(mn,"isArrayLike");function mr(s){return fr(s)&&mn(s)}o(mr,"isArrayLikeObject");function CT(s){return s===!0||s===!1||fr(s)&&nn(s)==Z}o(CT,"isBoolean");var Es=H7||hm,kT=y2?In(y2):LA;function IT(s){return fr(s)&&s.nodeType===1&&!nu(s)}o(IT,"isElement");function DT(s){if(s==null)return!0;if(mn(s)&&(vt(s)||typeof s=="string"||typeof s.splice=="function"||Es(s)||Rf(s)||xa(s)))return!s.length;var f=jr(s);if(f==ae||f==V)return!s.size;if(tu(s))return!Ip(s).length;for(var d in s)if(Vt.call(s,d))return!1;return!0}o(DT,"isEmpty");function OT(s,f){return Zc(s,f)}o(OT,"isEqual");function RT(s,f,d){d=typeof d=="function"?d:t;var M=d?d(s,f):t;return M===t?Zc(s,f,t,d):!!M}o(RT,"isEqualWith");function rm(s){if(!fr(s))return!1;var f=nn(s);return f==F||f==q||typeof s.message=="string"&&typeof s.name=="string"&&!nu(s)}o(rm,"isError");function NT(s){return typeof s=="number"&&$2(s)}o(NT,"isFinite");function Uo(s){if(!ar(s))return!1;var f=nn(s);return f==ee||f==ne||f==I||f==ce}o(Uo,"isFunction");function oy(s){return typeof s=="number"&&s==wt(s)}o(oy,"isInteger");function mh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=_}o(mh,"isLength");function ar(s){var f=typeof s;return s!=null&&(f=="object"||f=="function")}o(ar,"isObject");function fr(s){return s!=null&&typeof s=="object"}o(fr,"isObjectLike");var sy=x2?In(x2):UA;function PT(s,f){return s===f||kp(s,f,Gp(f))}o(PT,"isMatch");function LT(s,f,d){return d=typeof d=="function"?d:t,kp(s,f,Gp(f),d)}o(LT,"isMatchWith");function BT(s){return ay(s)&&s!=+s}o(BT,"isNaN");function UT(s){if(wS(s))throw new bt(n);return Z2(s)}o(UT,"isNative");function $T(s){return s===null}o($T,"isNull");function FT(s){return s==null}o(FT,"isNil");function ay(s){return typeof s=="number"||fr(s)&&nn(s)==Ae}o(ay,"isNumber");function nu(s){if(!fr(s)||nn(s)!=re)return!1;var f=Hl(s);if(f===null)return!0;var d=Vt.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&Ul.call(d)==L7}o(nu,"isPlainObject");var nm=w2?In(w2):$A;function qT(s){return oy(s)&&s>=-_&&s<=_}o(qT,"isSafeInteger");var fy=_2?In(_2):FA;function bh(s){return typeof s=="string"||!vt(s)&&fr(s)&&nn(s)==pe}o(bh,"isString");function On(s){return typeof s=="symbol"||fr(s)&&nn(s)==Ce}o(On,"isSymbol");var Rf=E2?In(E2):qA;function HT(s){return s===t}o(HT,"isUndefined");function zT(s){return fr(s)&&jr(s)==Re}o(zT,"isWeakMap");function KT(s){return fr(s)&&nn(s)==Ve}o(KT,"isWeakSet");var jT=sh(Dp),GT=sh(function(s,f){return s<=f});function cy(s){if(!s)return[];if(mn(s))return bh(s)?Ci(s):pn(s);if(Kc&&s[Kc])return A7(s[Kc]());var f=jr(s),d=f==ae?vp:f==V?Pl:Nf;return d(s)}o(cy,"toArray");function $o(s){if(!s)return s===0?s:0;if(s=ci(s),s===p||s===-p){var f=s<0?-1:1;return f*A}return s===s?s:0}o($o,"toFinite");function wt(s){var f=$o(s),d=f%1;return f===f?d?f-d:f:0}o(wt,"toInteger");function uy(s){return s?ba(wt(s),0,g):0}o(uy,"toLength");function ci(s){if(typeof s=="number")return s;if(On(s))return E;if(ar(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=ar(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=k2(s);var d=Ft.test(s);return d||un.test(s)?a7(s.slice(2),d?2:8):Cn.test(s)?E:+s}o(ci,"toNumber");function ly(s){return to(s,bn(s))}o(ly,"toPlainObject");function VT(s){return s?ba(wt(s),-_,_):s===0?s:0}o(VT,"toSafeInteger");function Kt(s){return s==null?"":Dn(s)}o(Kt,"toString");var WT=If(function(s,f){if(tu(f)||mn(f)){to(f,Ar(f),s);return}for(var d in f)Vt.call(f,d)&&Jc(s,d,f[d])}),hy=If(function(s,f){to(f,bn(f),s)}),gh=If(function(s,f,d,M){to(f,bn(f),s,M)}),JT=If(function(s,f,d,M){to(f,Ar(f),s,M)}),YT=Lo(Ap);function XT(s,f){var d=kf(s);return f==null?d:K2(d,f)}o(XT,"create");var ZT=St(function(s,f){s=Zt(s);var d=-1,M=f.length,U=M>2?f[2]:t;for(U&&on(f[0],f[1],U)&&(M=1);++d<M;)for(var K=f[d],te=bn(K),fe=-1,be=te.length;++fe<be;){var Me=te[fe],Te=s[Me];(Te===t||Ii(Te,Mf[Me])&&!Vt.call(s,Me))&&(s[Me]=K[Me])}return s}),QT=St(function(s){return s.push(t,kv),kn(dy,t,s)});function eC(s,f){return S2(s,Ye(f,3),eo)}o(eC,"findKey");function tC(s,f){return S2(s,Ye(f,3),Mp)}o(tC,"findLastKey");function rC(s,f){return s==null?s:Sp(s,Ye(f,3),bn)}o(rC,"forIn");function nC(s,f){return s==null?s:J2(s,Ye(f,3),bn)}o(nC,"forInRight");function iC(s,f){return s&&eo(s,Ye(f,3))}o(iC,"forOwn");function oC(s,f){return s&&Mp(s,Ye(f,3))}o(oC,"forOwnRight");function sC(s){return s==null?[]:Zl(s,Ar(s))}o(sC,"functions");function aC(s){return s==null?[]:Zl(s,bn(s))}o(aC,"functionsIn");function im(s,f,d){var M=s==null?t:ga(s,f);return M===t?d:M}o(im,"get");function fC(s,f){return s!=null&&Ov(s,f,DA)}o(fC,"has");function om(s,f){return s!=null&&Ov(s,f,OA)}o(om,"hasIn");var cC=Av(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=$l.call(f)),s[f]=d},am(gn)),uC=Av(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=$l.call(f)),Vt.call(s,f)?s[f].push(d):s[f]=[d]},Ye),lC=St(Xc);function Ar(s){return mn(s)?H2(s):Ip(s)}o(Ar,"keys");function bn(s){return mn(s)?H2(s,!0):HA(s)}o(bn,"keysIn");function hC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,U,K){No(d,f(M,U,K),M)}),d}o(hC,"mapKeys");function dC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,U,K){No(d,U,f(M,U,K))}),d}o(dC,"mapValues");var pC=If(function(s,f,d){Ql(s,f,d)}),dy=If(function(s,f,d,M){Ql(s,f,d,M)}),mC=Lo(function(s,f){var d={};if(s==null)return d;var M=!1;f=sr(f,function(K){return K=ws(K,s),M||(M=K.length>1),K}),to(s,Kp(s),d),M&&(d=si(d,v|x|S,cS));for(var U=f.length;U--;)Lp(d,f[U]);return d});function bC(s,f){return py(s,ph(Ye(f)))}o(bC,"omitBy");var gC=Lo(function(s,f){return s==null?{}:KA(s,f)});function py(s,f){if(s==null)return{};var d=sr(Kp(s),function(M){return[M]});return f=Ye(f),ov(s,d,function(M,U){return f(M,U[0])})}o(py,"pickBy");function vC(s,f,d){f=ws(f,s);var M=-1,U=f.length;for(U||(U=1,s=t);++M<U;){var K=s==null?t:s[ro(f[M])];K===t&&(M=U,K=d),s=Uo(K)?K.call(s):K}return s}o(vC,"result");function yC(s,f,d){return s==null?s:Qc(s,f,d)}o(yC,"set");function xC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:Qc(s,f,d,M)}o(xC,"setWith");var my=Tv(Ar),by=Tv(bn);function wC(s,f,d){var M=vt(s),U=M||Es(s)||Rf(s);if(f=Ye(f,4),d==null){var K=s&&s.constructor;U?d=M?new K:[]:ar(s)?d=Uo(K)?kf(Hl(s)):{}:d={}}return(U?ni:eo)(s,function(te,fe,be){return f(d,te,fe,be)}),d}o(wC,"transform");function _C(s,f){return s==null?!0:Lp(s,f)}o(_C,"unset");function EC(s,f,d){return s==null?s:uv(s,f,$p(d))}o(EC,"update");function AC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:uv(s,f,$p(d),M)}o(AC,"updateWith");function Nf(s){return s==null?[]:gp(s,Ar(s))}o(Nf,"values");function SC(s){return s==null?[]:gp(s,bn(s))}o(SC,"valuesIn");function MC(s,f,d){return d===t&&(d=f,f=t),d!==t&&(d=ci(d),d=d===d?d:0),f!==t&&(f=ci(f),f=f===f?f:0),ba(ci(s),f,d)}o(MC,"clamp");function TC(s,f,d){return f=$o(f),d===t?(d=f,f=0):d=$o(d),s=ci(s),RA(s,f,d)}o(TC,"inRange");function CC(s,f,d){if(d&&typeof d!="boolean"&&on(s,f,d)&&(f=d=t),d===t&&(typeof f=="boolean"?(d=f,f=t):typeof s=="boolean"&&(d=s,s=t)),s===t&&f===t?(s=0,f=1):(s=$o(s),f===t?(f=s,s=0):f=$o(f)),s>f){var M=s;s=f,f=M}if(d||s%1||f%1){var U=F2();return Kr(s+U*(f-s+s7("1e-"+((U+"").length-1))),f)}return Rp(s,f)}o(CC,"random");var kC=Df(function(s,f,d){return f=f.toLowerCase(),s+(d?gy(f):f)});function gy(s){return sm(Kt(s).toLowerCase())}o(gy,"capitalize");function vy(s){return s=Kt(s),s&&s.replace(hn,y7).replace(Y9,"")}o(vy,"deburr");function IC(s,f,d){s=Kt(s),f=Dn(f);var M=s.length;d=d===t?M:ba(wt(d),0,M);var U=d;return d-=f.length,d>=0&&s.slice(d,U)==f}o(IC,"endsWith");function DC(s){return s=Kt(s),s&&it.test(s)?s.replace(Tn,x7):s}o(DC,"escape");function OC(s){return s=Kt(s),s&&ft.test(s)?s.replace(cn,"\\$&"):s}o(OC,"escapeRegExp");var RC=Df(function(s,f,d){return s+(d?"-":"")+f.toLowerCase()}),NC=Df(function(s,f,d){return s+(d?" ":"")+f.toLowerCase()}),PC=wv("toLowerCase");function LC(s,f,d){s=Kt(s),f=wt(f);var M=f?Sf(s):0;if(!f||M>=f)return s;var U=(f-M)/2;return oh(Gl(U),d)+s+oh(jl(U),d)}o(LC,"pad");function BC(s,f,d){s=Kt(s),f=wt(f);var M=f?Sf(s):0;return f&&M<f?s+oh(f-M,d):s}o(BC,"padEnd");function UC(s,f,d){s=Kt(s),f=wt(f);var M=f?Sf(s):0;return f&&M<f?oh(f-M,d)+s:s}o(UC,"padStart");function $C(s,f,d){return d||f==null?f=0:f&&(f=+f),G7(Kt(s).replace(Xe,""),f||0)}o($C,"parseInt");function FC(s,f,d){return(d?on(s,f,d):f===t)?f=1:f=wt(f),Np(Kt(s),f)}o(FC,"repeat");function qC(){var s=arguments,f=Kt(s[0]);return s.length<3?f:f.replace(s[1],s[2])}o(qC,"replace");var HC=Df(function(s,f,d){return s+(d?"_":"")+f.toLowerCase()});function zC(s,f,d){return d&&typeof d!="number"&&on(s,f,d)&&(f=d=t),d=d===t?g:d>>>0,d?(s=Kt(s),s&&(typeof f=="string"||f!=null&&!nm(f))&&(f=Dn(f),!f&&Af(s))?_s(Ci(s),0,d):s.split(f,d)):[]}o(zC,"split");var KC=Df(function(s,f,d){return s+(d?" ":"")+sm(f)});function jC(s,f,d){return s=Kt(s),d=d==null?0:ba(wt(d),0,s.length),f=Dn(f),s.slice(d,d+f.length)==f}o(jC,"startsWith");function GC(s,f,d){var M=z.templateSettings;d&&on(s,f,d)&&(f=t),s=Kt(s),f=gh({},f,M,Cv);var U=gh({},f.imports,M.imports,Cv),K=Ar(U),te=gp(U,K),fe,be,Me=0,Te=f.interpolate||Nr,Ie="__p += '",Le=yp((f.escape||Nr).source+"|"+Te.source+"|"+(Te===et?dt:Nr).source+"|"+(f.evaluate||Nr).source+"|$","g"),ze="//# sourceURL="+(Vt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++t7+"]")+`
|
|
4
|
+
`;s.replace(Le,function(Qe,Ct,Nt,Rn,sn,Nn){return Nt||(Nt=Rn),Ie+=s.slice(Me,Nn).replace(dn,w7),Ct&&(fe=!0,Ie+=`' +
|
|
5
5
|
__e(`+Ct+`) +
|
|
6
6
|
'`),sn&&(be=!0,Ie+=`';
|
|
7
7
|
`+sn+`;
|
|
@@ -17,7 +17,7 @@ __p += '`),Nt&&(Ie+=`' +
|
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+Ie+`return __p
|
|
20
|
-
}`;var _t=vy(function(){return Ht(K,ze+"return "+Ie).apply(t,te)});if(_t.source=Ie,em(_t))throw _t;return _t}o(HC,"template");function zC(s){return Kt(s).toLowerCase()}o(zC,"toLower");function KC(s){return Kt(s).toUpperCase()}o(KC,"toUpper");function jC(s,f,d){if(s=Kt(s),s&&(d||f===t))return T2(s);if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=Ci(f),K=C2(M,B),te=k2(M,B)+1;return ws(M,K,te).join("")}o(jC,"trim");function GC(s,f,d){if(s=Kt(s),s&&(d||f===t))return s.slice(0,D2(s)+1);if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=k2(M,Ci(f))+1;return ws(M,0,B).join("")}o(GC,"trimEnd");function VC(s,f,d){if(s=Kt(s),s&&(d||f===t))return s.replace(Xe,"");if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=C2(M,Ci(f));return ws(M,B).join("")}o(VC,"trimStart");function WC(s,f){var d=G,M=le;if(ar(f)){var B="separator"in f?f.separator:B;d="length"in f?wt(f.length):d,M="omission"in f?Dn(f.omission):M}s=Kt(s);var K=s.length;if(Ef(s)){var te=Ci(s);K=te.length}if(d>=K)return s;var fe=d-Af(M);if(fe<1)return M;var be=te?ws(te,0,fe).join(""):s.slice(0,fe);if(B===t)return be+M;if(te&&(fe+=be.length-fe),tm(B)){if(s.slice(fe).search(B)){var Me,Te=be;for(B.global||(B=gp(B.source,Kt(tt.exec(B))+"g")),B.lastIndex=0;Me=B.exec(Te);)var Ie=Me.index;be=be.slice(0,Ie===t?fe:Ie)}}else if(s.indexOf(Dn(B),fe)!=fe){var Le=be.lastIndexOf(B);Le>-1&&(be=be.slice(0,Le))}return be+M}o(WC,"truncate");function JC(s){return s=Kt(s),s&&nt.test(s)?s.replace(Je,A7):s}o(JC,"unescape");var YC=If(function(s,f,d){return s+(d?" ":"")+f.toUpperCase()}),im=yv("toUpperCase");function gy(s,f,d){return s=Kt(s),f=d?t:f,f===t?y7(s)?T7(s):u7(s):s.match(f)||[]}o(gy,"words");var vy=St(function(s,f){try{return kn(s,t,f)}catch(d){return em(d)?d:new bt(d)}}),XC=Po(function(s,f){return ni(f,function(d){d=ro(d),Ro(s,d,Zp(s[d],s))}),s});function ZC(s){var f=s==null?0:s.length,d=Ye();return s=f?sr(s,function(M){if(typeof M[1]!="function")throw new ii(i);return[d(M[0]),M[1]]}):[],St(function(M){for(var B=-1;++B<f;){var K=s[B];if(kn(K[0],this,M))return kn(K[1],this,M)}})}o(ZC,"cond");function QC(s){return AA(si(s,v))}o(QC,"conforms");function om(s){return function(){return s}}o(om,"constant");function ek(s,f){return s==null||s!==s?f:s}o(ek,"defaultTo");var tk=wv(),rk=wv(!0);function gn(s){return s}o(gn,"identity");function sm(s){return X2(typeof s=="function"?s:si(s,v))}o(sm,"iteratee");function nk(s){return Q2(si(s,v))}o(nk,"matches");function ik(s,f){return ev(s,si(f,v))}o(ik,"matchesProperty");var ok=St(function(s,f){return function(d){return Yc(d,s,f)}}),sk=St(function(s,f){return function(d){return Yc(s,d,f)}});function am(s,f,d){var M=Ar(f),B=Xl(f,M);d==null&&!(ar(f)&&(B.length||!M.length))&&(d=f,f=s,s=this,B=Xl(f,Ar(f)));var K=!(ar(d)&&"chain"in d)||!!d.chain,te=Bo(s);return ni(B,function(fe){var be=f[fe];s[fe]=be,te&&(s.prototype[fe]=function(){var Me=this.__chain__;if(K||Me){var Te=s(this.__wrapped__),Ie=Te.__actions__=pn(this.__actions__);return Ie.push({func:be,args:arguments,thisArg:s}),Te.__chain__=Me,Te}return be.apply(s,ps([this.value()],arguments))})}),s}o(am,"mixin");function ak(){return Er._===this&&(Er._=R7),this}o(ak,"noConflict");function fm(){}o(fm,"noop");function fk(s){return s=wt(s),St(function(f){return tv(f,s)})}o(fk,"nthArg");var ck=$p(sr),uk=$p(_2),lk=$p(up);function yy(s){return Gp(s)?lp(ro(s)):qA(s)}o(yy,"property");function hk(s){return function(f){return s==null?t:ga(s,f)}}o(hk,"propertyOf");var dk=Ev(),pk=Ev(!0);function cm(){return[]}o(cm,"stubArray");function um(){return!1}o(um,"stubFalse");function mk(){return{}}o(mk,"stubObject");function bk(){return""}o(bk,"stubString");function gk(){return!0}o(gk,"stubTrue");function vk(s,f){if(s=wt(s),s<1||s>_)return[];var d=g,M=Kr(s,g);f=Ye(f),s-=g;for(var B=pp(M,f);++d<s;)f(d);return B}o(vk,"times");function yk(s){return vt(s)?sr(s,ro):On(s)?[s]:pn($v(Kt(s)))}o(yk,"toPath");function xk(s){var f=++D7;return Kt(s)+f}o(xk,"uniqueId");var wk=nh(function(s,f){return s+f},0),_k=Fp("ceil"),Ek=nh(function(s,f){return s/f},1),Ak=Fp("floor");function Sk(s){return s&&s.length?Yl(s,gn,Sp):t}o(Sk,"max");function Mk(s,f){return s&&s.length?Yl(s,Ye(f,2),Sp):t}o(Mk,"maxBy");function Tk(s){return S2(s,gn)}o(Tk,"mean");function Ck(s,f){return S2(s,Ye(f,2))}o(Ck,"meanBy");function kk(s){return s&&s.length?Yl(s,gn,kp):t}o(kk,"min");function Ik(s,f){return s&&s.length?Yl(s,Ye(f,2),kp):t}o(Ik,"minBy");var Dk=nh(function(s,f){return s*f},1),Ok=Fp("round"),Rk=nh(function(s,f){return s-f},0);function Nk(s){return s&&s.length?dp(s,gn):0}o(Nk,"sum");function Pk(s,f){return s&&s.length?dp(s,Ye(f,2)):0}return o(Pk,"sumBy"),z.after=nT,z.ary=Yv,z.assign=KT,z.assignIn=uy,z.assignInWith=bh,z.assignWith=jT,z.at=GT,z.before=Xv,z.bind=Zp,z.bindAll=XC,z.bindKey=Zv,z.castArray=mT,z.chain=Vv,z.chunk=AS,z.compact=SS,z.concat=MS,z.cond=ZC,z.conforms=QC,z.constant=om,z.countBy=NM,z.create=VT,z.curry=Qv,z.curryRight=ey,z.debounce=ty,z.defaults=WT,z.defaultsDeep=JT,z.defer=iT,z.delay=oT,z.difference=TS,z.differenceBy=CS,z.differenceWith=kS,z.drop=IS,z.dropRight=DS,z.dropRightWhile=OS,z.dropWhile=RS,z.fill=NS,z.filter=LM,z.flatMap=$M,z.flatMapDeep=FM,z.flatMapDepth=qM,z.flatten=zv,z.flattenDeep=PS,z.flattenDepth=LS,z.flip=sT,z.flow=tk,z.flowRight=rk,z.fromPairs=BS,z.functions=rC,z.functionsIn=nC,z.groupBy=HM,z.initial=$S,z.intersection=FS,z.intersectionBy=qS,z.intersectionWith=HS,z.invert=oC,z.invertBy=sC,z.invokeMap=KM,z.iteratee=sm,z.keyBy=jM,z.keys=Ar,z.keysIn=bn,z.map=uh,z.mapKeys=fC,z.mapValues=cC,z.matches=nk,z.matchesProperty=ik,z.memoize=hh,z.merge=uC,z.mergeWith=ly,z.method=ok,z.methodOf=sk,z.mixin=am,z.negate=dh,z.nthArg=fk,z.omit=lC,z.omitBy=hC,z.once=aT,z.orderBy=GM,z.over=ck,z.overArgs=fT,z.overEvery=uk,z.overSome=lk,z.partial=Qp,z.partialRight=ry,z.partition=VM,z.pick=dC,z.pickBy=hy,z.property=yy,z.propertyOf=hk,z.pull=GS,z.pullAll=jv,z.pullAllBy=VS,z.pullAllWith=WS,z.pullAt=JS,z.range=dk,z.rangeRight=pk,z.rearg=cT,z.reject=YM,z.remove=YS,z.rest=uT,z.reverse=Yp,z.sampleSize=ZM,z.set=mC,z.setWith=bC,z.shuffle=QM,z.slice=XS,z.sortBy=rT,z.sortedUniq=iM,z.sortedUniqBy=oM,z.split=$C,z.spread=lT,z.tail=sM,z.take=aM,z.takeRight=fM,z.takeRightWhile=cM,z.takeWhile=uM,z.tap=SM,z.throttle=hT,z.thru=ch,z.toArray=ay,z.toPairs=dy,z.toPairsIn=py,z.toPath=yk,z.toPlainObject=cy,z.transform=gC,z.unary=dT,z.union=lM,z.unionBy=hM,z.unionWith=dM,z.uniq=pM,z.uniqBy=mM,z.uniqWith=bM,z.unset=vC,z.unzip=Xp,z.unzipWith=Gv,z.update=yC,z.updateWith=xC,z.values=Rf,z.valuesIn=wC,z.without=gM,z.words=gy,z.wrap=pT,z.xor=vM,z.xorBy=yM,z.xorWith=xM,z.zip=wM,z.zipObject=_M,z.zipObjectDeep=EM,z.zipWith=AM,z.entries=dy,z.entriesIn=py,z.extend=uy,z.extendWith=bh,am(z,z),z.add=wk,z.attempt=vy,z.camelCase=SC,z.capitalize=my,z.ceil=_k,z.clamp=_C,z.clone=bT,z.cloneDeep=vT,z.cloneDeepWith=yT,z.cloneWith=gT,z.conformsTo=xT,z.deburr=by,z.defaultTo=ek,z.divide=Ek,z.endsWith=MC,z.eq=Ii,z.escape=TC,z.escapeRegExp=CC,z.every=PM,z.find=BM,z.findIndex=qv,z.findKey=YT,z.findLast=UM,z.findLastIndex=Hv,z.findLastKey=XT,z.floor=Ak,z.forEach=Wv,z.forEachRight=Jv,z.forIn=ZT,z.forInRight=QT,z.forOwn=eC,z.forOwnRight=tC,z.get=rm,z.gt=wT,z.gte=_T,z.has=iC,z.hasIn=nm,z.head=Kv,z.identity=gn,z.includes=zM,z.indexOf=US,z.inRange=EC,z.invoke=aC,z.isArguments=xa,z.isArray=vt,z.isArrayBuffer=ET,z.isArrayLike=mn,z.isArrayLikeObject=mr,z.isBoolean=AT,z.isBuffer=_s,z.isDate=ST,z.isElement=MT,z.isEmpty=TT,z.isEqual=CT,z.isEqualWith=kT,z.isError=em,z.isFinite=IT,z.isFunction=Bo,z.isInteger=ny,z.isLength=ph,z.isMap=iy,z.isMatch=DT,z.isMatchWith=OT,z.isNaN=RT,z.isNative=NT,z.isNil=LT,z.isNull=PT,z.isNumber=oy,z.isObject=ar,z.isObjectLike=fr,z.isPlainObject=ru,z.isRegExp=tm,z.isSafeInteger=BT,z.isSet=sy,z.isString=mh,z.isSymbol=On,z.isTypedArray=Of,z.isUndefined=UT,z.isWeakMap=$T,z.isWeakSet=FT,z.join=zS,z.kebabCase=kC,z.last=fi,z.lastIndexOf=KS,z.lowerCase=IC,z.lowerFirst=DC,z.lt=qT,z.lte=HT,z.max=Sk,z.maxBy=Mk,z.mean=Tk,z.meanBy=Ck,z.min=kk,z.minBy=Ik,z.stubArray=cm,z.stubFalse=um,z.stubObject=mk,z.stubString=bk,z.stubTrue=gk,z.multiply=Dk,z.nth=jS,z.noConflict=ak,z.noop=fm,z.now=lh,z.pad=OC,z.padEnd=RC,z.padStart=NC,z.parseInt=PC,z.random=AC,z.reduce=WM,z.reduceRight=JM,z.repeat=LC,z.replace=BC,z.result=pC,z.round=Ok,z.runInContext=de,z.sample=XM,z.size=eT,z.snakeCase=UC,z.some=tT,z.sortedIndex=ZS,z.sortedIndexBy=QS,z.sortedIndexOf=eM,z.sortedLastIndex=tM,z.sortedLastIndexBy=rM,z.sortedLastIndexOf=nM,z.startCase=FC,z.startsWith=qC,z.subtract=Rk,z.sum=Nk,z.sumBy=Pk,z.template=HC,z.times=vk,z.toFinite=Uo,z.toInteger=wt,z.toLength=fy,z.toLower=zC,z.toNumber=ci,z.toSafeInteger=zT,z.toString=Kt,z.toUpper=KC,z.trim=jC,z.trimEnd=GC,z.trimStart=VC,z.truncate=WC,z.unescape=JC,z.uniqueId=xk,z.upperCase=YC,z.upperFirst=im,z.each=Wv,z.eachRight=Jv,z.first=Kv,am(z,function(){var s={};return eo(z,function(f,d){Vt.call(z.prototype,d)||(s[d]=f)}),s}(),{chain:!1}),z.VERSION=e,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){z[s].placeholder=z}),ni(["drop","take"],function(s,f){Dt.prototype[s]=function(d){d=d===t?1:wr(wt(d),0);var M=this.__filtered__&&!f?new Dt(this):this.clone();return M.__filtered__?M.__takeCount__=Kr(d,M.__takeCount__):M.__views__.push({size:Kr(d,g),type:s+(M.__dir__<0?"Right":"")}),M},Dt.prototype[s+"Right"]=function(d){return this.reverse()[s](d).reverse()}}),ni(["filter","map","takeWhile"],function(s,f){var d=f+1,M=d==y||d==l;Dt.prototype[s]=function(B){var K=this.clone();return K.__iteratees__.push({iteratee:Ye(B,3),type:d}),K.__filtered__=K.__filtered__||M,K}}),ni(["head","last"],function(s,f){var d="take"+(f?"Right":"");Dt.prototype[s]=function(){return this[d](1).value()[0]}}),ni(["initial","tail"],function(s,f){var d="drop"+(f?"":"Right");Dt.prototype[s]=function(){return this.__filtered__?new Dt(this):this[d](1)}}),Dt.prototype.compact=function(){return this.filter(gn)},Dt.prototype.find=function(s){return this.filter(s).head()},Dt.prototype.findLast=function(s){return this.reverse().find(s)},Dt.prototype.invokeMap=St(function(s,f){return typeof s=="function"?new Dt(this):this.map(function(d){return Yc(d,s,f)})}),Dt.prototype.reject=function(s){return this.filter(dh(Ye(s)))},Dt.prototype.slice=function(s,f){s=wt(s);var d=this;return d.__filtered__&&(s>0||f<0)?new Dt(d):(s<0?d=d.takeRight(-s):s&&(d=d.drop(s)),f!==t&&(f=wt(f),d=f<0?d.dropRight(-f):d.take(f-s)),d)},Dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Dt.prototype.toArray=function(){return this.take(g)},eo(Dt.prototype,function(s,f){var d=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),B=z[M?"take"+(f=="last"?"Right":""):f],K=M||/^find/.test(f);!B||(z.prototype[f]=function(){var te=this.__wrapped__,fe=M?[1]:arguments,be=te instanceof Dt,Me=fe[0],Te=be||vt(te),Ie=o(function(Ct){var Nt=B.apply(z,ps([Ct],fe));return M&&Le?Nt[0]:Nt},"interceptor");Te&&d&&typeof Me=="function"&&Me.length!=1&&(be=Te=!1);var Le=this.__chain__,ze=!!this.__actions__.length,Ze=K&&!Le,_t=be&&!ze;if(!K&&Te){te=_t?te:new Dt(this);var Qe=s.apply(te,fe);return Qe.__actions__.push({func:ch,args:[Ie],thisArg:t}),new oi(Qe,Le)}return Ze&&_t?s.apply(this,fe):(Qe=this.thru(Ie),Ze?M?Qe.value()[0]:Qe.value():Qe)})}),ni(["pop","push","shift","sort","splice","unshift"],function(s){var f=Pl[s],d=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",M=/^(?:pop|shift)$/.test(s);z.prototype[s]=function(){var B=arguments;if(M&&!this.__chain__){var K=this.value();return f.apply(vt(K)?K:[],B)}return this[d](function(te){return f.apply(vt(te)?te:[],B)})}}),eo(Dt.prototype,function(s,f){var d=z[f];if(d){var M=d.name+"";Vt.call(Tf,M)||(Tf[M]=[]),Tf[M].push({name:f,func:d})}}),Tf[rh(t,P).name]=[{name:"wrapper",func:t}],Dt.prototype.clone=J7,Dt.prototype.reverse=Y7,Dt.prototype.value=X7,z.prototype.at=MM,z.prototype.chain=TM,z.prototype.commit=CM,z.prototype.next=kM,z.prototype.plant=DM,z.prototype.reverse=OM,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=RM,z.prototype.first=z.prototype.head,zc&&(z.prototype[zc]=IM),z},"runInContext"),bs=C7();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Er._=bs,define(function(){return bs})):ha?((ha.exports=bs)._=bs,sp._=bs):Er._=bs}).call(Nf)});function wa(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var su=jt(()=>{o(wa,"asUint8Array")});function au(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?wa(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var yh=jt(()=>{su();o(au,"allocUnsafe")});var Sy={};Jt(Sy,{concat:()=>Oi});function Oi(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));let r=au(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return wa(r)}var lm=jt(()=>{yh();su();o(Oi,"concat")});function tI(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),c=a.charCodeAt(0);if(r[c]!==255)throw new TypeError(a+" is ambiguous");r[c]=i}var u=t.length,m=t.charAt(0),v=Math.log(u)/Math.log(256),x=Math.log(256)/Math.log(u);function S(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var P=0,J=0,L=0,W=D.length;L!==W&&D[L]===0;)L++,P++;for(var Q=(W-L)*x+1>>>0,Y=new Uint8Array(Q);L!==W;){for(var oe=D[L],j=0,H=Q-1;(oe!==0||j<J)&&H!==-1;H--,j++)oe+=256*Y[H]>>>0,Y[H]=oe%u>>>0,oe=oe/u>>>0;if(oe!==0)throw new Error("Non-zero carry");J=j,L++}for(var G=Q-J;G!==Q&&Y[G]===0;)G++;for(var le=m.repeat(P);G<Q;++G)le+=t.charAt(Y[G]);return le}o(S,"encode");function O(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var P=0;if(D[P]!==" "){for(var J=0,L=0;D[P]===m;)J++,P++;for(var W=(D.length-P)*v+1>>>0,Q=new Uint8Array(W);D[P];){var Y=r[D.charCodeAt(P)];if(Y===255)return;for(var oe=0,j=W-1;(Y!==0||oe<L)&&j!==-1;j--,oe++)Y+=u*Q[j]>>>0,Q[j]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");L=oe,P++}if(D[P]!==" "){for(var H=W-L;H!==W&&Q[H]===0;)H++;for(var G=new Uint8Array(J+(W-H)),le=J;H!==W;)G[le++]=Q[H++];return G}}}o(O,"decodeUnsafe");function R(D){var P=O(D);if(P)return P;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:S,decodeUnsafe:O,decode:R}}var rI,nI,My,Ty=jt(()=>{o(tI,"base");rI=tI,nI=rI,My=nI});var fz,Cy,Fo,ky,Iy,Es=jt(()=>{fz=new Uint8Array(0),Cy=o((t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},"equals"),Fo=o(t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),ky=o(t=>new TextEncoder().encode(t),"fromString"),Iy=o(t=>new TextDecoder().decode(t),"toString")});var xh,wh,_h,Dy,Eh,Pf,As,iI,oI,cr,Ri=jt(()=>{Ty();Es();xh=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(xh,"Encoder");wh=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.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 Dy(this,e)}};o(wh,"Decoder");_h=class{constructor(e){this.decoders=e}or(e){return Dy(this,e)}decode(e){let r=e[0],n=this.decoders[r];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(_h,"ComposedDecoder");Dy=o((t,e)=>new _h({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),"or"),Eh=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new xh(e,r,n),this.decoder=new wh(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Eh,"Codec");Pf=o(({name:t,prefix:e,encode:r,decode:n})=>new Eh(t,e,r,n),"from"),As=o(({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=My(r,e);return Pf({prefix:t,name:e,encode:n,decode:a=>Fo(i(a))})},"baseX"),iI=o((t,e,r,n)=>{let i={};for(let x=0;x<e.length;++x)i[e[x]]=x;let a=t.length;for(;t[a-1]==="=";)--a;let c=new Uint8Array(a*r/8|0),u=0,m=0,v=0;for(let x=0;x<a;++x){let S=i[t[x]];if(S===void 0)throw new SyntaxError(`Non-${n} character`);m=m<<r|S,u+=r,u>=8&&(u-=8,c[v++]=255&m>>u)}if(u>=r||255&m<<8-u)throw new SyntaxError("Unexpected end of data");return c},"decode"),oI=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let m=0;m<t.length;++m)for(u=u<<8|t[m],c+=8;c>r;)c-=r,a+=e[i&u>>c];if(c&&(a+=e[i&u<<r-c]),n)for(;a.length*r&7;)a+="=";return a},"encode"),cr=o(({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Pf({prefix:e,name:t,encode(i){return oI(i,n,r)},decode(i){return iI(i,n,r,t)}}),"rfc4648")});var dm={};Jt(dm,{identity:()=>sI});var sI,Oy=jt(()=>{Ri();Es();sI=Pf({prefix:"\0",name:"identity",encode:t=>Iy(t),decode:t=>ky(t)})});var pm={};Jt(pm,{base2:()=>aI});var aI,Ry=jt(()=>{Ri();aI=cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var mm={};Jt(mm,{base8:()=>fI});var fI,Ny=jt(()=>{Ri();fI=cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var bm={};Jt(bm,{base10:()=>cI});var cI,Py=jt(()=>{Ri();cI=As({prefix:"9",name:"base10",alphabet:"0123456789"})});var gm={};Jt(gm,{base16:()=>uI,base16upper:()=>lI});var uI,lI,Ly=jt(()=>{Ri();uI=cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),lI=cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var vm={};Jt(vm,{base32:()=>Lf,base32hex:()=>mI,base32hexpad:()=>gI,base32hexpadupper:()=>vI,base32hexupper:()=>bI,base32pad:()=>dI,base32padupper:()=>pI,base32upper:()=>hI,base32z:()=>yI});var Lf,hI,dI,pI,mI,bI,gI,vI,yI,ym=jt(()=>{Ri();Lf=cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hI=cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),dI=cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),pI=cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),mI=cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),bI=cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),gI=cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vI=cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),yI=cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var xm={};Jt(xm,{base36:()=>Ni,base36upper:()=>xI});var Ni,xI,Bf=jt(()=>{Ri();Ni=As({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),xI=As({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var wm={};Jt(wm,{base58btc:()=>ui,base58flickr:()=>wI});var ui,wI,Ah=jt(()=>{Ri();ui=As({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),wI=As({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var _m={};Jt(_m,{base64:()=>_I,base64pad:()=>EI,base64url:()=>_a,base64urlpad:()=>AI});var _I,EI,_a,AI,Sh=jt(()=>{Ri();_I=cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),EI=cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_a=cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),AI=cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Em={};Jt(Em,{base256emoji:()=>kI});function TI(t){return t.reduce((e,r)=>(e+=SI[r],e),"")}function CI(t){let e=[];for(let r of t){let n=MI[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var By,SI,MI,kI,Uy=jt(()=>{Ri();By=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}"),SI=By.reduce((t,e,r)=>(t[r]=e,t),[]),MI=By.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);o(TI,"encode");o(CI,"decode");kI=Pf({prefix:"\u{1F680}",name:"base256emoji",encode:TI,decode:CI})});function qy(t,e,r){e=e||[],r=r||0;for(var n=r;t>=RI;)e[r++]=t&255|$y,t/=128;for(;t&OI;)e[r++]=t&255|$y,t>>>=7;return e[r]=t|0,qy.bytes=r-n+1,e}function Am(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Am.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&Fy)<<i:(c&Fy)*Math.pow(2,i),i+=7}while(c>=PI);return Am.bytes=a-n,r}var II,$y,DI,OI,RI,NI,PI,Fy,LI,BI,UI,$I,FI,qI,HI,zI,KI,jI,GI,VI,fu,Hy=jt(()=>{II=qy,$y=128,DI=127,OI=~DI,RI=Math.pow(2,31);o(qy,"encode");NI=Am,PI=128,Fy=127;o(Am,"read");LI=Math.pow(2,7),BI=Math.pow(2,14),UI=Math.pow(2,21),$I=Math.pow(2,28),FI=Math.pow(2,35),qI=Math.pow(2,42),HI=Math.pow(2,49),zI=Math.pow(2,56),KI=Math.pow(2,63),jI=o(function(t){return t<LI?1:t<BI?2:t<UI?3:t<$I?4:t<FI?5:t<qI?6:t<HI?7:t<zI?8:t<KI?9:10},"length"),GI={encode:II,decode:NI,encodingLength:jI},VI=GI,fu=VI});var cu,Uf,$f,Th=jt(()=>{Hy();cu=o((t,e=0)=>[fu.decode(t,e),fu.decode.bytes],"decode"),Uf=o((t,e,r=0)=>(fu.encode(t,e,r),e),"encodeTo"),$f=o(t=>fu.encodingLength(t),"encodingLength")});var qo,Ch,zy,Ea,Aa=jt(()=>{Es();Th();qo=o((t,e)=>{let r=e.byteLength,n=$f(t),i=n+$f(r),a=new Uint8Array(i+r);return Uf(t,a,0),Uf(r,a,n),a.set(e,i),new Ea(t,r,e,a)},"create"),Ch=o(t=>{let e=Fo(t),[r,n]=cu(e),[i,a]=cu(e.subarray(n)),c=e.subarray(n+a);if(c.byteLength!==i)throw new Error("Incorrect length");return new Ea(r,i,c,e)},"decode"),zy=o((t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&Cy(t.bytes,e.bytes),"equals"),Ea=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};o(Ea,"Digest")});var Sm,kh,Mm=jt(()=>{Aa();Sm=o(({name:t,code:e,encode:r})=>new kh(t,e,r),"from"),kh=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?qo(this.code,r):r.then(n=>qo(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(kh,"Hasher")});var Tm={};Jt(Tm,{sha256:()=>Ss,sha512:()=>WI});var jy,Ss,WI,lu=jt(()=>{Mm();jy=o(t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),"sha"),Ss=Sm({name:"sha2-256",code:18,encode:jy("SHA-256")}),WI=Sm({name:"sha2-512",code:19,encode:jy("SHA-512")})});var Cm={};Jt(Cm,{identity:()=>Ih});var Gy,JI,Vy,YI,Ih,km=jt(()=>{Es();Aa();Gy=0,JI="identity",Vy=Fo,YI=o(t=>qo(Gy,Vy(t)),"digest"),Ih={code:Gy,name:JI,encode:Vy,digest:YI}});var Wy=jt(()=>{Es()});var kz,Iz,Jy=jt(()=>{kz=new TextEncoder,Iz=new TextDecoder});var We,QI,eD,tD,hu,rD,Yy,Xy,Dh,Oh,nD,iD,oD,Pi=jt(()=>{Th();Aa();Ah();ym();Es();We=class{constructor(e,r,n,i){this.code=r,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:Oh,byteLength:Oh,code:Dh,version:Dh,multihash:Dh,bytes:Dh,_baseCache:Oh,asCID:Oh})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==hu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==rD)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return We.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=qo(e,r);return We.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&&zy(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return eD(r,i,e||ui.encoder);default:return tD(r,i,e||Lf.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 iD(/^0\.0/,oD),!!(e&&(e[Xy]||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 We)return e;if(e!=null&&e.asCID===e){let{version:r,code:n,multihash:i,bytes:a}=e;return new We(r,n,i,a||Yy(r,n,i.bytes))}else if(e!=null&&e[Xy]===!0){let{version:r,multihash:n,code:i}=e,a=Ch(n);return We.create(r,i,a)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==hu)throw new Error(`Version 0 CID must use dag-pb (code: ${hu}) block encoding`);return new We(e,r,n,n.bytes)}case 1:{let i=Yy(e,r,n.bytes);return new We(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return We.create(0,hu,e)}static createV1(e,r){return We.create(1,e,r)}static decode(e){let[r,n]=We.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=We.inspectBytes(e),n=r.size-r.multihashSize,i=Fo(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),c=new Ea(r.multihashCode,r.digestSize,a,i);return[r.version===0?We.createV0(c):We.createV1(r.codec,c),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=o(()=>{let[S,O]=cu(e.subarray(r));return r+=O,S},"next"),i=n(),a=hu;if(i===18?(i=0,r=0):i===1&&(a=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let c=r,u=n(),m=n(),v=r+m,x=v-c;return{version:i,codec:a,multihashCode:u,digestSize:m,multihashSize:x,size:v}}static parse(e,r){let[n,i]=QI(e,r),a=We.decode(i);return a._baseCache.set(n,e),a}};o(We,"CID");QI=o((t,e)=>{switch(t[0]){case"Q":{let r=e||ui;return[ui.prefix,r.decode(`${ui.prefix}${t}`)]}case ui.prefix:{let r=e||ui;return[ui.prefix,r.decode(t)]}case Lf.prefix:{let r=e||Lf;return[Lf.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},"parseCIDtoBytes"),eD=o((t,e,r)=>{let{prefix:n}=r;if(n!==ui.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i},"toStringV0"),tD=o((t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i},"toStringV1"),hu=112,rD=18,Yy=o((t,e,r)=>{let n=$f(t),i=n+$f(e),a=new Uint8Array(i+r.byteLength);return Uf(t,a,0),Uf(e,a,n),a.set(r,i),a},"encodeCID"),Xy=Symbol.for("@ipld/js-cid/CID"),Dh={writable:!1,configurable:!1,enumerable:!0},Oh={writable:!1,enumerable:!1,configurable:!1},nD="0.0.0-dev",iD=o((t,e)=>{if(t.test(nD))console.warn(e);else throw new Error(e)},"deprecate"),oD=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
20
|
+
}`;var _t=xy(function(){return Ht(K,ze+"return "+Ie).apply(t,te)});if(_t.source=Ie,rm(_t))throw _t;return _t}o(GC,"template");function VC(s){return Kt(s).toLowerCase()}o(VC,"toLower");function WC(s){return Kt(s).toUpperCase()}o(WC,"toUpper");function JC(s,f,d){if(s=Kt(s),s&&(d||f===t))return k2(s);if(!s||!(f=Dn(f)))return s;var M=Ci(s),U=Ci(f),K=I2(M,U),te=D2(M,U)+1;return _s(M,K,te).join("")}o(JC,"trim");function YC(s,f,d){if(s=Kt(s),s&&(d||f===t))return s.slice(0,R2(s)+1);if(!s||!(f=Dn(f)))return s;var M=Ci(s),U=D2(M,Ci(f))+1;return _s(M,0,U).join("")}o(YC,"trimEnd");function XC(s,f,d){if(s=Kt(s),s&&(d||f===t))return s.replace(Xe,"");if(!s||!(f=Dn(f)))return s;var M=Ci(s),U=I2(M,Ci(f));return _s(M,U).join("")}o(XC,"trimStart");function ZC(s,f){var d=G,M=le;if(ar(f)){var U="separator"in f?f.separator:U;d="length"in f?wt(f.length):d,M="omission"in f?Dn(f.omission):M}s=Kt(s);var K=s.length;if(Af(s)){var te=Ci(s);K=te.length}if(d>=K)return s;var fe=d-Sf(M);if(fe<1)return M;var be=te?_s(te,0,fe).join(""):s.slice(0,fe);if(U===t)return be+M;if(te&&(fe+=be.length-fe),nm(U)){if(s.slice(fe).search(U)){var Me,Te=be;for(U.global||(U=yp(U.source,Kt(tt.exec(U))+"g")),U.lastIndex=0;Me=U.exec(Te);)var Ie=Me.index;be=be.slice(0,Ie===t?fe:Ie)}}else if(s.indexOf(Dn(U),fe)!=fe){var Le=be.lastIndexOf(U);Le>-1&&(be=be.slice(0,Le))}return be+M}o(ZC,"truncate");function QC(s){return s=Kt(s),s&&nt.test(s)?s.replace(Je,C7):s}o(QC,"unescape");var ek=Df(function(s,f,d){return s+(d?" ":"")+f.toUpperCase()}),sm=wv("toUpperCase");function yy(s,f,d){return s=Kt(s),f=d?t:f,f===t?E7(s)?D7(s):p7(s):s.match(f)||[]}o(yy,"words");var xy=St(function(s,f){try{return kn(s,t,f)}catch(d){return rm(d)?d:new bt(d)}}),tk=Lo(function(s,f){return ni(f,function(d){d=ro(d),No(s,d,em(s[d],s))}),s});function rk(s){var f=s==null?0:s.length,d=Ye();return s=f?sr(s,function(M){if(typeof M[1]!="function")throw new ii(i);return[d(M[0]),M[1]]}):[],St(function(M){for(var U=-1;++U<f;){var K=s[U];if(kn(K[0],this,M))return kn(K[1],this,M)}})}o(rk,"cond");function nk(s){return CA(si(s,v))}o(nk,"conforms");function am(s){return function(){return s}}o(am,"constant");function ik(s,f){return s==null||s!==s?f:s}o(ik,"defaultTo");var ok=Ev(),sk=Ev(!0);function gn(s){return s}o(gn,"identity");function fm(s){return Q2(typeof s=="function"?s:si(s,v))}o(fm,"iteratee");function ak(s){return tv(si(s,v))}o(ak,"matches");function fk(s,f){return rv(s,si(f,v))}o(fk,"matchesProperty");var ck=St(function(s,f){return function(d){return Xc(d,s,f)}}),uk=St(function(s,f){return function(d){return Xc(s,d,f)}});function cm(s,f,d){var M=Ar(f),U=Zl(f,M);d==null&&!(ar(f)&&(U.length||!M.length))&&(d=f,f=s,s=this,U=Zl(f,Ar(f)));var K=!(ar(d)&&"chain"in d)||!!d.chain,te=Uo(s);return ni(U,function(fe){var be=f[fe];s[fe]=be,te&&(s.prototype[fe]=function(){var Me=this.__chain__;if(K||Me){var Te=s(this.__wrapped__),Ie=Te.__actions__=pn(this.__actions__);return Ie.push({func:be,args:arguments,thisArg:s}),Te.__chain__=Me,Te}return be.apply(s,ms([this.value()],arguments))})}),s}o(cm,"mixin");function lk(){return Er._===this&&(Er._=B7),this}o(lk,"noConflict");function um(){}o(um,"noop");function hk(s){return s=wt(s),St(function(f){return nv(f,s)})}o(hk,"nthArg");var dk=qp(sr),pk=qp(A2),mk=qp(hp);function wy(s){return Wp(s)?dp(ro(s)):jA(s)}o(wy,"property");function bk(s){return function(f){return s==null?t:ga(s,f)}}o(bk,"propertyOf");var gk=Sv(),vk=Sv(!0);function lm(){return[]}o(lm,"stubArray");function hm(){return!1}o(hm,"stubFalse");function yk(){return{}}o(yk,"stubObject");function xk(){return""}o(xk,"stubString");function wk(){return!0}o(wk,"stubTrue");function _k(s,f){if(s=wt(s),s<1||s>_)return[];var d=g,M=Kr(s,g);f=Ye(f),s-=g;for(var U=bp(M,f);++d<s;)f(d);return U}o(_k,"times");function Ek(s){return vt(s)?sr(s,ro):On(s)?[s]:pn(qv(Kt(s)))}o(Ek,"toPath");function Ak(s){var f=++P7;return Kt(s)+f}o(Ak,"uniqueId");var Sk=ih(function(s,f){return s+f},0),Mk=Hp("ceil"),Tk=ih(function(s,f){return s/f},1),Ck=Hp("floor");function kk(s){return s&&s.length?Xl(s,gn,Tp):t}o(kk,"max");function Ik(s,f){return s&&s.length?Xl(s,Ye(f,2),Tp):t}o(Ik,"maxBy");function Dk(s){return T2(s,gn)}o(Dk,"mean");function Ok(s,f){return T2(s,Ye(f,2))}o(Ok,"meanBy");function Rk(s){return s&&s.length?Xl(s,gn,Dp):t}o(Rk,"min");function Nk(s,f){return s&&s.length?Xl(s,Ye(f,2),Dp):t}o(Nk,"minBy");var Pk=ih(function(s,f){return s*f},1),Lk=Hp("round"),Bk=ih(function(s,f){return s-f},0);function Uk(s){return s&&s.length?mp(s,gn):0}o(Uk,"sum");function $k(s,f){return s&&s.length?mp(s,Ye(f,2)):0}return o($k,"sumBy"),z.after=aT,z.ary=Zv,z.assign=WT,z.assignIn=hy,z.assignInWith=gh,z.assignWith=JT,z.at=YT,z.before=Qv,z.bind=em,z.bindAll=tk,z.bindKey=ey,z.castArray=yT,z.chain=Jv,z.chunk=CS,z.compact=kS,z.concat=IS,z.cond=rk,z.conforms=nk,z.constant=am,z.countBy=UM,z.create=XT,z.curry=ty,z.curryRight=ry,z.debounce=ny,z.defaults=ZT,z.defaultsDeep=QT,z.defer=fT,z.delay=cT,z.difference=DS,z.differenceBy=OS,z.differenceWith=RS,z.drop=NS,z.dropRight=PS,z.dropRightWhile=LS,z.dropWhile=BS,z.fill=US,z.filter=FM,z.flatMap=zM,z.flatMapDeep=KM,z.flatMapDepth=jM,z.flatten=jv,z.flattenDeep=$S,z.flattenDepth=FS,z.flip=uT,z.flow=ok,z.flowRight=sk,z.fromPairs=qS,z.functions=sC,z.functionsIn=aC,z.groupBy=GM,z.initial=zS,z.intersection=KS,z.intersectionBy=jS,z.intersectionWith=GS,z.invert=cC,z.invertBy=uC,z.invokeMap=WM,z.iteratee=fm,z.keyBy=JM,z.keys=Ar,z.keysIn=bn,z.map=lh,z.mapKeys=hC,z.mapValues=dC,z.matches=ak,z.matchesProperty=fk,z.memoize=dh,z.merge=pC,z.mergeWith=dy,z.method=ck,z.methodOf=uk,z.mixin=cm,z.negate=ph,z.nthArg=hk,z.omit=mC,z.omitBy=bC,z.once=lT,z.orderBy=YM,z.over=dk,z.overArgs=hT,z.overEvery=pk,z.overSome=mk,z.partial=tm,z.partialRight=iy,z.partition=XM,z.pick=gC,z.pickBy=py,z.property=wy,z.propertyOf=bk,z.pull=YS,z.pullAll=Vv,z.pullAllBy=XS,z.pullAllWith=ZS,z.pullAt=QS,z.range=gk,z.rangeRight=vk,z.rearg=dT,z.reject=eT,z.remove=eM,z.rest=pT,z.reverse=Zp,z.sampleSize=rT,z.set=yC,z.setWith=xC,z.shuffle=nT,z.slice=tM,z.sortBy=sT,z.sortedUniq=fM,z.sortedUniqBy=cM,z.split=zC,z.spread=mT,z.tail=uM,z.take=lM,z.takeRight=hM,z.takeRightWhile=dM,z.takeWhile=pM,z.tap=kM,z.throttle=bT,z.thru=uh,z.toArray=cy,z.toPairs=my,z.toPairsIn=by,z.toPath=Ek,z.toPlainObject=ly,z.transform=wC,z.unary=gT,z.union=mM,z.unionBy=bM,z.unionWith=gM,z.uniq=vM,z.uniqBy=yM,z.uniqWith=xM,z.unset=_C,z.unzip=Qp,z.unzipWith=Wv,z.update=EC,z.updateWith=AC,z.values=Nf,z.valuesIn=SC,z.without=wM,z.words=yy,z.wrap=vT,z.xor=_M,z.xorBy=EM,z.xorWith=AM,z.zip=SM,z.zipObject=MM,z.zipObjectDeep=TM,z.zipWith=CM,z.entries=my,z.entriesIn=by,z.extend=hy,z.extendWith=gh,cm(z,z),z.add=Sk,z.attempt=xy,z.camelCase=kC,z.capitalize=gy,z.ceil=Mk,z.clamp=MC,z.clone=xT,z.cloneDeep=_T,z.cloneDeepWith=ET,z.cloneWith=wT,z.conformsTo=AT,z.deburr=vy,z.defaultTo=ik,z.divide=Tk,z.endsWith=IC,z.eq=Ii,z.escape=DC,z.escapeRegExp=OC,z.every=$M,z.find=qM,z.findIndex=zv,z.findKey=eC,z.findLast=HM,z.findLastIndex=Kv,z.findLastKey=tC,z.floor=Ck,z.forEach=Yv,z.forEachRight=Xv,z.forIn=rC,z.forInRight=nC,z.forOwn=iC,z.forOwnRight=oC,z.get=im,z.gt=ST,z.gte=MT,z.has=fC,z.hasIn=om,z.head=Gv,z.identity=gn,z.includes=VM,z.indexOf=HS,z.inRange=TC,z.invoke=lC,z.isArguments=xa,z.isArray=vt,z.isArrayBuffer=TT,z.isArrayLike=mn,z.isArrayLikeObject=mr,z.isBoolean=CT,z.isBuffer=Es,z.isDate=kT,z.isElement=IT,z.isEmpty=DT,z.isEqual=OT,z.isEqualWith=RT,z.isError=rm,z.isFinite=NT,z.isFunction=Uo,z.isInteger=oy,z.isLength=mh,z.isMap=sy,z.isMatch=PT,z.isMatchWith=LT,z.isNaN=BT,z.isNative=UT,z.isNil=FT,z.isNull=$T,z.isNumber=ay,z.isObject=ar,z.isObjectLike=fr,z.isPlainObject=nu,z.isRegExp=nm,z.isSafeInteger=qT,z.isSet=fy,z.isString=bh,z.isSymbol=On,z.isTypedArray=Rf,z.isUndefined=HT,z.isWeakMap=zT,z.isWeakSet=KT,z.join=VS,z.kebabCase=RC,z.last=fi,z.lastIndexOf=WS,z.lowerCase=NC,z.lowerFirst=PC,z.lt=jT,z.lte=GT,z.max=kk,z.maxBy=Ik,z.mean=Dk,z.meanBy=Ok,z.min=Rk,z.minBy=Nk,z.stubArray=lm,z.stubFalse=hm,z.stubObject=yk,z.stubString=xk,z.stubTrue=wk,z.multiply=Pk,z.nth=JS,z.noConflict=lk,z.noop=um,z.now=hh,z.pad=LC,z.padEnd=BC,z.padStart=UC,z.parseInt=$C,z.random=CC,z.reduce=ZM,z.reduceRight=QM,z.repeat=FC,z.replace=qC,z.result=vC,z.round=Lk,z.runInContext=de,z.sample=tT,z.size=iT,z.snakeCase=HC,z.some=oT,z.sortedIndex=rM,z.sortedIndexBy=nM,z.sortedIndexOf=iM,z.sortedLastIndex=oM,z.sortedLastIndexBy=sM,z.sortedLastIndexOf=aM,z.startCase=KC,z.startsWith=jC,z.subtract=Bk,z.sum=Uk,z.sumBy=$k,z.template=GC,z.times=_k,z.toFinite=$o,z.toInteger=wt,z.toLength=uy,z.toLower=VC,z.toNumber=ci,z.toSafeInteger=VT,z.toString=Kt,z.toUpper=WC,z.trim=JC,z.trimEnd=YC,z.trimStart=XC,z.truncate=ZC,z.unescape=QC,z.uniqueId=Ak,z.upperCase=ek,z.upperFirst=sm,z.each=Yv,z.eachRight=Xv,z.first=Gv,cm(z,function(){var s={};return eo(z,function(f,d){Vt.call(z.prototype,d)||(s[d]=f)}),s}(),{chain:!1}),z.VERSION=e,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){z[s].placeholder=z}),ni(["drop","take"],function(s,f){Dt.prototype[s]=function(d){d=d===t?1:wr(wt(d),0);var M=this.__filtered__&&!f?new Dt(this):this.clone();return M.__filtered__?M.__takeCount__=Kr(d,M.__takeCount__):M.__views__.push({size:Kr(d,g),type:s+(M.__dir__<0?"Right":"")}),M},Dt.prototype[s+"Right"]=function(d){return this.reverse()[s](d).reverse()}}),ni(["filter","map","takeWhile"],function(s,f){var d=f+1,M=d==y||d==l;Dt.prototype[s]=function(U){var K=this.clone();return K.__iteratees__.push({iteratee:Ye(U,3),type:d}),K.__filtered__=K.__filtered__||M,K}}),ni(["head","last"],function(s,f){var d="take"+(f?"Right":"");Dt.prototype[s]=function(){return this[d](1).value()[0]}}),ni(["initial","tail"],function(s,f){var d="drop"+(f?"":"Right");Dt.prototype[s]=function(){return this.__filtered__?new Dt(this):this[d](1)}}),Dt.prototype.compact=function(){return this.filter(gn)},Dt.prototype.find=function(s){return this.filter(s).head()},Dt.prototype.findLast=function(s){return this.reverse().find(s)},Dt.prototype.invokeMap=St(function(s,f){return typeof s=="function"?new Dt(this):this.map(function(d){return Xc(d,s,f)})}),Dt.prototype.reject=function(s){return this.filter(ph(Ye(s)))},Dt.prototype.slice=function(s,f){s=wt(s);var d=this;return d.__filtered__&&(s>0||f<0)?new Dt(d):(s<0?d=d.takeRight(-s):s&&(d=d.drop(s)),f!==t&&(f=wt(f),d=f<0?d.dropRight(-f):d.take(f-s)),d)},Dt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Dt.prototype.toArray=function(){return this.take(g)},eo(Dt.prototype,function(s,f){var d=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),U=z[M?"take"+(f=="last"?"Right":""):f],K=M||/^find/.test(f);!U||(z.prototype[f]=function(){var te=this.__wrapped__,fe=M?[1]:arguments,be=te instanceof Dt,Me=fe[0],Te=be||vt(te),Ie=o(function(Ct){var Nt=U.apply(z,ms([Ct],fe));return M&&Le?Nt[0]:Nt},"interceptor");Te&&d&&typeof Me=="function"&&Me.length!=1&&(be=Te=!1);var Le=this.__chain__,ze=!!this.__actions__.length,Ze=K&&!Le,_t=be&&!ze;if(!K&&Te){te=_t?te:new Dt(this);var Qe=s.apply(te,fe);return Qe.__actions__.push({func:uh,args:[Ie],thisArg:t}),new oi(Qe,Le)}return Ze&&_t?s.apply(this,fe):(Qe=this.thru(Ie),Ze?M?Qe.value()[0]:Qe.value():Qe)})}),ni(["pop","push","shift","sort","splice","unshift"],function(s){var f=Ll[s],d=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",M=/^(?:pop|shift)$/.test(s);z.prototype[s]=function(){var U=arguments;if(M&&!this.__chain__){var K=this.value();return f.apply(vt(K)?K:[],U)}return this[d](function(te){return f.apply(vt(te)?te:[],U)})}}),eo(Dt.prototype,function(s,f){var d=z[f];if(d){var M=d.name+"";Vt.call(Cf,M)||(Cf[M]=[]),Cf[M].push({name:f,func:d})}}),Cf[nh(t,P).name]=[{name:"wrapper",func:t}],Dt.prototype.clone=Q7,Dt.prototype.reverse=eA,Dt.prototype.value=tA,z.prototype.at=IM,z.prototype.chain=DM,z.prototype.commit=OM,z.prototype.next=RM,z.prototype.plant=PM,z.prototype.reverse=LM,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=BM,z.prototype.first=z.prototype.head,Kc&&(z.prototype[Kc]=NM),z},"runInContext"),gs=O7();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Er._=gs,define(function(){return gs})):ha?((ha.exports=gs)._=gs,fp._=gs):Er._=gs}).call(Pf)});function wa(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var au=jt(()=>{o(wa,"asUint8Array")});function fu(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?wa(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var xh=jt(()=>{au();o(fu,"allocUnsafe")});var Ty={};Jt(Ty,{concat:()=>Oi});function Oi(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));let r=fu(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return wa(r)}var dm=jt(()=>{xh();au();o(Oi,"concat")});function oI(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),c=a.charCodeAt(0);if(r[c]!==255)throw new TypeError(a+" is ambiguous");r[c]=i}var u=t.length,m=t.charAt(0),v=Math.log(u)/Math.log(256),x=Math.log(256)/Math.log(u);function S(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var P=0,J=0,B=0,W=D.length;B!==W&&D[B]===0;)B++,P++;for(var Q=(W-B)*x+1>>>0,Y=new Uint8Array(Q);B!==W;){for(var oe=D[B],j=0,H=Q-1;(oe!==0||j<J)&&H!==-1;H--,j++)oe+=256*Y[H]>>>0,Y[H]=oe%u>>>0,oe=oe/u>>>0;if(oe!==0)throw new Error("Non-zero carry");J=j,B++}for(var G=Q-J;G!==Q&&Y[G]===0;)G++;for(var le=m.repeat(P);G<Q;++G)le+=t.charAt(Y[G]);return le}o(S,"encode");function O(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var P=0;if(D[P]!==" "){for(var J=0,B=0;D[P]===m;)J++,P++;for(var W=(D.length-P)*v+1>>>0,Q=new Uint8Array(W);D[P];){var Y=r[D.charCodeAt(P)];if(Y===255)return;for(var oe=0,j=W-1;(Y!==0||oe<B)&&j!==-1;j--,oe++)Y+=u*Q[j]>>>0,Q[j]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");B=oe,P++}if(D[P]!==" "){for(var H=W-B;H!==W&&Q[H]===0;)H++;for(var G=new Uint8Array(J+(W-H)),le=J;H!==W;)G[le++]=Q[H++];return G}}}o(O,"decodeUnsafe");function R(D){var P=O(D);if(P)return P;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:S,decodeUnsafe:O,decode:R}}var sI,aI,Cy,ky=jt(()=>{o(oI,"base");sI=oI,aI=sI,Cy=aI});var lz,Iy,qo,Dy,Oy,As=jt(()=>{lz=new Uint8Array(0),Iy=o((t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},"equals"),qo=o(t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),Dy=o(t=>new TextEncoder().encode(t),"fromString"),Oy=o(t=>new TextDecoder().decode(t),"toString")});var wh,_h,Eh,Ry,Ah,Lf,Ss,fI,cI,cr,Ri=jt(()=>{ky();As();wh=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(wh,"Encoder");_h=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.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 Ry(this,e)}};o(_h,"Decoder");Eh=class{constructor(e){this.decoders=e}or(e){return Ry(this,e)}decode(e){let r=e[0],n=this.decoders[r];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(Eh,"ComposedDecoder");Ry=o((t,e)=>new Eh({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),"or"),Ah=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new wh(e,r,n),this.decoder=new _h(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Ah,"Codec");Lf=o(({name:t,prefix:e,encode:r,decode:n})=>new Ah(t,e,r,n),"from"),Ss=o(({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Cy(r,e);return Lf({prefix:t,name:e,encode:n,decode:a=>qo(i(a))})},"baseX"),fI=o((t,e,r,n)=>{let i={};for(let x=0;x<e.length;++x)i[e[x]]=x;let a=t.length;for(;t[a-1]==="=";)--a;let c=new Uint8Array(a*r/8|0),u=0,m=0,v=0;for(let x=0;x<a;++x){let S=i[t[x]];if(S===void 0)throw new SyntaxError(`Non-${n} character`);m=m<<r|S,u+=r,u>=8&&(u-=8,c[v++]=255&m>>u)}if(u>=r||255&m<<8-u)throw new SyntaxError("Unexpected end of data");return c},"decode"),cI=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let m=0;m<t.length;++m)for(u=u<<8|t[m],c+=8;c>r;)c-=r,a+=e[i&u>>c];if(c&&(a+=e[i&u<<r-c]),n)for(;a.length*r&7;)a+="=";return a},"encode"),cr=o(({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Lf({prefix:e,name:t,encode(i){return cI(i,n,r)},decode(i){return fI(i,n,r,t)}}),"rfc4648")});var mm={};Jt(mm,{identity:()=>uI});var uI,Ny=jt(()=>{Ri();As();uI=Lf({prefix:"\0",name:"identity",encode:t=>Oy(t),decode:t=>Dy(t)})});var bm={};Jt(bm,{base2:()=>lI});var lI,Py=jt(()=>{Ri();lI=cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var gm={};Jt(gm,{base8:()=>hI});var hI,Ly=jt(()=>{Ri();hI=cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var vm={};Jt(vm,{base10:()=>dI});var dI,By=jt(()=>{Ri();dI=Ss({prefix:"9",name:"base10",alphabet:"0123456789"})});var ym={};Jt(ym,{base16:()=>pI,base16upper:()=>mI});var pI,mI,Uy=jt(()=>{Ri();pI=cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mI=cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var xm={};Jt(xm,{base32:()=>Bf,base32hex:()=>yI,base32hexpad:()=>wI,base32hexpadupper:()=>_I,base32hexupper:()=>xI,base32pad:()=>gI,base32padupper:()=>vI,base32upper:()=>bI,base32z:()=>EI});var Bf,bI,gI,vI,yI,xI,wI,_I,EI,wm=jt(()=>{Ri();Bf=cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),bI=cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gI=cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vI=cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),yI=cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),xI=cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wI=cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),_I=cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),EI=cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var _m={};Jt(_m,{base36:()=>Ni,base36upper:()=>AI});var Ni,AI,Uf=jt(()=>{Ri();Ni=Ss({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),AI=Ss({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Em={};Jt(Em,{base58btc:()=>ui,base58flickr:()=>SI});var ui,SI,Sh=jt(()=>{Ri();ui=Ss({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),SI=Ss({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Am={};Jt(Am,{base64:()=>MI,base64pad:()=>TI,base64url:()=>_a,base64urlpad:()=>CI});var MI,TI,_a,CI,Mh=jt(()=>{Ri();MI=cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),TI=cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_a=cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),CI=cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Sm={};Jt(Sm,{base256emoji:()=>RI});function DI(t){return t.reduce((e,r)=>(e+=kI[r],e),"")}function OI(t){let e=[];for(let r of t){let n=II[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var $y,kI,II,RI,Fy=jt(()=>{Ri();$y=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}"),kI=$y.reduce((t,e,r)=>(t[r]=e,t),[]),II=$y.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);o(DI,"encode");o(OI,"decode");RI=Lf({prefix:"\u{1F680}",name:"base256emoji",encode:DI,decode:OI})});function zy(t,e,r){e=e||[],r=r||0;for(var n=r;t>=BI;)e[r++]=t&255|qy,t/=128;for(;t&LI;)e[r++]=t&255|qy,t>>>=7;return e[r]=t|0,zy.bytes=r-n+1,e}function Mm(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Mm.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&Hy)<<i:(c&Hy)*Math.pow(2,i),i+=7}while(c>=$I);return Mm.bytes=a-n,r}var NI,qy,PI,LI,BI,UI,$I,Hy,FI,qI,HI,zI,KI,jI,GI,VI,WI,JI,YI,XI,cu,Ky=jt(()=>{NI=zy,qy=128,PI=127,LI=~PI,BI=Math.pow(2,31);o(zy,"encode");UI=Mm,$I=128,Hy=127;o(Mm,"read");FI=Math.pow(2,7),qI=Math.pow(2,14),HI=Math.pow(2,21),zI=Math.pow(2,28),KI=Math.pow(2,35),jI=Math.pow(2,42),GI=Math.pow(2,49),VI=Math.pow(2,56),WI=Math.pow(2,63),JI=o(function(t){return t<FI?1:t<qI?2:t<HI?3:t<zI?4:t<KI?5:t<jI?6:t<GI?7:t<VI?8:t<WI?9:10},"length"),YI={encode:NI,decode:UI,encodingLength:JI},XI=YI,cu=XI});var uu,$f,Ff,Ch=jt(()=>{Ky();uu=o((t,e=0)=>[cu.decode(t,e),cu.decode.bytes],"decode"),$f=o((t,e,r=0)=>(cu.encode(t,e,r),e),"encodeTo"),Ff=o(t=>cu.encodingLength(t),"encodingLength")});var Ho,kh,jy,Ea,Aa=jt(()=>{As();Ch();Ho=o((t,e)=>{let r=e.byteLength,n=Ff(t),i=n+Ff(r),a=new Uint8Array(i+r);return $f(t,a,0),$f(r,a,n),a.set(e,i),new Ea(t,r,e,a)},"create"),kh=o(t=>{let e=qo(t),[r,n]=uu(e),[i,a]=uu(e.subarray(n)),c=e.subarray(n+a);if(c.byteLength!==i)throw new Error("Incorrect length");return new Ea(r,i,c,e)},"decode"),jy=o((t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&Iy(t.bytes,e.bytes),"equals"),Ea=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};o(Ea,"Digest")});var Tm,Ih,Cm=jt(()=>{Aa();Tm=o(({name:t,code:e,encode:r})=>new Ih(t,e,r),"from"),Ih=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Ho(this.code,r):r.then(n=>Ho(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(Ih,"Hasher")});var km={};Jt(km,{sha256:()=>Ms,sha512:()=>ZI});var Vy,Ms,ZI,hu=jt(()=>{Cm();Vy=o(t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),"sha"),Ms=Tm({name:"sha2-256",code:18,encode:Vy("SHA-256")}),ZI=Tm({name:"sha2-512",code:19,encode:Vy("SHA-512")})});var Im={};Jt(Im,{identity:()=>Dh});var Wy,QI,Jy,eD,Dh,Dm=jt(()=>{As();Aa();Wy=0,QI="identity",Jy=qo,eD=o(t=>Ho(Wy,Jy(t)),"digest"),Dh={code:Wy,name:QI,encode:Jy,digest:eD}});var Yy=jt(()=>{As()});var Oz,Rz,Xy=jt(()=>{Oz=new TextEncoder,Rz=new TextDecoder});var We,nD,iD,oD,du,sD,Zy,Qy,Oh,Rh,aD,fD,cD,Pi=jt(()=>{Ch();Aa();Sh();wm();As();We=class{constructor(e,r,n,i){this.code=r,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:Rh,byteLength:Rh,code:Oh,version:Oh,multihash:Oh,bytes:Oh,_baseCache:Rh,asCID:Rh})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==du)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==sD)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return We.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Ho(e,r);return We.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&&jy(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return iD(r,i,e||ui.encoder);default:return oD(r,i,e||Bf.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 fD(/^0\.0/,cD),!!(e&&(e[Qy]||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 We)return e;if(e!=null&&e.asCID===e){let{version:r,code:n,multihash:i,bytes:a}=e;return new We(r,n,i,a||Zy(r,n,i.bytes))}else if(e!=null&&e[Qy]===!0){let{version:r,multihash:n,code:i}=e,a=kh(n);return We.create(r,i,a)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==du)throw new Error(`Version 0 CID must use dag-pb (code: ${du}) block encoding`);return new We(e,r,n,n.bytes)}case 1:{let i=Zy(e,r,n.bytes);return new We(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return We.create(0,du,e)}static createV1(e,r){return We.create(1,e,r)}static decode(e){let[r,n]=We.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=We.inspectBytes(e),n=r.size-r.multihashSize,i=qo(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let a=i.subarray(r.multihashSize-r.digestSize),c=new Ea(r.multihashCode,r.digestSize,a,i);return[r.version===0?We.createV0(c):We.createV1(r.codec,c),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=o(()=>{let[S,O]=uu(e.subarray(r));return r+=O,S},"next"),i=n(),a=du;if(i===18?(i=0,r=0):i===1&&(a=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let c=r,u=n(),m=n(),v=r+m,x=v-c;return{version:i,codec:a,multihashCode:u,digestSize:m,multihashSize:x,size:v}}static parse(e,r){let[n,i]=nD(e,r),a=We.decode(i);return a._baseCache.set(n,e),a}};o(We,"CID");nD=o((t,e)=>{switch(t[0]){case"Q":{let r=e||ui;return[ui.prefix,r.decode(`${ui.prefix}${t}`)]}case ui.prefix:{let r=e||ui;return[ui.prefix,r.decode(t)]}case Bf.prefix:{let r=e||Bf;return[Bf.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},"parseCIDtoBytes"),iD=o((t,e,r)=>{let{prefix:n}=r;if(n!==ui.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let a=r.encode(t).slice(1);return e.set(n,a),a}else return i},"toStringV0"),oD=o((t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let a=r.encode(t);return e.set(n,a),a}else return i},"toStringV1"),du=112,sD=18,Zy=o((t,e,r)=>{let n=Ff(t),i=n+Ff(e),a=new Uint8Array(i+r.byteLength);return $f(t,a,0),$f(e,a,n),a.set(r,i),a},"encodeCID"),Qy=Symbol.for("@ipld/js-cid/CID"),Oh={writable:!1,configurable:!1,enumerable:!0},Rh={writable:!1,enumerable:!1,configurable:!1},aD="0.0.0-dev",fD=o((t,e)=>{if(t.test(aD))console.warn(e);else throw new Error(e)},"deprecate"),cD=`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 Im=jt(()=>{Pi();Th();Es();Mm();Aa()});var du,Uz,Dm=jt(()=>{Oy();Ry();Ny();Py();Ly();ym();Bf();Ah();Sh();Uy();lu();km();Wy();Jy();Im();du={...dm,...pm,...mm,...bm,...gm,...vm,...xm,...wm,..._m,...Em},Uz={...Tm,...Cm}});function Qy(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Zy,Om,sD,Rh,Rm=jt(()=>{Dm();yh();o(Qy,"createCodec");Zy=Qy("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),Om=Qy("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=au(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),sD={utf8:Zy,"utf-8":Zy,hex:du.base16,latin1:Om,ascii:Om,binary:Om,...du},Rh=sD});var e3={};Jt(e3,{fromString:()=>Ot});function Ot(t,e="utf8"){let r=Rh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?wa(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var pu=jt(()=>{Rm();su();o(Ot,"fromString")});var t3={};Jt(t3,{toString:()=>kt});function kt(t,e="utf8"){let r=Rh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var Ff=jt(()=>{Rm();o(kt,"toString")});var r3=De(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});function aD(t,e){var r=t>>>16&65535,n=t&65535,i=e>>>16&65535,a=e&65535;return n*a+(r*a+n*i<<16>>>0)|0}o(aD,"imulShim");Pn.mul=Math.imul||aD;function fD(t,e){return t+e|0}o(fD,"add");Pn.add=fD;function cD(t,e){return t-e|0}o(cD,"sub");Pn.sub=cD;function uD(t,e){return t<<e|t>>>32-e}o(uD,"rotl");Pn.rotl=uD;function lD(t,e){return t<<32-e|t>>>e}o(lD,"rotr");Pn.rotr=lD;function hD(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}o(hD,"isIntegerShim");Pn.isInteger=Number.isInteger||hD;Pn.MAX_SAFE_INTEGER=9007199254740991;Pn.isSafeInteger=function(t){return Pn.isInteger(t)&&t>=-Pn.MAX_SAFE_INTEGER&&t<=Pn.MAX_SAFE_INTEGER}});var Sa=De(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});var n3=r3();function dD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}o(dD,"readInt16BE");Mt.readInt16BE=dD;function pD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}o(pD,"readUint16BE");Mt.readUint16BE=pD;function mD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}o(mD,"readInt16LE");Mt.readInt16LE=mD;function bD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}o(bD,"readUint16LE");Mt.readUint16LE=bD;function i3(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}o(i3,"writeUint16BE");Mt.writeUint16BE=i3;Mt.writeInt16BE=i3;function o3(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}o(o3,"writeUint16LE");Mt.writeUint16LE=o3;Mt.writeInt16LE=o3;function Nm(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}o(Nm,"readInt32BE");Mt.readInt32BE=Nm;function Pm(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}o(Pm,"readUint32BE");Mt.readUint32BE=Pm;function Lm(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}o(Lm,"readInt32LE");Mt.readInt32LE=Lm;function Bm(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}o(Bm,"readUint32LE");Mt.readUint32LE=Bm;function Nh(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}o(Nh,"writeUint32BE");Mt.writeUint32BE=Nh;Mt.writeInt32BE=Nh;function Ph(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}o(Ph,"writeUint32LE");Mt.writeUint32LE=Ph;Mt.writeInt32LE=Ph;function gD(t,e){e===void 0&&(e=0);var r=Nm(t,e),n=Nm(t,e+4);return r*4294967296+n-(n>>31)*4294967296}o(gD,"readInt64BE");Mt.readInt64BE=gD;function vD(t,e){e===void 0&&(e=0);var r=Pm(t,e),n=Pm(t,e+4);return r*4294967296+n}o(vD,"readUint64BE");Mt.readUint64BE=vD;function yD(t,e){e===void 0&&(e=0);var r=Lm(t,e),n=Lm(t,e+4);return n*4294967296+r-(r>>31)*4294967296}o(yD,"readInt64LE");Mt.readInt64LE=yD;function xD(t,e){e===void 0&&(e=0);var r=Bm(t,e),n=Bm(t,e+4);return n*4294967296+r}o(xD,"readUint64LE");Mt.readUint64LE=xD;function s3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Nh(t/4294967296>>>0,e,r),Nh(t>>>0,e,r+4),e}o(s3,"writeUint64BE");Mt.writeUint64BE=s3;Mt.writeInt64BE=s3;function a3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ph(t>>>0,e,r),Ph(t/4294967296>>>0,e,r+4),e}o(a3,"writeUint64LE");Mt.writeUint64LE=a3;Mt.writeInt64LE=a3;function wD(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}o(wD,"readUintBE");Mt.readUintBE=wD;function _D(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}o(_D,"readUintLE");Mt.readUintLE=_D;function ED(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n3.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}o(ED,"writeUintBE");Mt.writeUintBE=ED;function AD(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n3.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}o(AD,"writeUintLE");Mt.writeUintLE=AD;function SD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}o(SD,"readFloat32BE");Mt.readFloat32BE=SD;function MD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}o(MD,"readFloat32LE");Mt.readFloat32LE=MD;function TD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}o(TD,"readFloat64BE");Mt.readFloat64BE=TD;function CD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}o(CD,"readFloat64LE");Mt.readFloat64LE=CD;function kD(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}o(kD,"writeFloat32BE");Mt.writeFloat32BE=kD;function ID(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}o(ID,"writeFloat32LE");Mt.writeFloat32LE=ID;function DD(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}o(DD,"writeFloat64BE");Mt.writeFloat64BE=DD;function OD(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}o(OD,"writeFloat64LE");Mt.writeFloat64LE=OD});var hi=De(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});function RD(t){for(var e=0;e<t.length;e++)t[e]=0;return t}o(RD,"wipe");Um.wipe=RD});var c3=De(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Bh=Sa(),Lh=hi();Ms.DIGEST_LENGTH=32;Ms.BLOCK_SIZE=64;var f3=function(){function t(){this.digestLength=Ms.DIGEST_LENGTH,this.blockSize=Ms.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(t,"SHA256"),t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Lh.wipe(this._buffer),Lh.wipe(this._temp),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&($m(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=$m(this._temp,this._state,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,a=r<<3,c=r%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<c-8;u++)this._buffer[u]=0;Bh.writeUint32BE(i,this._buffer,c-8),Bh.writeUint32BE(a,this._buffer,c-4),$m(this._temp,this._state,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)Bh.writeUint32BE(this._state[u],e,u*4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.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},t.prototype.cleanSavedState=function(e){Lh.wipe(e.state),e.buffer&&Lh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Ms.SHA256=f3;var ND=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 $m(t,e,r,n,i){for(;i>=64;){for(var a=e[0],c=e[1],u=e[2],m=e[3],v=e[4],x=e[5],S=e[6],O=e[7],R=0;R<16;R++){var D=n+R*4;t[R]=Bh.readUint32BE(r,D)}for(var R=16;R<64;R++){var P=t[R-2],J=(P>>>17|P<<32-17)^(P>>>19|P<<32-19)^P>>>10;P=t[R-15];var L=(P>>>7|P<<32-7)^(P>>>18|P<<32-18)^P>>>3;t[R]=(J+t[R-7]|0)+(L+t[R-16]|0)}for(var R=0;R<64;R++){var J=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&x^~v&S)|0)+(O+(ND[R]+t[R]|0)|0)|0,L=((a>>>2|a<<32-2)^(a>>>13|a<<32-13)^(a>>>22|a<<32-22))+(a&c^a&u^c&u)|0;O=S,S=x,x=v,v=m+J|0,m=u,u=c,c=a,a=J+L|0}e[0]+=a,e[1]+=c,e[2]+=u,e[3]+=m,e[4]+=v,e[5]+=x,e[6]+=S,e[7]+=O,n+=64,i-=64}return n}o($m,"hashBlocks");function PD(t){var e=new f3;e.update(t);var r=e.digest();return e.clean(),r}o(PD,"hash");Ms.hash=PD});var Fm=De((fK,Uh)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=global:i&&(n=self);var c=!n.JS_SHA3_NO_COMMON_JS&&typeof Uh=="object"&&Uh.exports,u=typeof define=="function"&&define.amd,m=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),x=[31,7936,2031616,520093696],S=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],D=[0,8,16,24],P=[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],J=[224,256,384,512],L=[128,256],W=["hex","buffer","arrayBuffer","array","digest"],Q={"128":168,"256":136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),m&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(I){return typeof I=="object"&&I.buffer&&I.buffer.constructor===ArrayBuffer});for(var Y=o(function(I,Z,se){return function(q){return new w(I,Z,I).update(q)[se]()}},"createOutputMethod"),oe=o(function(I,Z,se){return function(q,F){return new w(I,Z,F).update(q)[se]()}},"createShakeOutputMethod"),j=o(function(I,Z,se){return function(q,F,ee,ne){return l["cshake"+I].update(q,F,ee,ne)[se]()}},"createCshakeOutputMethod"),H=o(function(I,Z,se){return function(q,F,ee,ne){return l["kmac"+I].update(q,F,ee,ne)[se]()}},"createKmacOutputMethod"),G=o(function(I,Z,se,q){for(var F=0;F<W.length;++F){var ee=W[F];I[ee]=Z(se,q,ee)}return I},"createOutputMethods"),le=o(function(I,Z){var se=Y(I,Z,"hex");return se.create=function(){return new w(I,Z,I)},se.update=function(q){return se.create().update(q)},G(se,Y,I,Z)},"createMethod"),T=o(function(I,Z){var se=oe(I,Z,"hex");return se.create=function(q){return new w(I,Z,q)},se.update=function(q,F){return se.create(F).update(q)},G(se,oe,I,Z)},"createShakeMethod"),h=o(function(I,Z){var se=Q[I],q=j(I,Z,"hex");return q.create=function(F,ee,ne){return!ee&&!ne?l["shake"+I].create(F):new w(I,Z,F).bytepad([ee,ne],se)},q.update=function(F,ee,ne,ae){return q.create(ee,ne,ae).update(F)},G(q,j,I,Z)},"createCshakeMethod"),y=o(function(I,Z){var se=Q[I],q=H(I,Z,"hex");return q.create=function(F,ee,ne){return new k(I,Z,ee).bytepad(["KMAC",ne],se).bytepad([F],se)},q.update=function(F,ee,ne,ae){return q.create(F,ne,ae).update(ee)},G(q,H,I,Z)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:J,createMethod:le},{name:"sha3",padding:R,bits:J,createMethod:le},{name:"shake",padding:x,bits:L,createMethod:T},{name:"cshake",padding:S,bits:L,createMethod:h},{name:"kmac",padding:S,bits:L,createMethod:y}],l={},p=[],_=0;_<b.length;++_)for(var A=b[_],E=A.bits,g=0;g<E.length;++g){var C=A.name+"_"+E[g];if(p.push(C),l[C]=A.createMethod(E[g],A.padding),A.name!=="sha3"){var N=A.name+E[g];p.push(N),l[N]=l[C]}}function w(I,Z,se){this.blocks=[],this.s=[],this.padding=Z,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(I<<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(w,"Keccak"),w.prototype.update=function(I){if(this.finalized)throw new Error(e);var Z,se=typeof I;if(se!=="string"){if(se==="object"){if(I===null)throw new Error(t);if(m&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!m||!ArrayBuffer.isView(I)))throw new Error(t)}else throw new Error(t);Z=!0}for(var q=this.blocks,F=this.byteCount,ee=I.length,ne=this.blockCount,ae=0,Ae=this.s,ge,re;ae<ee;){if(this.reset)for(this.reset=!1,q[0]=this.block,ge=1;ge<ne+1;++ge)q[ge]=0;if(Z)for(ge=this.start;ae<ee&&ge<F;++ae)q[ge>>2]|=I[ae]<<D[ge++&3];else for(ge=this.start;ae<ee&&ge<F;++ae)re=I.charCodeAt(ae),re<128?q[ge>>2]|=re<<D[ge++&3]:re<2048?(q[ge>>2]|=(192|re>>6)<<D[ge++&3],q[ge>>2]|=(128|re&63)<<D[ge++&3]):re<55296||re>=57344?(q[ge>>2]|=(224|re>>12)<<D[ge++&3],q[ge>>2]|=(128|re>>6&63)<<D[ge++&3],q[ge>>2]|=(128|re&63)<<D[ge++&3]):(re=65536+((re&1023)<<10|I.charCodeAt(++ae)&1023),q[ge>>2]|=(240|re>>18)<<D[ge++&3],q[ge>>2]|=(128|re>>12&63)<<D[ge++&3],q[ge>>2]|=(128|re>>6&63)<<D[ge++&3],q[ge>>2]|=(128|re&63)<<D[ge++&3]);if(this.lastByteIndex=ge,ge>=F){for(this.start=ge-F,this.block=q[ne],ge=0;ge<ne;++ge)Ae[ge]^=q[ge];he(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(I,Z){var se=I&255,q=1,F=[se];for(I=I>>8,se=I&255;se>0;)F.unshift(se),I=I>>8,se=I&255,++q;return Z?F.push(q):F.unshift(q),this.update(F),F.length},w.prototype.encodeString=function(I){var Z,se=typeof I;if(se!=="string"){if(se==="object"){if(I===null)throw new Error(t);if(m&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!m||!ArrayBuffer.isView(I)))throw new Error(t)}else throw new Error(t);Z=!0}var q=0,F=I.length;if(Z)q=F;else for(var ee=0;ee<I.length;++ee){var ne=I.charCodeAt(ee);ne<128?q+=1:ne<2048?q+=2:ne<55296||ne>=57344?q+=3:(ne=65536+((ne&1023)<<10|I.charCodeAt(++ee)&1023),q+=4)}return q+=this.encode(q*8),this.update(I),q},w.prototype.bytepad=function(I,Z){for(var se=this.encode(Z),q=0;q<I.length;++q)se+=this.encodeString(I[q]);var F=Z-se%Z,ee=[];return ee.length=F,this.update(ee),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var I=this.blocks,Z=this.lastByteIndex,se=this.blockCount,q=this.s;if(I[Z>>2]|=this.padding[Z&3],this.lastByteIndex===this.byteCount)for(I[0]=I[se],Z=1;Z<se+1;++Z)I[Z]=0;for(I[se-1]|=2147483648,Z=0;Z<se;++Z)q[Z]^=I[Z];he(q)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var I=this.blockCount,Z=this.s,se=this.outputBlocks,q=this.extraBytes,F=0,ee=0,ne="",ae;ee<se;){for(F=0;F<I&&ee<se;++F,++ee)ae=Z[F],ne+=v[ae>>4&15]+v[ae&15]+v[ae>>12&15]+v[ae>>8&15]+v[ae>>20&15]+v[ae>>16&15]+v[ae>>28&15]+v[ae>>24&15];ee%I===0&&(he(Z),F=0)}return q&&(ae=Z[F],ne+=v[ae>>4&15]+v[ae&15],q>1&&(ne+=v[ae>>12&15]+v[ae>>8&15]),q>2&&(ne+=v[ae>>20&15]+v[ae>>16&15])),ne},w.prototype.arrayBuffer=function(){this.finalize();var I=this.blockCount,Z=this.s,se=this.outputBlocks,q=this.extraBytes,F=0,ee=0,ne=this.outputBits>>3,ae;q?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(ne);for(var Ae=new Uint32Array(ae);ee<se;){for(F=0;F<I&&ee<se;++F,++ee)Ae[ee]=Z[F];ee%I===0&&he(Z)}return q&&(Ae[F]=Z[F],ae=ae.slice(0,ne)),ae},w.prototype.buffer=w.prototype.arrayBuffer,w.prototype.digest=w.prototype.array=function(){this.finalize();for(var I=this.blockCount,Z=this.s,se=this.outputBlocks,q=this.extraBytes,F=0,ee=0,ne=[],ae,Ae;ee<se;){for(F=0;F<I&&ee<se;++F,++ee)ae=ee<<2,Ae=Z[F],ne[ae]=Ae&255,ne[ae+1]=Ae>>8&255,ne[ae+2]=Ae>>16&255,ne[ae+3]=Ae>>24&255;ee%I===0&&he(Z)}return q&&(ae=ee<<2,Ae=Z[F],ne[ae]=Ae&255,q>1&&(ne[ae+1]=Ae>>8&255),q>2&&(ne[ae+2]=Ae>>16&255)),ne};function k(I,Z,se){w.call(this,I,Z,se)}o(k,"Kmac"),k.prototype=new w,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),w.prototype.finalize.call(this)};var he=o(function(I){var Z,se,q,F,ee,ne,ae,Ae,ge,re,Se,ce,ve,V,pe,Ce,He,Re,Ve,pr,ue,ie,$,X,me,ye,we,ke,It,Ue,Oe,Bt,je,Je,Tn,nt,it,Yn,ot,et,Xn,st,at,cn,ft,Xe,Zn,ct,ut,Qn,lt,ht,ei,dt,tt,Cn,Ft,qt,un,ln,hn,Nr,dn;for(q=0;q<48;q+=2)F=I[0]^I[10]^I[20]^I[30]^I[40],ee=I[1]^I[11]^I[21]^I[31]^I[41],ne=I[2]^I[12]^I[22]^I[32]^I[42],ae=I[3]^I[13]^I[23]^I[33]^I[43],Ae=I[4]^I[14]^I[24]^I[34]^I[44],ge=I[5]^I[15]^I[25]^I[35]^I[45],re=I[6]^I[16]^I[26]^I[36]^I[46],Se=I[7]^I[17]^I[27]^I[37]^I[47],ce=I[8]^I[18]^I[28]^I[38]^I[48],ve=I[9]^I[19]^I[29]^I[39]^I[49],Z=ce^(ne<<1|ae>>>31),se=ve^(ae<<1|ne>>>31),I[0]^=Z,I[1]^=se,I[10]^=Z,I[11]^=se,I[20]^=Z,I[21]^=se,I[30]^=Z,I[31]^=se,I[40]^=Z,I[41]^=se,Z=F^(Ae<<1|ge>>>31),se=ee^(ge<<1|Ae>>>31),I[2]^=Z,I[3]^=se,I[12]^=Z,I[13]^=se,I[22]^=Z,I[23]^=se,I[32]^=Z,I[33]^=se,I[42]^=Z,I[43]^=se,Z=ne^(re<<1|Se>>>31),se=ae^(Se<<1|re>>>31),I[4]^=Z,I[5]^=se,I[14]^=Z,I[15]^=se,I[24]^=Z,I[25]^=se,I[34]^=Z,I[35]^=se,I[44]^=Z,I[45]^=se,Z=Ae^(ce<<1|ve>>>31),se=ge^(ve<<1|ce>>>31),I[6]^=Z,I[7]^=se,I[16]^=Z,I[17]^=se,I[26]^=Z,I[27]^=se,I[36]^=Z,I[37]^=se,I[46]^=Z,I[47]^=se,Z=re^(F<<1|ee>>>31),se=Se^(ee<<1|F>>>31),I[8]^=Z,I[9]^=se,I[18]^=Z,I[19]^=se,I[28]^=Z,I[29]^=se,I[38]^=Z,I[39]^=se,I[48]^=Z,I[49]^=se,V=I[0],pe=I[1],Xe=I[11]<<4|I[10]>>>28,Zn=I[10]<<4|I[11]>>>28,ke=I[20]<<3|I[21]>>>29,It=I[21]<<3|I[20]>>>29,ln=I[31]<<9|I[30]>>>23,hn=I[30]<<9|I[31]>>>23,st=I[40]<<18|I[41]>>>14,at=I[41]<<18|I[40]>>>14,Je=I[2]<<1|I[3]>>>31,Tn=I[3]<<1|I[2]>>>31,Ce=I[13]<<12|I[12]>>>20,He=I[12]<<12|I[13]>>>20,ct=I[22]<<10|I[23]>>>22,ut=I[23]<<10|I[22]>>>22,Ue=I[33]<<13|I[32]>>>19,Oe=I[32]<<13|I[33]>>>19,Nr=I[42]<<2|I[43]>>>30,dn=I[43]<<2|I[42]>>>30,dt=I[5]<<30|I[4]>>>2,tt=I[4]<<30|I[5]>>>2,nt=I[14]<<6|I[15]>>>26,it=I[15]<<6|I[14]>>>26,Re=I[25]<<11|I[24]>>>21,Ve=I[24]<<11|I[25]>>>21,Qn=I[34]<<15|I[35]>>>17,lt=I[35]<<15|I[34]>>>17,Bt=I[45]<<29|I[44]>>>3,je=I[44]<<29|I[45]>>>3,X=I[6]<<28|I[7]>>>4,me=I[7]<<28|I[6]>>>4,Cn=I[17]<<23|I[16]>>>9,Ft=I[16]<<23|I[17]>>>9,Yn=I[26]<<25|I[27]>>>7,ot=I[27]<<25|I[26]>>>7,pr=I[36]<<21|I[37]>>>11,ue=I[37]<<21|I[36]>>>11,ht=I[47]<<24|I[46]>>>8,ei=I[46]<<24|I[47]>>>8,cn=I[8]<<27|I[9]>>>5,ft=I[9]<<27|I[8]>>>5,ye=I[18]<<20|I[19]>>>12,we=I[19]<<20|I[18]>>>12,qt=I[29]<<7|I[28]>>>25,un=I[28]<<7|I[29]>>>25,et=I[38]<<8|I[39]>>>24,Xn=I[39]<<8|I[38]>>>24,ie=I[48]<<14|I[49]>>>18,$=I[49]<<14|I[48]>>>18,I[0]=V^~Ce&Re,I[1]=pe^~He&Ve,I[10]=X^~ye&ke,I[11]=me^~we&It,I[20]=Je^~nt&Yn,I[21]=Tn^~it&ot,I[30]=cn^~Xe&ct,I[31]=ft^~Zn&ut,I[40]=dt^~Cn&qt,I[41]=tt^~Ft&un,I[2]=Ce^~Re&pr,I[3]=He^~Ve&ue,I[12]=ye^~ke&Ue,I[13]=we^~It&Oe,I[22]=nt^~Yn&et,I[23]=it^~ot&Xn,I[32]=Xe^~ct&Qn,I[33]=Zn^~ut<,I[42]=Cn^~qt&ln,I[43]=Ft^~un&hn,I[4]=Re^~pr&ie,I[5]=Ve^~ue&$,I[14]=ke^~Ue&Bt,I[15]=It^~Oe&je,I[24]=Yn^~et&st,I[25]=ot^~Xn&at,I[34]=ct^~Qn&ht,I[35]=ut^~lt&ei,I[44]=qt^~ln&Nr,I[45]=un^~hn&dn,I[6]=pr^~ie&V,I[7]=ue^~$&pe,I[16]=Ue^~Bt&X,I[17]=Oe^~je&me,I[26]=et^~st&Je,I[27]=Xn^~at&Tn,I[36]=Qn^~ht&cn,I[37]=lt^~ei&ft,I[46]=ln^~Nr&dt,I[47]=hn^~dn&tt,I[8]=ie^~V&Ce,I[9]=$^~pe&He,I[18]=Bt^~X&ye,I[19]=je^~me&we,I[28]=st^~Je&nt,I[29]=at^~Tn&it,I[38]=ht^~cn&Xe,I[39]=ei^~ft&Zn,I[48]=Nr^~dt&Cn,I[49]=dn^~tt&Ft,I[0]^=P[q],I[1]^=P[q+1]},"f");if(c)Uh.exports=l;else{for(_=0;_<p.length;++_)n[p[_]]=l[p[_]];u&&define(function(){return l})}})()});var u3=De((cK,LD)=>{LD.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var qm=De(()=>{});var no=De((l3,Hm)=>{(function(t,e){"use strict";function r(T,h){if(!T)throw new Error(h||"Assertion failed")}o(r,"assert");function n(T,h){T.super_=h;var y=o(function(){},"TempCtor");y.prototype=h.prototype,T.prototype=new y,T.prototype.constructor=T}o(n,"inherits");function i(T,h,y){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((h==="le"||h==="be")&&(y=h,h=10),this._init(T||0,h||10,y||"be"))}o(i,"BN"),typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=qm().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,y){return h.cmp(y)>0?h:y},"max"),i.min=o(function(h,y){return h.cmp(y)<0?h:y},"min"),i.prototype._init=o(function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),r(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(y===16?this._parseHex(h,l,b):(this._parseBase(h,y,l),b==="le"&&this._initArray(this.toArray(),y,b)))},"init"),i.prototype._initNumber=o(function(h,y,b){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):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},"_initNumber"),i.prototype._initArray=o(function(h,y,b){if(r(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 p,_,A=0;if(b==="be")for(l=h.length-1,p=0;l>=0;l-=3)_=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[p]|=_<<A&67108863,this.words[p+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,p++);else if(b==="le")for(l=0,p=0;l<h.length;l+=3)_=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[p]|=_<<A&67108863,this.words[p+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,p++);return this.strip()},"_initArray");function c(T,h){var y=T.charCodeAt(h);return y>=65&&y<=70?y-55:y>=97&&y<=102?y-87:y-48&15}o(c,"parseHex4Bits");function u(T,h,y){var b=c(T,y);return y-1>=h&&(b|=c(T,y-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var p=0,_=0,A;if(b==="be")for(l=h.length-1;l>=y;l-=2)A=u(h,y,l)<<p,this.words[_]|=A&67108863,p>=18?(p-=18,_+=1,this.words[_]|=A>>>26):p+=8;else{var E=h.length-y;for(l=E%2===0?y+1:y;l<h.length;l+=2)A=u(h,y,l)<<p,this.words[_]|=A&67108863,p>=18?(p-=18,_+=1,this.words[_]|=A>>>26):p+=8}this.strip()},"_parseHex");function m(T,h,y,b){for(var l=0,p=Math.min(T.length,y),_=h;_<p;_++){var A=T.charCodeAt(_)-48;l*=b,A>=49?l+=A-49+10:A>=17?l+=A-17+10:l+=A}return l}o(m,"parseBase"),i.prototype._parseBase=o(function(h,y,b){this.words=[0],this.length=1;for(var l=0,p=1;p<=67108863;p*=y)l++;l--,p=p/y|0;for(var _=h.length-b,A=_%l,E=Math.min(_,_-A)+b,g=0,C=b;C<E;C+=l)g=m(h,C,C+l,y),this.imuln(p),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(A!==0){var N=1;for(g=m(h,C,h.length,y),C=0;C<A;C++)N*=y;this.imuln(N),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];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 v=["","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"],x=[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],S=[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,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,p=0,_=0;_<this.length;_++){var A=this.words[_],E=((A<<l|p)&16777215).toString(16);p=A>>>24-l&16777215,p!==0||_!==this.length-1?b=v[6-E.length]+E+b:b=E+b,l+=2,l>=26&&(l-=26,_--)}for(p!==0&&(b=p.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var g=x[h],C=S[h];b="";var N=this.clone();for(N.negative=0;!N.isZero();){var w=N.modn(C).toString(h);N=N.idivn(C),N.isZero()?b=w+b:b=v[g-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!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&&r(!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,y){return r(typeof a<"u"),this.toArrayLike(a,h,y)},"toBuffer"),i.prototype.toArray=o(function(h,y){return this.toArrayLike(Array,h,y)},"toArray"),i.prototype.toArrayLike=o(function(h,y,b){var l=this.byteLength(),p=b||Math.max(1,l);r(l<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var _=y==="le",A=new h(p),E,g,C=this.clone();if(_){for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[g]=E;for(;g<p;g++)A[g]=0}else{for(g=0;g<p-l;g++)A[g]=0;for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[p-g-1]=E}return A},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y},"bitLength");function O(T){for(var h=new Array(T.bitLength()),y=0;y<h.length;y++){var b=y/26|0,l=y%26;h[y]=(T.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==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 y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return r((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 y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return r((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 y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=y.words[l]^b.words[l];if(this!==y)for(;l<y.length;l++)this.words[l]=y.words[l];return this.length=y.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return r((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){r(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var l=0;l<y;l++)this.words[l]=~this.words[l]&67108863;return b>0&&(this.words[l]=~this.words[l]&67108863>>26-b),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,y){r(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<l:this.words[b]=this.words[b]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var p=0,_=0;_<l.length;_++)y=(b.words[_]|0)+(l.words[_]|0)+p,this.words[_]=y&67108863,p=y>>>26;for(;p!==0&&_<b.length;_++)y=(b.words[_]|0)+p,this.words[_]=y&67108863,p=y>>>26;if(this.length=b.length,p!==0)this.words[this.length]=p,this.length++;else if(b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this},"iadd"),i.prototype.add=o(function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):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 y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,p;b>0?(l=this,p=h):(l=h,p=this);for(var _=0,A=0;A<p.length;A++)y=(l.words[A]|0)-(p.words[A]|0)+_,_=y>>26,this.words[A]=y&67108863;for(;_!==0&&A<l.length;A++)y=(l.words[A]|0)+_,_=y>>26,this.words[A]=y&67108863;if(_===0&&A<l.length&&l!==this)for(;A<l.length;A++)this.words[A]=l.words[A];return this.length=Math.max(this.length,A),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(T,h,y){y.negative=h.negative^T.negative;var b=T.length+h.length|0;y.length=b,b=b-1|0;var l=T.words[0]|0,p=h.words[0]|0,_=l*p,A=_&67108863,E=_/67108864|0;y.words[0]=A;for(var g=1;g<b;g++){for(var C=E>>>26,N=E&67108863,w=Math.min(g,h.length-1),k=Math.max(0,g-T.length+1);k<=w;k++){var he=g-k|0;l=T.words[he]|0,p=h.words[k]|0,_=l*p+N,C+=_/67108864|0,N=_&67108863}y.words[g]=N|0,E=C|0}return E!==0?y.words[g]=E|0:y.length--,y.strip()}o(R,"smallMulTo");var D=o(function(h,y,b){var l=h.words,p=y.words,_=b.words,A=0,E,g,C,N=l[0]|0,w=N&8191,k=N>>>13,he=l[1]|0,I=he&8191,Z=he>>>13,se=l[2]|0,q=se&8191,F=se>>>13,ee=l[3]|0,ne=ee&8191,ae=ee>>>13,Ae=l[4]|0,ge=Ae&8191,re=Ae>>>13,Se=l[5]|0,ce=Se&8191,ve=Se>>>13,V=l[6]|0,pe=V&8191,Ce=V>>>13,He=l[7]|0,Re=He&8191,Ve=He>>>13,pr=l[8]|0,ue=pr&8191,ie=pr>>>13,$=l[9]|0,X=$&8191,me=$>>>13,ye=p[0]|0,we=ye&8191,ke=ye>>>13,It=p[1]|0,Ue=It&8191,Oe=It>>>13,Bt=p[2]|0,je=Bt&8191,Je=Bt>>>13,Tn=p[3]|0,nt=Tn&8191,it=Tn>>>13,Yn=p[4]|0,ot=Yn&8191,et=Yn>>>13,Xn=p[5]|0,st=Xn&8191,at=Xn>>>13,cn=p[6]|0,ft=cn&8191,Xe=cn>>>13,Zn=p[7]|0,ct=Zn&8191,ut=Zn>>>13,Qn=p[8]|0,lt=Qn&8191,ht=Qn>>>13,ei=p[9]|0,dt=ei&8191,tt=ei>>>13;b.negative=h.negative^y.negative,b.length=19,E=Math.imul(w,we),g=Math.imul(w,ke),g=g+Math.imul(k,we)|0,C=Math.imul(k,ke);var Cn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,E=Math.imul(I,we),g=Math.imul(I,ke),g=g+Math.imul(Z,we)|0,C=Math.imul(Z,ke),E=E+Math.imul(w,Ue)|0,g=g+Math.imul(w,Oe)|0,g=g+Math.imul(k,Ue)|0,C=C+Math.imul(k,Oe)|0;var Ft=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,E=Math.imul(q,we),g=Math.imul(q,ke),g=g+Math.imul(F,we)|0,C=Math.imul(F,ke),E=E+Math.imul(I,Ue)|0,g=g+Math.imul(I,Oe)|0,g=g+Math.imul(Z,Ue)|0,C=C+Math.imul(Z,Oe)|0,E=E+Math.imul(w,je)|0,g=g+Math.imul(w,Je)|0,g=g+Math.imul(k,je)|0,C=C+Math.imul(k,Je)|0;var qt=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(qt>>>26)|0,qt&=67108863,E=Math.imul(ne,we),g=Math.imul(ne,ke),g=g+Math.imul(ae,we)|0,C=Math.imul(ae,ke),E=E+Math.imul(q,Ue)|0,g=g+Math.imul(q,Oe)|0,g=g+Math.imul(F,Ue)|0,C=C+Math.imul(F,Oe)|0,E=E+Math.imul(I,je)|0,g=g+Math.imul(I,Je)|0,g=g+Math.imul(Z,je)|0,C=C+Math.imul(Z,Je)|0,E=E+Math.imul(w,nt)|0,g=g+Math.imul(w,it)|0,g=g+Math.imul(k,nt)|0,C=C+Math.imul(k,it)|0;var un=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(un>>>26)|0,un&=67108863,E=Math.imul(ge,we),g=Math.imul(ge,ke),g=g+Math.imul(re,we)|0,C=Math.imul(re,ke),E=E+Math.imul(ne,Ue)|0,g=g+Math.imul(ne,Oe)|0,g=g+Math.imul(ae,Ue)|0,C=C+Math.imul(ae,Oe)|0,E=E+Math.imul(q,je)|0,g=g+Math.imul(q,Je)|0,g=g+Math.imul(F,je)|0,C=C+Math.imul(F,Je)|0,E=E+Math.imul(I,nt)|0,g=g+Math.imul(I,it)|0,g=g+Math.imul(Z,nt)|0,C=C+Math.imul(Z,it)|0,E=E+Math.imul(w,ot)|0,g=g+Math.imul(w,et)|0,g=g+Math.imul(k,ot)|0,C=C+Math.imul(k,et)|0;var ln=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ln>>>26)|0,ln&=67108863,E=Math.imul(ce,we),g=Math.imul(ce,ke),g=g+Math.imul(ve,we)|0,C=Math.imul(ve,ke),E=E+Math.imul(ge,Ue)|0,g=g+Math.imul(ge,Oe)|0,g=g+Math.imul(re,Ue)|0,C=C+Math.imul(re,Oe)|0,E=E+Math.imul(ne,je)|0,g=g+Math.imul(ne,Je)|0,g=g+Math.imul(ae,je)|0,C=C+Math.imul(ae,Je)|0,E=E+Math.imul(q,nt)|0,g=g+Math.imul(q,it)|0,g=g+Math.imul(F,nt)|0,C=C+Math.imul(F,it)|0,E=E+Math.imul(I,ot)|0,g=g+Math.imul(I,et)|0,g=g+Math.imul(Z,ot)|0,C=C+Math.imul(Z,et)|0,E=E+Math.imul(w,st)|0,g=g+Math.imul(w,at)|0,g=g+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var hn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(hn>>>26)|0,hn&=67108863,E=Math.imul(pe,we),g=Math.imul(pe,ke),g=g+Math.imul(Ce,we)|0,C=Math.imul(Ce,ke),E=E+Math.imul(ce,Ue)|0,g=g+Math.imul(ce,Oe)|0,g=g+Math.imul(ve,Ue)|0,C=C+Math.imul(ve,Oe)|0,E=E+Math.imul(ge,je)|0,g=g+Math.imul(ge,Je)|0,g=g+Math.imul(re,je)|0,C=C+Math.imul(re,Je)|0,E=E+Math.imul(ne,nt)|0,g=g+Math.imul(ne,it)|0,g=g+Math.imul(ae,nt)|0,C=C+Math.imul(ae,it)|0,E=E+Math.imul(q,ot)|0,g=g+Math.imul(q,et)|0,g=g+Math.imul(F,ot)|0,C=C+Math.imul(F,et)|0,E=E+Math.imul(I,st)|0,g=g+Math.imul(I,at)|0,g=g+Math.imul(Z,st)|0,C=C+Math.imul(Z,at)|0,E=E+Math.imul(w,ft)|0,g=g+Math.imul(w,Xe)|0,g=g+Math.imul(k,ft)|0,C=C+Math.imul(k,Xe)|0;var Nr=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,E=Math.imul(Re,we),g=Math.imul(Re,ke),g=g+Math.imul(Ve,we)|0,C=Math.imul(Ve,ke),E=E+Math.imul(pe,Ue)|0,g=g+Math.imul(pe,Oe)|0,g=g+Math.imul(Ce,Ue)|0,C=C+Math.imul(Ce,Oe)|0,E=E+Math.imul(ce,je)|0,g=g+Math.imul(ce,Je)|0,g=g+Math.imul(ve,je)|0,C=C+Math.imul(ve,Je)|0,E=E+Math.imul(ge,nt)|0,g=g+Math.imul(ge,it)|0,g=g+Math.imul(re,nt)|0,C=C+Math.imul(re,it)|0,E=E+Math.imul(ne,ot)|0,g=g+Math.imul(ne,et)|0,g=g+Math.imul(ae,ot)|0,C=C+Math.imul(ae,et)|0,E=E+Math.imul(q,st)|0,g=g+Math.imul(q,at)|0,g=g+Math.imul(F,st)|0,C=C+Math.imul(F,at)|0,E=E+Math.imul(I,ft)|0,g=g+Math.imul(I,Xe)|0,g=g+Math.imul(Z,ft)|0,C=C+Math.imul(Z,Xe)|0,E=E+Math.imul(w,ct)|0,g=g+Math.imul(w,ut)|0,g=g+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var dn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(dn>>>26)|0,dn&=67108863,E=Math.imul(ue,we),g=Math.imul(ue,ke),g=g+Math.imul(ie,we)|0,C=Math.imul(ie,ke),E=E+Math.imul(Re,Ue)|0,g=g+Math.imul(Re,Oe)|0,g=g+Math.imul(Ve,Ue)|0,C=C+Math.imul(Ve,Oe)|0,E=E+Math.imul(pe,je)|0,g=g+Math.imul(pe,Je)|0,g=g+Math.imul(Ce,je)|0,C=C+Math.imul(Ce,Je)|0,E=E+Math.imul(ce,nt)|0,g=g+Math.imul(ce,it)|0,g=g+Math.imul(ve,nt)|0,C=C+Math.imul(ve,it)|0,E=E+Math.imul(ge,ot)|0,g=g+Math.imul(ge,et)|0,g=g+Math.imul(re,ot)|0,C=C+Math.imul(re,et)|0,E=E+Math.imul(ne,st)|0,g=g+Math.imul(ne,at)|0,g=g+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,E=E+Math.imul(q,ft)|0,g=g+Math.imul(q,Xe)|0,g=g+Math.imul(F,ft)|0,C=C+Math.imul(F,Xe)|0,E=E+Math.imul(I,ct)|0,g=g+Math.imul(I,ut)|0,g=g+Math.imul(Z,ct)|0,C=C+Math.imul(Z,ut)|0,E=E+Math.imul(w,lt)|0,g=g+Math.imul(w,ht)|0,g=g+Math.imul(k,lt)|0,C=C+Math.imul(k,ht)|0;var ti=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ti>>>26)|0,ti&=67108863,E=Math.imul(X,we),g=Math.imul(X,ke),g=g+Math.imul(me,we)|0,C=Math.imul(me,ke),E=E+Math.imul(ue,Ue)|0,g=g+Math.imul(ue,Oe)|0,g=g+Math.imul(ie,Ue)|0,C=C+Math.imul(ie,Oe)|0,E=E+Math.imul(Re,je)|0,g=g+Math.imul(Re,Je)|0,g=g+Math.imul(Ve,je)|0,C=C+Math.imul(Ve,Je)|0,E=E+Math.imul(pe,nt)|0,g=g+Math.imul(pe,it)|0,g=g+Math.imul(Ce,nt)|0,C=C+Math.imul(Ce,it)|0,E=E+Math.imul(ce,ot)|0,g=g+Math.imul(ce,et)|0,g=g+Math.imul(ve,ot)|0,C=C+Math.imul(ve,et)|0,E=E+Math.imul(ge,st)|0,g=g+Math.imul(ge,at)|0,g=g+Math.imul(re,st)|0,C=C+Math.imul(re,at)|0,E=E+Math.imul(ne,ft)|0,g=g+Math.imul(ne,Xe)|0,g=g+Math.imul(ae,ft)|0,C=C+Math.imul(ae,Xe)|0,E=E+Math.imul(q,ct)|0,g=g+Math.imul(q,ut)|0,g=g+Math.imul(F,ct)|0,C=C+Math.imul(F,ut)|0,E=E+Math.imul(I,lt)|0,g=g+Math.imul(I,ht)|0,g=g+Math.imul(Z,lt)|0,C=C+Math.imul(Z,ht)|0,E=E+Math.imul(w,dt)|0,g=g+Math.imul(w,tt)|0,g=g+Math.imul(k,dt)|0,C=C+Math.imul(k,tt)|0;var Ao=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,E=Math.imul(X,Ue),g=Math.imul(X,Oe),g=g+Math.imul(me,Ue)|0,C=Math.imul(me,Oe),E=E+Math.imul(ue,je)|0,g=g+Math.imul(ue,Je)|0,g=g+Math.imul(ie,je)|0,C=C+Math.imul(ie,Je)|0,E=E+Math.imul(Re,nt)|0,g=g+Math.imul(Re,it)|0,g=g+Math.imul(Ve,nt)|0,C=C+Math.imul(Ve,it)|0,E=E+Math.imul(pe,ot)|0,g=g+Math.imul(pe,et)|0,g=g+Math.imul(Ce,ot)|0,C=C+Math.imul(Ce,et)|0,E=E+Math.imul(ce,st)|0,g=g+Math.imul(ce,at)|0,g=g+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,E=E+Math.imul(ge,ft)|0,g=g+Math.imul(ge,Xe)|0,g=g+Math.imul(re,ft)|0,C=C+Math.imul(re,Xe)|0,E=E+Math.imul(ne,ct)|0,g=g+Math.imul(ne,ut)|0,g=g+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,E=E+Math.imul(q,lt)|0,g=g+Math.imul(q,ht)|0,g=g+Math.imul(F,lt)|0,C=C+Math.imul(F,ht)|0,E=E+Math.imul(I,dt)|0,g=g+Math.imul(I,tt)|0,g=g+Math.imul(Z,dt)|0,C=C+Math.imul(Z,tt)|0;var So=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(So>>>26)|0,So&=67108863,E=Math.imul(X,je),g=Math.imul(X,Je),g=g+Math.imul(me,je)|0,C=Math.imul(me,Je),E=E+Math.imul(ue,nt)|0,g=g+Math.imul(ue,it)|0,g=g+Math.imul(ie,nt)|0,C=C+Math.imul(ie,it)|0,E=E+Math.imul(Re,ot)|0,g=g+Math.imul(Re,et)|0,g=g+Math.imul(Ve,ot)|0,C=C+Math.imul(Ve,et)|0,E=E+Math.imul(pe,st)|0,g=g+Math.imul(pe,at)|0,g=g+Math.imul(Ce,st)|0,C=C+Math.imul(Ce,at)|0,E=E+Math.imul(ce,ft)|0,g=g+Math.imul(ce,Xe)|0,g=g+Math.imul(ve,ft)|0,C=C+Math.imul(ve,Xe)|0,E=E+Math.imul(ge,ct)|0,g=g+Math.imul(ge,ut)|0,g=g+Math.imul(re,ct)|0,C=C+Math.imul(re,ut)|0,E=E+Math.imul(ne,lt)|0,g=g+Math.imul(ne,ht)|0,g=g+Math.imul(ae,lt)|0,C=C+Math.imul(ae,ht)|0,E=E+Math.imul(q,dt)|0,g=g+Math.imul(q,tt)|0,g=g+Math.imul(F,dt)|0,C=C+Math.imul(F,tt)|0;var Mo=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,E=Math.imul(X,nt),g=Math.imul(X,it),g=g+Math.imul(me,nt)|0,C=Math.imul(me,it),E=E+Math.imul(ue,ot)|0,g=g+Math.imul(ue,et)|0,g=g+Math.imul(ie,ot)|0,C=C+Math.imul(ie,et)|0,E=E+Math.imul(Re,st)|0,g=g+Math.imul(Re,at)|0,g=g+Math.imul(Ve,st)|0,C=C+Math.imul(Ve,at)|0,E=E+Math.imul(pe,ft)|0,g=g+Math.imul(pe,Xe)|0,g=g+Math.imul(Ce,ft)|0,C=C+Math.imul(Ce,Xe)|0,E=E+Math.imul(ce,ct)|0,g=g+Math.imul(ce,ut)|0,g=g+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,E=E+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ht)|0,g=g+Math.imul(re,lt)|0,C=C+Math.imul(re,ht)|0,E=E+Math.imul(ne,dt)|0,g=g+Math.imul(ne,tt)|0,g=g+Math.imul(ae,dt)|0,C=C+Math.imul(ae,tt)|0;var Xi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,E=Math.imul(X,ot),g=Math.imul(X,et),g=g+Math.imul(me,ot)|0,C=Math.imul(me,et),E=E+Math.imul(ue,st)|0,g=g+Math.imul(ue,at)|0,g=g+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,E=E+Math.imul(Re,ft)|0,g=g+Math.imul(Re,Xe)|0,g=g+Math.imul(Ve,ft)|0,C=C+Math.imul(Ve,Xe)|0,E=E+Math.imul(pe,ct)|0,g=g+Math.imul(pe,ut)|0,g=g+Math.imul(Ce,ct)|0,C=C+Math.imul(Ce,ut)|0,E=E+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ht)|0,g=g+Math.imul(ve,lt)|0,C=C+Math.imul(ve,ht)|0,E=E+Math.imul(ge,dt)|0,g=g+Math.imul(ge,tt)|0,g=g+Math.imul(re,dt)|0,C=C+Math.imul(re,tt)|0;var Zi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,E=Math.imul(X,st),g=Math.imul(X,at),g=g+Math.imul(me,st)|0,C=Math.imul(me,at),E=E+Math.imul(ue,ft)|0,g=g+Math.imul(ue,Xe)|0,g=g+Math.imul(ie,ft)|0,C=C+Math.imul(ie,Xe)|0,E=E+Math.imul(Re,ct)|0,g=g+Math.imul(Re,ut)|0,g=g+Math.imul(Ve,ct)|0,C=C+Math.imul(Ve,ut)|0,E=E+Math.imul(pe,lt)|0,g=g+Math.imul(pe,ht)|0,g=g+Math.imul(Ce,lt)|0,C=C+Math.imul(Ce,ht)|0,E=E+Math.imul(ce,dt)|0,g=g+Math.imul(ce,tt)|0,g=g+Math.imul(ve,dt)|0,C=C+Math.imul(ve,tt)|0;var Qi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,E=Math.imul(X,ft),g=Math.imul(X,Xe),g=g+Math.imul(me,ft)|0,C=Math.imul(me,Xe),E=E+Math.imul(ue,ct)|0,g=g+Math.imul(ue,ut)|0,g=g+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,E=E+Math.imul(Re,lt)|0,g=g+Math.imul(Re,ht)|0,g=g+Math.imul(Ve,lt)|0,C=C+Math.imul(Ve,ht)|0,E=E+Math.imul(pe,dt)|0,g=g+Math.imul(pe,tt)|0,g=g+Math.imul(Ce,dt)|0,C=C+Math.imul(Ce,tt)|0;var To=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(To>>>26)|0,To&=67108863,E=Math.imul(X,ct),g=Math.imul(X,ut),g=g+Math.imul(me,ct)|0,C=Math.imul(me,ut),E=E+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ht)|0,g=g+Math.imul(ie,lt)|0,C=C+Math.imul(ie,ht)|0,E=E+Math.imul(Re,dt)|0,g=g+Math.imul(Re,tt)|0,g=g+Math.imul(Ve,dt)|0,C=C+Math.imul(Ve,tt)|0;var Co=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Co>>>26)|0,Co&=67108863,E=Math.imul(X,lt),g=Math.imul(X,ht),g=g+Math.imul(me,lt)|0,C=Math.imul(me,ht),E=E+Math.imul(ue,dt)|0,g=g+Math.imul(ue,tt)|0,g=g+Math.imul(ie,dt)|0,C=C+Math.imul(ie,tt)|0;var ko=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ko>>>26)|0,ko&=67108863,E=Math.imul(X,dt),g=Math.imul(X,tt),g=g+Math.imul(me,dt)|0,C=Math.imul(me,tt);var Io=(A+E|0)+((g&8191)<<13)|0;return A=(C+(g>>>13)|0)+(Io>>>26)|0,Io&=67108863,_[0]=Cn,_[1]=Ft,_[2]=qt,_[3]=un,_[4]=ln,_[5]=hn,_[6]=Nr,_[7]=dn,_[8]=ti,_[9]=Ao,_[10]=So,_[11]=Mo,_[12]=Xi,_[13]=Zi,_[14]=Qi,_[15]=To,_[16]=Co,_[17]=ko,_[18]=Io,A!==0&&(_[19]=A,b.length++),b},"comb10MulTo");Math.imul||(D=R);function P(T,h,y){y.negative=h.negative^T.negative,y.length=T.length+h.length;for(var b=0,l=0,p=0;p<y.length-1;p++){var _=l;l=0;for(var A=b&67108863,E=Math.min(p,h.length-1),g=Math.max(0,p-T.length+1);g<=E;g++){var C=p-g,N=T.words[C]|0,w=h.words[g]|0,k=N*w,he=k&67108863;_=_+(k/67108864|0)|0,he=he+A|0,A=he&67108863,_=_+(he>>>26)|0,l+=_>>>26,_&=67108863}y.words[p]=A,b=_,_=l}return b!==0?y.words[p]=b:y.length--,y.strip()}o(P,"bigMulTo");function J(T,h,y){var b=new L;return b.mulp(T,h,y)}o(J,"jumboMulTo"),i.prototype.mulTo=o(function(h,y){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=D(this,h,y):l<63?b=R(this,h,y):l<1024?b=P(this,h,y):b=J(this,h,y),b},"mulTo");function L(T,h){this.x=T,this.y=h}o(L,"FFTM"),L.prototype.makeRBT=o(function(h){for(var y=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)y[l]=this.revBin(l,b,h);return y},"makeRBT"),L.prototype.revBin=o(function(h,y,b){if(h===0||h===b-1)return h;for(var l=0,p=0;p<y;p++)l|=(h&1)<<y-p-1,h>>=1;return l},"revBin"),L.prototype.permute=o(function(h,y,b,l,p,_){for(var A=0;A<_;A++)l[A]=y[h[A]],p[A]=b[h[A]]},"permute"),L.prototype.transform=o(function(h,y,b,l,p,_){this.permute(_,h,y,b,l,p);for(var A=1;A<p;A<<=1)for(var E=A<<1,g=Math.cos(2*Math.PI/E),C=Math.sin(2*Math.PI/E),N=0;N<p;N+=E)for(var w=g,k=C,he=0;he<A;he++){var I=b[N+he],Z=l[N+he],se=b[N+he+A],q=l[N+he+A],F=w*se-k*q;q=w*q+k*se,se=F,b[N+he]=I+se,l[N+he]=Z+q,b[N+he+A]=I-se,l[N+he+A]=Z-q,he!==E&&(F=g*w-C*k,k=g*k+C*w,w=F)}},"transform"),L.prototype.guessLen13b=o(function(h,y){var b=Math.max(y,h)|1,l=b&1,p=0;for(b=b/2|0;b;b=b>>>1)p++;return 1<<p+1+l},"guessLen13b"),L.prototype.conjugate=o(function(h,y,b){if(!(b<=1))for(var l=0;l<b/2;l++){var p=h[l];h[l]=h[b-l-1],h[b-l-1]=p,p=y[l],y[l]=-y[b-l-1],y[b-l-1]=-p}},"conjugate"),L.prototype.normalize13b=o(function(h,y){for(var b=0,l=0;l<y/2;l++){var p=Math.round(h[2*l+1]/y)*8192+Math.round(h[2*l]/y)+b;h[l]=p&67108863,p<67108864?b=0:b=p/67108864|0}return h},"normalize13b"),L.prototype.convert13b=o(function(h,y,b,l){for(var p=0,_=0;_<y;_++)p=p+(h[_]|0),b[2*_]=p&8191,p=p>>>13,b[2*_+1]=p&8191,p=p>>>13;for(_=2*y;_<l;++_)b[_]=0;r(p===0),r((p&-8192)===0)},"convert13b"),L.prototype.stub=o(function(h){for(var y=new Array(h),b=0;b<h;b++)y[b]=0;return y},"stub"),L.prototype.mulp=o(function(h,y,b){var l=2*this.guessLen13b(h.length,y.length),p=this.makeRBT(l),_=this.stub(l),A=new Array(l),E=new Array(l),g=new Array(l),C=new Array(l),N=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,A,l),this.convert13b(y.words,y.length,C,l),this.transform(A,_,E,g,l,p),this.transform(C,_,N,w,l,p);for(var he=0;he<l;he++){var I=E[he]*N[he]-g[he]*w[he];g[he]=E[he]*w[he]+g[he]*N[he],E[he]=I}return this.conjugate(E,g,l),this.transform(E,g,k,_,l,p),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var y=new i(null);return y.words=new Array(this.length+h.length),this.mulTo(h,y)},"mul"),i.prototype.mulf=o(function(h){var y=new i(null);return y.words=new Array(this.length+h.length),J(this,h,y)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){r(typeof h=="number"),r(h<67108864);for(var y=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,p=(l&67108863)+(y&67108863);y>>=26,y+=l/67108864|0,y+=p>>>26,this.words[b]=p&67108863}return y!==0&&(this.words[b]=y,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 y=O(h);if(y.length===0)return new i(1);for(var b=this,l=0;l<y.length&&y[l]===0;l++,b=b.sqr());if(++l<y.length)for(var p=b.sqr();l<y.length;l++,p=p.sqr())y[l]!==0&&(b=b.mul(p));return b},"pow"),i.prototype.iushln=o(function(h){r(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,l=67108863>>>26-y<<26-y,p;if(y!==0){var _=0;for(p=0;p<this.length;p++){var A=this.words[p]&l,E=(this.words[p]|0)-A<<y;this.words[p]=E|_,_=A>>>26-y}_&&(this.words[p]=_,this.length++)}if(b!==0){for(p=this.length-1;p>=0;p--)this.words[p+b]=this.words[p];for(p=0;p<b;p++)this.words[p]=0;this.length+=b}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return r(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,y,b){r(typeof h=="number"&&h>=0);var l;y?l=(y-y%26)/26:l=0;var p=h%26,_=Math.min((h-p)/26,this.length),A=67108863^67108863>>>p<<p,E=b;if(l-=_,l=Math.max(0,l),E){for(var g=0;g<_;g++)E.words[g]=this.words[g];E.length=_}if(_!==0)if(this.length>_)for(this.length-=_,g=0;g<this.length;g++)this.words[g]=this.words[g+_];else this.words[0]=0,this.length=1;var C=0;for(g=this.length-1;g>=0&&(C!==0||g>=l);g--){var N=this.words[g]|0;this.words[g]=C<<26-p|N>>>p,C=N&A}return E&&C!==0&&(E.words[E.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,y,b){return r(this.negative===0),this.iushrn(h,y,b)},"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){r(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,l=1<<y;if(this.length<=b)return!1;var p=this.words[b];return!!(p&l)},"testn"),i.prototype.imaskn=o(function(h){r(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var l=67108863^67108863>>>y<<y;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 r(typeof h=="number"),r(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 y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},"_iaddn"),i.prototype.isubn=o(function(h){if(r(typeof h=="number"),r(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 y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+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,y,b){var l=h.length+b,p;this._expand(l);var _,A=0;for(p=0;p<h.length;p++){_=(this.words[p+b]|0)+A;var E=(h.words[p]|0)*y;_-=E&67108863,A=(_>>26)-(E/67108864|0),this.words[p+b]=_&67108863}for(;p<this.length-b;p++)_=(this.words[p+b]|0)+A,A=_>>26,this.words[p+b]=_&67108863;if(A===0)return this.strip();for(r(A===-1),A=0,p=0;p<this.length;p++)_=-(this.words[p]|0)+A,A=_>>26,this.words[p]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,y){var b=this.length-h.length,l=this.clone(),p=h,_=p.words[p.length-1]|0,A=this._countBits(_);b=26-A,b!==0&&(p=p.ushln(b),l.iushln(b),_=p.words[p.length-1]|0);var E=l.length-p.length,g;if(y!=="mod"){g=new i(null),g.length=E+1,g.words=new Array(g.length);for(var C=0;C<g.length;C++)g.words[C]=0}var N=l.clone()._ishlnsubmul(p,1,E);N.negative===0&&(l=N,g&&(g.words[E]=1));for(var w=E-1;w>=0;w--){var k=(l.words[p.length+w]|0)*67108864+(l.words[p.length+w-1]|0);for(k=Math.min(k/_|0,67108863),l._ishlnsubmul(p,k,w);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(p,1,w),l.isZero()||(l.negative^=1);g&&(g.words[w]=k)}return g&&g.strip(),l.strip(),y!=="div"&&b!==0&&l.iushrn(b),{div:g||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,y,b){if(r(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,p,_;return this.negative!==0&&h.negative===0?(_=this.neg().divmod(h,y),y!=="mod"&&(l=_.div.neg()),y!=="div"&&(p=_.mod.neg(),b&&p.negative!==0&&p.iadd(h)),{div:l,mod:p}):this.negative===0&&h.negative!==0?(_=this.divmod(h.neg(),y),y!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),y),y!=="div"&&(p=_.mod.neg(),b&&p.negative!==0&&p.isub(h)),{div:_.div,mod:p}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="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,y)},"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 y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,l=h.ushrn(1),p=h.andln(1),_=b.cmp(l);return _<0||p===1&&_===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){r(h<=67108863);for(var y=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(y*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){r(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+y*67108864;this.words[b]=l/h|0,y=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){r(h.negative===0),r(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var l=new i(1),p=new i(0),_=new i(0),A=new i(1),E=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++E;for(var g=b.clone(),C=y.clone();!y.isZero();){for(var N=0,w=1;(y.words[0]&w)===0&&N<26;++N,w<<=1);if(N>0)for(y.iushrn(N);N-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(g),p.isub(C)),l.iushrn(1),p.iushrn(1);for(var k=0,he=1;(b.words[0]&he)===0&&k<26;++k,he<<=1);if(k>0)for(b.iushrn(k);k-- >0;)(_.isOdd()||A.isOdd())&&(_.iadd(g),A.isub(C)),_.iushrn(1),A.iushrn(1);y.cmp(b)>=0?(y.isub(b),l.isub(_),p.isub(A)):(b.isub(y),_.isub(l),A.isub(p))}return{a:_,b:A,gcd:b.iushln(E)}},"egcd"),i.prototype._invmp=o(function(h){r(h.negative===0),r(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var l=new i(1),p=new i(0),_=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var A=0,E=1;(y.words[0]&E)===0&&A<26;++A,E<<=1);if(A>0)for(y.iushrn(A);A-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var g=0,C=1;(b.words[0]&C)===0&&g<26;++g,C<<=1);if(g>0)for(b.iushrn(g);g-- >0;)p.isOdd()&&p.iadd(_),p.iushrn(1);y.cmp(b)>=0?(y.isub(b),l.isub(p)):(b.isub(y),p.isub(l))}var N;return y.cmpn(1)===0?N=l:N=p,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 y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var l=0;y.isEven()&&b.isEven();l++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var p=y.cmp(b);if(p<0){var _=y;y=b,b=_}else if(p===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.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){r(typeof h=="number");var y=h%26,b=(h-y)/26,l=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var p=l,_=b;p!==0&&_<this.length;_++){var A=this.words[_]|0;A+=p,p=A>>>26,A&=67108863,this.words[_]=A}return p!==0&&(this.words[_]=p,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 y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),r(h<=67108863,"Number is too big");var l=this.words[0]|0;b=l===h?0:l<h?-1:1}return this.negative!==0?-b|0:b},"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 y=this.ucmp(h);return this.negative!==0?-y|0:y},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,p=h.words[b]|0;if(l!==p){l<p?y=-1:l>p&&(y=1);break}}return y},"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 G(h)},"red"),i.prototype.toRed=o(function(h){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"toRed"),i.prototype.fromRed=o(function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return r(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 r(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 r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(h){return r(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var W={k256:null,p224:null,p192:null,p25519:null};function Q(T,h){this.name=T,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(Q,"MPrime"),Q.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),Q.prototype.ireduce=o(function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var l=b<this.n?-1:y.ucmp(this.p);return l===0?(y.words[0]=0,y.length=1):l>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},"ireduce"),Q.prototype.split=o(function(h,y){h.iushrn(this.n,0,y)},"split"),Q.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Y(){Q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Y,"K256"),n(Y,Q),Y.prototype.split=o(function(h,y){for(var b=4194303,l=Math.min(h.length,9),p=0;p<l;p++)y.words[p]=h.words[p];if(y.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(y.words[y.length++]=_&b,p=10;p<h.length;p++){var A=h.words[p]|0;h.words[p-10]=(A&b)<<4|_>>>22,_=A}_>>>=22,h.words[p-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},"split"),Y.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var l=h.words[b]|0;y+=l*977,h.words[b]=y&67108863,y=l*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function oe(){Q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(oe,"P224"),n(oe,Q);function j(){Q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(j,"P192"),n(j,Q);function H(){Q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(H,"P25519"),n(H,Q),H.prototype.imulK=o(function(h){for(var y=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+y,p=l&67108863;l>>>=26,h.words[b]=p,y=l}return y!==0&&(h.words[h.length++]=y),h},"imulK"),i._prime=o(function(h){if(W[h])return W[h];var y;if(h==="k256")y=new Y;else if(h==="p224")y=new oe;else if(h==="p192")y=new j;else if(h==="p25519")y=new H;else throw new Error("Unknown prime "+h);return W[h]=y,y},"prime");function G(T){if(typeof T=="string"){var h=i._prime(T);this.m=h.p,this.prime=h}else r(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}o(G,"Red"),G.prototype._verify1=o(function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},"_verify1"),G.prototype._verify2=o(function(h,y){r((h.negative|y.negative)===0,"red works only with positives"),r(h.red&&h.red===y.red,"red works only with red numbers")},"_verify2"),G.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),G.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),G.prototype.add=o(function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),G.prototype.iadd=o(function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),G.prototype.sub=o(function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),G.prototype.isub=o(function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),G.prototype.shl=o(function(h,y){return this._verify1(h),this.imod(h.ushln(y))},"shl"),G.prototype.imul=o(function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},"imul"),G.prototype.mul=o(function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},"mul"),G.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),G.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),G.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(r(y%2===1),y===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var l=this.m.subn(1),p=0;!l.isZero()&&l.andln(1)===0;)p++,l.iushrn(1);r(!l.isZero());var _=new i(1).toRed(this),A=_.redNeg(),E=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new i(2*g*g).toRed(this);this.pow(g,E).cmp(A)!==0;)g.redIAdd(A);for(var C=this.pow(g,l),N=this.pow(h,l.addn(1).iushrn(1)),w=this.pow(h,l),k=p;w.cmp(_)!==0;){for(var he=w,I=0;he.cmp(_)!==0;I++)he=he.redSqr();r(I<k);var Z=this.pow(C,new i(1).iushln(k-I-1));N=N.redMul(Z),C=Z.redSqr(),w=w.redMul(C),k=I}return N},"sqrt"),G.prototype.invm=o(function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},"invm"),G.prototype.pow=o(function(h,y){if(y.isZero())return new i(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,l=new Array(1<<b);l[0]=new i(1).toRed(this),l[1]=h;for(var p=2;p<l.length;p++)l[p]=this.mul(l[p-1],h);var _=l[0],A=0,E=0,g=y.bitLength()%26;for(g===0&&(g=26),p=y.length-1;p>=0;p--){for(var C=y.words[p],N=g-1;N>=0;N--){var w=C>>N&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&A===0){E=0;continue}A<<=1,A|=w,E++,!(E!==b&&(p!==0||N!==0))&&(_=this.mul(_,l[A]),E=0,A=0)}g=26}return _},"pow"),G.prototype.convertTo=o(function(h){var y=h.umod(this.m);return y===h?y.clone():y},"convertTo"),G.prototype.convertFrom=o(function(h){var y=h.clone();return y.red=null,y},"convertFrom"),i.mont=o(function(h){return new le(h)},"mont");function le(T){G.call(this,T),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(le,"Mont"),n(le,G),le.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),le.prototype.convertFrom=o(function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},"convertFrom"),le.prototype.imul=o(function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=b.isub(l).iushrn(this.shift),_=p;return p.cmp(this.m)>=0?_=p.isub(this.m):p.cmpn(0)<0&&(_=p.iadd(this.m)),_._forceRed(this)},"imul"),le.prototype.mul=o(function(h,y){if(h.isZero()||y.isZero())return new i(0)._forceRed(this);var b=h.mul(y),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=b.isub(l).iushrn(this.shift),_=p;return p.cmp(this.m)>=0?_=p.isub(this.m):p.cmpn(0)<0&&(_=p.iadd(this.m)),_._forceRed(this)},"mul"),le.prototype.invm=o(function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)},"invm")})(typeof Hm>"u"||Hm,l3)});var Ts=De((hK,d3)=>{d3.exports=h3;function h3(t,e){if(!t)throw new Error(e||"Assertion failed")}o(h3,"assert");h3.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual")});var zm=De(b3=>{"use strict";var $h=b3;function BD(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t!="string"){for(var n=0;n<t.length;n++)r[n]=t[n]|0;return r}if(e==="hex"){t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),a=i>>8,c=i&255;a?r.push(a,c):r.push(c)}return r}o(BD,"toArray");$h.toArray=BD;function p3(t){return t.length===1?"0"+t:t}o(p3,"zero2");$h.zero2=p3;function m3(t){for(var e="",r=0;r<t.length;r++)e+=p3(t[r].toString(16));return e}o(m3,"toHex");$h.toHex=m3;$h.encode=o(function(e,r){return r==="hex"?m3(e):e},"encode")});var Ln=De(g3=>{"use strict";var Li=g3,UD=no(),$D=Ts(),Fh=zm();Li.assert=$D;Li.toArray=Fh.toArray;Li.zero2=Fh.zero2;Li.toHex=Fh.toHex;Li.encode=Fh.encode;function FD(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,a=t.clone(),c=0;c<n.length;c++){var u,m=a.andln(i-1);a.isOdd()?(m>(i>>1)-1?u=(i>>1)-m:u=m,a.isubn(u)):u=0,n[c]=u,a.iushrn(1)}return n}o(FD,"getNAF");Li.getNAF=FD;function qD(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0,a;t.cmpn(-n)>0||e.cmpn(-i)>0;){var c=t.andln(3)+n&3,u=e.andln(3)+i&3;c===3&&(c=-1),u===3&&(u=-1);var m;(c&1)===0?m=0:(a=t.andln(7)+n&7,(a===3||a===5)&&u===2?m=-c:m=c),r[0].push(m);var v;(u&1)===0?v=0:(a=e.andln(7)+i&7,(a===3||a===5)&&c===2?v=-u:v=u),r[1].push(v),2*n===m+1&&(n=1-n),2*i===v+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}o(qD,"getJSF");Li.getJSF=qD;function HD(t,e,r){var n="_"+e;t.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)},"cachedProperty")}o(HD,"cachedProperty");Li.cachedProperty=HD;function zD(t){return typeof t=="string"?Li.toArray(t,"hex"):t}o(zD,"parseBytes");Li.parseBytes=zD;function KD(t){return new UD(t,"hex","le")}o(KD,"intFromLE");Li.intFromLE=KD});var Vm=De((mK,Gm)=>{var Km;Gm.exports=o(function(e){return Km||(Km=new Cs(null)),Km.generate(e)},"rand");function Cs(t){this.rand=t}o(Cs,"Rand");Gm.exports.Rand=Cs;Cs.prototype.generate=o(function(e){return this._rand(e)},"generate");Cs.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n<r.length;n++)r[n]=this.rand.getByte();return r},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Cs.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Cs.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r},"_rand"):typeof window=="object"&&(Cs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(jm=require("crypto"),typeof jm.randomBytes!="function")throw new Error("Not supported");Cs.prototype._rand=o(function(e){return jm.randomBytes(e)},"_rand")}catch{}var jm});var bu=De((bK,v3)=>{"use strict";var Ma=no(),mu=Ln(),qh=mu.getNAF,jD=mu.getJSF,Hh=mu.assert;function ks(t,e){this.type=t,this.p=new Ma(e.p,16),this.red=e.prime?Ma.red(e.prime):Ma.mont(this.p),this.zero=new Ma(0).toRed(this.red),this.one=new Ma(1).toRed(this.red),this.two=new Ma(2).toRed(this.red),this.n=e.n&&new Ma(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(ks,"BaseCurve");v3.exports=ks;ks.prototype.point=o(function(){throw new Error("Not implemented")},"point");ks.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");ks.prototype._fixedNafMul=o(function(e,r){Hh(e.precomputed);var n=e._getDoubles(),i=qh(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],u,m;for(u=0;u<i.length;u+=n.step){m=0;for(var v=u+n.step-1;v>=u;v--)m=(m<<1)+i[v];c.push(m)}for(var x=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)m=c[u],m===O?S=S.mixedAdd(n.points[u]):m===-O&&(S=S.mixedAdd(n.points[u].neg()));x=x.add(S)}return x.toP()},"_fixedNafMul");ks.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=qh(r,n,this._bitLength),u=this.jpoint(null,null,null),m=c.length-1;m>=0;m--){for(var v=0;m>=0&&c[m]===0;m--)v++;if(m>=0&&v++,u=u.dblp(v),m<0)break;var x=c[m];Hh(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(a[x-1>>1]):u=u.mixedAdd(a[-x-1>>1].neg()):x>0?u=u.add(a[x-1>>1]):u=u.add(a[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");ks.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,m=this._wnafT3,v=0,x,S,O;for(x=0;x<i;x++){O=r[x];var R=O._getNAFPoints(e);c[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var D=x-1,P=x;if(c[D]!==1||c[P]!==1){m[D]=qh(n[D],c[D],this._bitLength),m[P]=qh(n[P],c[P],this._bitLength),v=Math.max(m[D].length,v),v=Math.max(m[P].length,v);continue}var J=[r[D],null,null,r[P]];r[D].y.cmp(r[P].y)===0?(J[1]=r[D].add(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg())):r[D].y.cmp(r[P].y.redNeg())===0?(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].add(r[P].neg())):(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],W=jD(n[D],n[P]);for(v=Math.max(W[0].length,v),m[D]=new Array(v),m[P]=new Array(v),S=0;S<v;S++){var Q=W[0][S]|0,Y=W[1][S]|0;m[D][S]=L[(Q+1)*3+(Y+1)],m[P][S]=0,u[D]=J}}var oe=this.jpoint(null,null,null),j=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var G=!0;for(S=0;S<i;S++)j[S]=m[S][x]|0,j[S]!==0&&(G=!1);if(!G)break;H++,x--}if(x>=0&&H++,oe=oe.dblp(H),x<0)break;for(S=0;S<i;S++){var le=j[S];le!==0&&(le>0?O=u[S][le-1>>1]:le<0&&(O=u[S][-le-1>>1].neg()),O.type==="affine"?oe=oe.mixedAdd(O):oe=oe.add(O))}}for(x=0;x<i;x++)u[x]=null;return a?oe:oe.toP()},"_wnafMulAdd");function di(t,e){this.curve=t,this.type=e,this.precomputed=null}o(di,"BasePoint");ks.BasePoint=di;di.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");di.prototype.validate=o(function(){return this.curve.validate(this)},"validate");ks.prototype.decodePoint=o(function(e,r){e=mu.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Hh(e[e.length-1]%2===0):e[0]===7&&Hh(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");di.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");di.prototype._encode=o(function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode");di.prototype.encode=o(function(e,r){return mu.encode(this._encode(r),e)},"encode");di.prototype.precompute=o(function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},"precompute");di.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},"_hasDoubles");di.prototype._getDoubles=o(function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=e){for(var c=0;c<e;c++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");di.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:e,points:r}},"_getNAFPoints");di.prototype._getBeta=o(function(){return null},"_getBeta");di.prototype.dblp=o(function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r},"dblp")});var gu=De((gK,Wm)=>{typeof Object.create=="function"?Wm.exports=o(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Wm.exports=o(function(e,r){if(r){e.super_=r;var n=o(function(){},"TempCtor");n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var x3=De((vK,y3)=>{"use strict";var GD=Ln(),ur=no(),Jm=gu(),qf=bu(),VD=GD.assert;function pi(t){qf.call(this,"short",t),this.a=new ur(t.a,16).toRed(this.red),this.b=new ur(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(pi,"ShortCurve");Jm(pi,qf);y3.exports=pi;pi.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ur(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new ur(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],VD(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new ur(u.a,16),b:new ur(u.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism");pi.prototype._getEndoRoots=o(function(e){var r=e===this.p?this.red:ur.mont(e),n=new ur(2).toRed(r).redInvm(),i=n.redNeg(),a=new ur(3).toRed(r).redNeg().redSqrt().redMul(n),c=i.redAdd(a).fromRed(),u=i.redSub(a).fromRed();return[c,u]},"_getEndoRoots");pi.prototype._getEndoBasis=o(function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),a=new ur(1),c=new ur(0),u=new ur(0),m=new ur(1),v,x,S,O,R,D,P,J=0,L,W;n.cmpn(0)!==0;){var Q=i.div(n);L=i.sub(Q.mul(n)),W=u.sub(Q.mul(a));var Y=m.sub(Q.mul(c));if(!S&&L.cmp(r)<0)v=P.neg(),x=a,S=L.neg(),O=W;else if(S&&++J===2)break;P=L,i=n,n=L,u=a,a=W,m=c,c=Y}R=L.neg(),D=W;var oe=S.sqr().add(O.sqr()),j=R.sqr().add(D.sqr());return j.cmp(oe)>=0&&(R=v,D=x),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),D=D.neg()),[{a:S,b:O},{a:R,b:D}]},"_getEndoBasis");pi.prototype._endoSplit=o(function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),c=n.b.neg().mul(e).divRound(this.n),u=a.mul(n.a),m=c.mul(i.a),v=a.mul(n.b),x=c.mul(i.b),S=e.sub(u).sub(m),O=v.add(x).neg();return{k1:S,k2:O}},"_endoSplit");pi.prototype.pointFromX=o(function(e,r){e=new ur(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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");pi.prototype.validate=o(function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},"validate");pi.prototype._endoWnafMulAdd=o(function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var u=this._endoSplit(r[c]),m=e[c],v=m._getBeta();u.k1.negative&&(u.k1.ineg(),m=m.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=m,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return x},"_endoWnafMulAdd");function Sr(t,e,r,n){qf.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ur(e,16),this.y=new ur(r,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(Sr,"Point");Jm(Sr,qf.BasePoint);pi.prototype.point=o(function(e,r,n){return new Sr(this,e,r,n)},"point");pi.prototype.pointFromJSON=o(function(e,r){return Sr.fromJSON(this,e,r)},"pointFromJSON");Sr.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(a){return n.point(a.x.redMul(n.endo.beta),a.y)},"endoMul");e.beta=r,r.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 r}},"_getBeta");Sr.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");Sr.fromJSON=o(function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function a(u){return e.point(u[0],u[1],n)}o(a,"obj2point");var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(a))}},i},"fromJSON");Sr.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");Sr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Sr.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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Sr.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),c=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,u)},"dbl");Sr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Sr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Sr.prototype.mul=o(function(e){return e=new ur(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");Sr.prototype.mulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},"mulAdd");Sr.prototype.jmulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)},"jmulAdd");Sr.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");Sr.prototype.neg=o(function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(a){return a.neg()},"negate");r.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 r},"neg");Sr.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 Lr(t,e,r,n){qf.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ur(0)):(this.x=new ur(e,16),this.y=new ur(r,16),this.z=new ur(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(Lr,"JPoint");Jm(Lr,qf.BasePoint);pi.prototype.jpoint=o(function(e,r,n){return new Lr(this,e,r,n)},"jpoint");Lr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)},"toP");Lr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Lr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),m=i.redSub(a),v=c.redSub(u);if(m.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=m.redSqr(),S=x.redMul(m),O=i.redMul(x),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),D=v.redMul(O.redISub(R)).redISub(c.redMul(S)),P=this.z.redMul(e.z).redMul(m);return this.curve.jpoint(R,D,P)},"add");Lr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,c=e.y.redMul(r).redMul(this.z),u=n.redSub(i),m=a.redSub(c);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),x=v.redMul(u),S=n.redMul(v),O=m.redSqr().redIAdd(x).redISub(S).redISub(S),R=m.redMul(S.redISub(O)).redISub(a.redMul(x)),D=this.z.redMul(u);return this.curve.jpoint(O,R,D)},"mixedAdd");Lr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,c=this.x,u=this.y,m=this.z,v=m.redSqr().redSqr(),x=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=x.redSqr(),R=O.redSqr(),D=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),P=c.redMul(O),J=D.redSqr().redISub(P.redAdd(P)),L=P.redISub(J),W=D.redMul(L);W=W.redIAdd(W).redISub(R);var Q=x.redMul(m);r+1<e&&(v=v.redMul(R)),c=J,m=Q,x=W}return this.curve.jpoint(c,x.redMul(a),m)},"dblp");Lr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Lr.prototype._zeroDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i),v=m.redSqr().redISub(u).redISub(u),x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),e=v,r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),D=this.x.redAdd(O).redSqr().redISub(S).redISub(R);D=D.redIAdd(D);var P=S.redAdd(S).redIAdd(S),J=P.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=J.redISub(D).redISub(D),r=P.redMul(D.redISub(e)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)},"_zeroDbl");Lr.prototype._threeDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),v=m.redSqr().redISub(u).redISub(u);e=v;var x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),D=this.x.redSub(S).redMul(this.x.redAdd(S));D=D.redAdd(D).redIAdd(D);var P=R.redIAdd(R);P=P.redIAdd(P);var J=P.redAdd(P);e=D.redSqr().redISub(J),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(S);var L=O.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),r=D.redMul(P.redISub(e)).redISub(L)}return this.curve.jpoint(e,r,n)},"_threeDbl");Lr.prototype._dbl=o(function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),c=r.redSqr(),u=n.redSqr(),m=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var x=v.redMul(u),S=m.redSqr().redISub(x.redAdd(x)),O=x.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=m.redMul(O).redISub(R),P=n.redAdd(n).redMul(i);return this.curve.jpoint(S,D,P)},"_dbl");Lr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(c);var m=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=a.redIAdd(u).redSqr().redISub(c).redISub(m).redISub(v),S=r.redMul(x);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(m).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(x.redMul(v.redISub(x)).redISub(u.redMul(m)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=this.z.redAdd(u).redSqr().redISub(n).redISub(m);return this.curve.jpoint(O,R,D)},"trpl");Lr.prototype.mul=o(function(e,r){return e=new ur(e,r),this.curve._wnafMul(this,e)},"mul");Lr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Lr.prototype.eqXToP=o(function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},"eqXToP");Lr.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");Lr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var E3=De((yK,_3)=>{"use strict";var Hf=no(),w3=gu(),zh=bu(),WD=Ln();function zf(t){zh.call(this,"mont",t),this.a=new Hf(t.a,16).toRed(this.red),this.b=new Hf(t.b,16).toRed(this.red),this.i4=new Hf(4).toRed(this.red).redInvm(),this.two=new Hf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(zf,"MontCurve");w3(zf,zh);_3.exports=zf;zf.prototype.validate=o(function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0},"validate");function Mr(t,e,r){zh.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Hf(e,16),this.z=new Hf(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(Mr,"Point");w3(Mr,zh.BasePoint);zf.prototype.decodePoint=o(function(e,r){return this.point(WD.toArray(e,r),1)},"decodePoint");zf.prototype.point=o(function(e,r){return new Mr(this,e,r)},"point");zf.prototype.pointFromJSON=o(function(e){return Mr.fromJSON(this,e)},"pointFromJSON");Mr.prototype.precompute=o(function(){},"precompute");Mr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Mr.fromJSON=o(function(e,r){return new Mr(e,r[0],r[1]||e.one)},"fromJSON");Mr.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");Mr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Mr.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),c=r.redMul(i),u=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(c,u)},"dbl");Mr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Mr.prototype.diffAdd=o(function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z),u=c.redMul(n),m=a.redMul(i),v=r.z.redMul(u.redAdd(m).redSqr()),x=r.x.redMul(u.redISub(m).redSqr());return this.curve.point(v,x)},"diffAdd");Mr.prototype.mul=o(function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,c=[];r.cmpn(0)!==0;r.iushrn(1))c.push(r.andln(1));for(var u=c.length-1;u>=0;u--)c[u]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i},"mul");Mr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Mr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Mr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Mr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Mr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var M3=De((xK,S3)=>{"use strict";var JD=Ln(),Ho=no(),A3=gu(),Kh=bu(),YD=JD.assert;function io(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Kh.call(this,"edwards",t),this.a=new Ho(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Ho(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Ho(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),YD(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}o(io,"EdwardsCurve");A3(io,Kh);S3.exports=io;io.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");io.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");io.prototype.jpoint=o(function(e,r,n,i){return this.point(e,r,n,i)},"jpoint");io.prototype.pointFromX=o(function(e,r){e=new Ho(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),c=i.redMul(a.redInvm()),u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var m=u.fromRed().isOdd();return(r&&!m||!r&&m)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");io.prototype.pointFromY=o(function(e,r){e=new Ho(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),c=i.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)},"pointFromY");io.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0},"validate");function rr(t,e,r,n,i){Kh.BasePoint.call(this,t,"projective"),e===null&&r===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 Ho(e,16),this.y=new Ho(r,16),this.z=n?new Ho(n,16):this.curve.one,this.t=i&&new Ho(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(rr,"Point");A3(rr,Kh.BasePoint);io.prototype.pointFromJSON=o(function(e){return rr.fromJSON(this,e)},"pointFromJSON");io.prototype.point=o(function(e,r,n,i){return new rr(this,e,r,n,i)},"point");rr.fromJSON=o(function(e,r){return new rr(e,r[0],r[1],r[2])},"fromJSON");rr.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");rr.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");rr.prototype._extDbl=o(function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),c=i.redAdd(r),u=c.redSub(n),m=i.redSub(r),v=a.redMul(u),x=c.redMul(m),S=a.redMul(m),O=u.redMul(c);return this.curve.point(v,x,O,S)},"_extDbl");rr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,c,u,m,v;if(this.curve.twisted){u=this.curve._mulA(r);var x=u.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(x.redSub(this.curve.two)),a=x.redMul(u.redSub(n)),c=x.redSqr().redSub(x).redSub(x)):(m=this.z.redSqr(),v=x.redSub(m).redISub(m),i=e.redSub(r).redISub(n).redMul(v),a=x.redMul(u.redSub(n)),c=x.redMul(v))}else u=r.redAdd(n),m=this.curve._mulC(this.z).redSqr(),v=u.redSub(m).redSub(m),i=this.curve._mulC(e.redISub(u)).redMul(v),a=this.curve._mulC(u).redMul(r.redISub(n)),c=u.redMul(v);return this.curve.point(i,a,c)},"_projDbl");rr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");rr.prototype._extAdd=o(function(e){var r=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),a=this.z.redMul(e.z.redAdd(e.z)),c=n.redSub(r),u=a.redSub(i),m=a.redAdd(i),v=n.redAdd(r),x=c.redMul(u),S=m.redMul(v),O=c.redMul(v),R=u.redMul(m);return this.curve.point(x,S,R,O)},"_extAdd");rr.prototype._projAdd=o(function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(i).redMul(a),u=n.redSub(c),m=n.redAdd(c),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),x=r.redMul(u).redMul(v),S,O;return this.curve.twisted?(S=r.redMul(m).redMul(a.redSub(this.curve._mulA(i))),O=u.redMul(m)):(S=r.redMul(m).redMul(a.redSub(i)),O=this.curve._mulC(u).redMul(m)),this.curve.point(x,S,O)},"_projAdd");rr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");rr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");rr.prototype.mulAdd=o(function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)},"mulAdd");rr.prototype.jmulAdd=o(function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)},"jmulAdd");rr.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");rr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");rr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");rr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");rr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");rr.prototype.eqXToP=o(function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===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(r.redIAdd(i),this.x.cmp(r)===0)return!0}},"eqXToP");rr.prototype.toP=rr.prototype.normalize;rr.prototype.mixedAdd=rr.prototype.add});var Ym=De(T3=>{"use strict";var jh=T3;jh.base=bu();jh.short=x3();jh.mont=E3();jh.edwards=M3()});var Bi=De(Qt=>{"use strict";var XD=Ts(),ZD=gu();Qt.inherits=ZD;function QD(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}o(QD,"isSurrogatePair");function eO(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=a&63|128):QD(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}o(eO,"toArray");Qt.toArray=eO;function tO(t){for(var e="",r=0;r<t.length;r++)e+=k3(t[r].toString(16));return e}o(tO,"toHex");Qt.toHex=tO;function C3(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}o(C3,"htonl");Qt.htonl=C3;function rO(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=C3(i)),r+=I3(i.toString(16))}return r}o(rO,"toHex32");Qt.toHex32=rO;function k3(t){return t.length===1?"0"+t:t}o(k3,"zero2");Qt.zero2=k3;function I3(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}o(I3,"zero8");Qt.zero8=I3;function nO(t,e,r,n){var i=r-e;XD(i%4===0);for(var a=new Array(i/4),c=0,u=e;c<a.length;c++,u+=4){var m;n==="big"?m=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:m=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],a[c]=m>>>0}return a}o(nO,"join32");Qt.join32=nO;function iO(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var a=t[n];e==="big"?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}o(iO,"split32");Qt.split32=iO;function oO(t,e){return t>>>e|t<<32-e}o(oO,"rotr32");Qt.rotr32=oO;function sO(t,e){return t<<e|t>>>32-e}o(sO,"rotl32");Qt.rotl32=sO;function aO(t,e){return t+e>>>0}o(aO,"sum32");Qt.sum32=aO;function fO(t,e,r){return t+e+r>>>0}o(fO,"sum32_3");Qt.sum32_3=fO;function cO(t,e,r,n){return t+e+r+n>>>0}o(cO,"sum32_4");Qt.sum32_4=cO;function uO(t,e,r,n,i){return t+e+r+n+i>>>0}o(uO,"sum32_5");Qt.sum32_5=uO;function lO(t,e,r,n){var i=t[e],a=t[e+1],c=n+a>>>0,u=(c<n?1:0)+r+i;t[e]=u>>>0,t[e+1]=c}o(lO,"sum64");Qt.sum64=lO;function hO(t,e,r,n){var i=e+n>>>0,a=(i<e?1:0)+t+r;return a>>>0}o(hO,"sum64_hi");Qt.sum64_hi=hO;function dO(t,e,r,n){var i=e+n;return i>>>0}o(dO,"sum64_lo");Qt.sum64_lo=dO;function pO(t,e,r,n,i,a,c,u){var m=0,v=e;v=v+n>>>0,m+=v<e?1:0,v=v+a>>>0,m+=v<a?1:0,v=v+u>>>0,m+=v<u?1:0;var x=t+r+i+c+m;return x>>>0}o(pO,"sum64_4_hi");Qt.sum64_4_hi=pO;function mO(t,e,r,n,i,a,c,u){var m=e+n+a+u;return m>>>0}o(mO,"sum64_4_lo");Qt.sum64_4_lo=mO;function bO(t,e,r,n,i,a,c,u,m,v){var x=0,S=e;S=S+n>>>0,x+=S<e?1:0,S=S+a>>>0,x+=S<a?1:0,S=S+u>>>0,x+=S<u?1:0,S=S+v>>>0,x+=S<v?1:0;var O=t+r+i+c+m+x;return O>>>0}o(bO,"sum64_5_hi");Qt.sum64_5_hi=bO;function gO(t,e,r,n,i,a,c,u,m,v){var x=e+n+a+u+v;return x>>>0}o(gO,"sum64_5_lo");Qt.sum64_5_lo=gO;function vO(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}o(vO,"rotr64_hi");Qt.rotr64_hi=vO;function yO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(yO,"rotr64_lo");Qt.rotr64_lo=yO;function xO(t,e,r){return t>>>r}o(xO,"shr64_hi");Qt.shr64_hi=xO;function wO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(wO,"shr64_lo");Qt.shr64_lo=wO});var Kf=De(O3=>{"use strict";var D3=Bi(),_O=Ts();function Gh(){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(Gh,"BlockHash");O3.BlockHash=Gh;Gh.prototype.update=o(function(e,r){if(e=D3.toArray(e,r),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=D3.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");Gh.prototype.digest=o(function(e){return this.update(this._pad()),_O(this.pending===null),this._digest(e)},"digest");Gh.prototype._pad=o(function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var a=1;a<n;a++)i[a]=0;if(e<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)i[a++]=0;i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=e>>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,c=8;c<this.padLength;c++)i[a++]=0;return i},"pad")});var Xm=De(zo=>{"use strict";var EO=Bi(),oo=EO.rotr32;function AO(t,e,r,n){if(t===0)return R3(e,r,n);if(t===1||t===3)return P3(e,r,n);if(t===2)return N3(e,r,n)}o(AO,"ft_1");zo.ft_1=AO;function R3(t,e,r){return t&e^~t&r}o(R3,"ch32");zo.ch32=R3;function N3(t,e,r){return t&e^t&r^e&r}o(N3,"maj32");zo.maj32=N3;function P3(t,e,r){return t^e^r}o(P3,"p32");zo.p32=P3;function SO(t){return oo(t,2)^oo(t,13)^oo(t,22)}o(SO,"s0_256");zo.s0_256=SO;function MO(t){return oo(t,6)^oo(t,11)^oo(t,25)}o(MO,"s1_256");zo.s1_256=MO;function TO(t){return oo(t,7)^oo(t,18)^t>>>3}o(TO,"g0_256");zo.g0_256=TO;function CO(t){return oo(t,17)^oo(t,19)^t>>>10}o(CO,"g1_256");zo.g1_256=CO});var U3=De((SK,B3)=>{"use strict";var jf=Bi(),kO=Kf(),IO=Xm(),Zm=jf.rotl32,vu=jf.sum32,DO=jf.sum32_5,OO=IO.ft_1,L3=kO.BlockHash,RO=[1518500249,1859775393,2400959708,3395469782];function so(){if(!(this instanceof so))return new so;L3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(so,"SHA1");jf.inherits(so,L3);B3.exports=so;so.blockSize=512;so.outSize=160;so.hmacStrength=80;so.padLength=64;so.prototype._update=o(function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=Zm(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var a=this.h[0],c=this.h[1],u=this.h[2],m=this.h[3],v=this.h[4];for(i=0;i<n.length;i++){var x=~~(i/20),S=DO(Zm(a,5),OO(x,c,u,m),v,n[i],RO[x]);v=m,m=u,u=Zm(c,30),c=a,a=S}this.h[0]=vu(this.h[0],a),this.h[1]=vu(this.h[1],c),this.h[2]=vu(this.h[2],u),this.h[3]=vu(this.h[3],m),this.h[4]=vu(this.h[4],v)},"_update");so.prototype._digest=o(function(e){return e==="hex"?jf.toHex32(this.h,"big"):jf.split32(this.h,"big")},"digest")});var Qm=De((MK,F3)=>{"use strict";var Gf=Bi(),NO=Kf(),Vf=Xm(),PO=Ts(),Ui=Gf.sum32,LO=Gf.sum32_4,BO=Gf.sum32_5,UO=Vf.ch32,$O=Vf.maj32,FO=Vf.s0_256,qO=Vf.s1_256,HO=Vf.g0_256,zO=Vf.g1_256,$3=NO.BlockHash,KO=[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 ao(){if(!(this instanceof ao))return new ao;$3.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=KO,this.W=new Array(64)}o(ao,"SHA256");Gf.inherits(ao,$3);F3.exports=ao;ao.blockSize=512;ao.outSize=256;ao.hmacStrength=192;ao.padLength=64;ao.prototype._update=o(function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=LO(zO(n[i-2]),n[i-7],HO(n[i-15]),n[i-16]);var a=this.h[0],c=this.h[1],u=this.h[2],m=this.h[3],v=this.h[4],x=this.h[5],S=this.h[6],O=this.h[7];for(PO(this.k.length===n.length),i=0;i<n.length;i++){var R=BO(O,qO(v),UO(v,x,S),this.k[i],n[i]),D=Ui(FO(a),$O(a,c,u));O=S,S=x,x=v,v=Ui(m,R),m=u,u=c,c=a,a=Ui(R,D)}this.h[0]=Ui(this.h[0],a),this.h[1]=Ui(this.h[1],c),this.h[2]=Ui(this.h[2],u),this.h[3]=Ui(this.h[3],m),this.h[4]=Ui(this.h[4],v),this.h[5]=Ui(this.h[5],x),this.h[6]=Ui(this.h[6],S),this.h[7]=Ui(this.h[7],O)},"_update");ao.prototype._digest=o(function(e){return e==="hex"?Gf.toHex32(this.h,"big"):Gf.split32(this.h,"big")},"digest")});var z3=De((TK,H3)=>{"use strict";var e1=Bi(),q3=Qm();function Ko(){if(!(this instanceof Ko))return new Ko;q3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(Ko,"SHA224");e1.inherits(Ko,q3);H3.exports=Ko;Ko.blockSize=512;Ko.outSize=224;Ko.hmacStrength=192;Ko.padLength=64;Ko.prototype._digest=o(function(e){return e==="hex"?e1.toHex32(this.h.slice(0,7),"big"):e1.split32(this.h.slice(0,7),"big")},"digest")});var n1=De((CK,V3)=>{"use strict";var vn=Bi(),jO=Kf(),GO=Ts(),fo=vn.rotr64_hi,co=vn.rotr64_lo,K3=vn.shr64_hi,j3=vn.shr64_lo,Is=vn.sum64,t1=vn.sum64_hi,r1=vn.sum64_lo,VO=vn.sum64_4_hi,WO=vn.sum64_4_lo,JO=vn.sum64_5_hi,YO=vn.sum64_5_lo,G3=jO.BlockHash,XO=[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 $i(){if(!(this instanceof $i))return new $i;G3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=XO,this.W=new Array(160)}o($i,"SHA512");vn.inherits($i,G3);V3.exports=$i;$i.blockSize=1024;$i.outSize=512;$i.hmacStrength=192;$i.padLength=128;$i.prototype._prepareBlock=o(function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var a=fR(n[i-4],n[i-3]),c=cR(n[i-4],n[i-3]),u=n[i-14],m=n[i-13],v=sR(n[i-30],n[i-29]),x=aR(n[i-30],n[i-29]),S=n[i-32],O=n[i-31];n[i]=VO(a,c,u,m,v,x,S,O),n[i+1]=WO(a,c,u,m,v,x,S,O)}},"_prepareBlock");$i.prototype._update=o(function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],a=this.h[1],c=this.h[2],u=this.h[3],m=this.h[4],v=this.h[5],x=this.h[6],S=this.h[7],O=this.h[8],R=this.h[9],D=this.h[10],P=this.h[11],J=this.h[12],L=this.h[13],W=this.h[14],Q=this.h[15];GO(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var oe=W,j=Q,H=iR(O,R),G=oR(O,R),le=ZO(O,R,D,P,J,L),T=QO(O,R,D,P,J,L),h=this.k[Y],y=this.k[Y+1],b=n[Y],l=n[Y+1],p=JO(oe,j,H,G,le,T,h,y,b,l),_=YO(oe,j,H,G,le,T,h,y,b,l);oe=rR(i,a),j=nR(i,a),H=eR(i,a,c,u,m,v),G=tR(i,a,c,u,m,v);var A=t1(oe,j,H,G),E=r1(oe,j,H,G);W=J,Q=L,J=D,L=P,D=O,P=R,O=t1(x,S,p,_),R=r1(S,S,p,_),x=m,S=v,m=c,v=u,c=i,u=a,i=t1(p,_,A,E),a=r1(p,_,A,E)}Is(this.h,0,i,a),Is(this.h,2,c,u),Is(this.h,4,m,v),Is(this.h,6,x,S),Is(this.h,8,O,R),Is(this.h,10,D,P),Is(this.h,12,J,L),Is(this.h,14,W,Q)},"_update");$i.prototype._digest=o(function(e){return e==="hex"?vn.toHex32(this.h,"big"):vn.split32(this.h,"big")},"digest");function ZO(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}o(ZO,"ch64_hi");function QO(t,e,r,n,i,a){var c=e&n^~e&a;return c<0&&(c+=4294967296),c}o(QO,"ch64_lo");function eR(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}o(eR,"maj64_hi");function tR(t,e,r,n,i,a){var c=e&n^e&a^n&a;return c<0&&(c+=4294967296),c}o(tR,"maj64_lo");function rR(t,e){var r=fo(t,e,28),n=fo(e,t,2),i=fo(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(rR,"s0_512_hi");function nR(t,e){var r=co(t,e,28),n=co(e,t,2),i=co(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(nR,"s0_512_lo");function iR(t,e){var r=fo(t,e,14),n=fo(t,e,18),i=fo(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}o(iR,"s1_512_hi");function oR(t,e){var r=co(t,e,14),n=co(t,e,18),i=co(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}o(oR,"s1_512_lo");function sR(t,e){var r=fo(t,e,1),n=fo(t,e,8),i=K3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(sR,"g0_512_hi");function aR(t,e){var r=co(t,e,1),n=co(t,e,8),i=j3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(aR,"g0_512_lo");function fR(t,e){var r=fo(t,e,19),n=fo(e,t,29),i=K3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(fR,"g1_512_hi");function cR(t,e){var r=co(t,e,19),n=co(e,t,29),i=j3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(cR,"g1_512_lo")});var Y3=De((kK,J3)=>{"use strict";var i1=Bi(),W3=n1();function jo(){if(!(this instanceof jo))return new jo;W3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(jo,"SHA384");i1.inherits(jo,W3);J3.exports=jo;jo.blockSize=1024;jo.outSize=384;jo.hmacStrength=192;jo.padLength=128;jo.prototype._digest=o(function(e){return e==="hex"?i1.toHex32(this.h.slice(0,12),"big"):i1.split32(this.h.slice(0,12),"big")},"digest")});var X3=De(Wf=>{"use strict";Wf.sha1=U3();Wf.sha224=z3();Wf.sha256=Qm();Wf.sha384=Y3();Wf.sha512=n1()});var n6=De(r6=>{"use strict";var Ta=Bi(),uR=Kf(),Vh=Ta.rotl32,Z3=Ta.sum32,yu=Ta.sum32_3,Q3=Ta.sum32_4,t6=uR.BlockHash;function uo(){if(!(this instanceof uo))return new uo;t6.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(uo,"RIPEMD160");Ta.inherits(uo,t6);r6.ripemd160=uo;uo.blockSize=512;uo.outSize=160;uo.hmacStrength=192;uo.padLength=64;uo.prototype._update=o(function(e,r){for(var n=this.h[0],i=this.h[1],a=this.h[2],c=this.h[3],u=this.h[4],m=n,v=i,x=a,S=c,O=u,R=0;R<80;R++){var D=Z3(Vh(Q3(n,e6(R,i,a,c),e[dR[R]+r],lR(R)),mR[R]),u);n=u,u=c,c=Vh(a,10),a=i,i=D,D=Z3(Vh(Q3(m,e6(79-R,v,x,S),e[pR[R]+r],hR(R)),bR[R]),O),m=O,O=S,S=Vh(x,10),x=v,v=D}D=yu(this.h[1],a,S),this.h[1]=yu(this.h[2],c,O),this.h[2]=yu(this.h[3],u,m),this.h[3]=yu(this.h[4],n,v),this.h[4]=yu(this.h[0],i,x),this.h[0]=D},"update");uo.prototype._digest=o(function(e){return e==="hex"?Ta.toHex32(this.h,"little"):Ta.split32(this.h,"little")},"digest");function e6(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}o(e6,"f");function lR(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}o(lR,"K");function hR(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}o(hR,"Kh");var dR=[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],pR=[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],mR=[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],bR=[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 o6=De((OK,i6)=>{"use strict";var gR=Bi(),vR=Ts();function Jf(t,e,r){if(!(this instanceof Jf))return new Jf(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(gR.toArray(e,r))}o(Jf,"Hmac");i6.exports=Jf;Jf.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),vR(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},"init");Jf.prototype.update=o(function(e,r){return this.inner.update(e,r),this},"update");Jf.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var xu=De(s6=>{var Br=s6;Br.utils=Bi();Br.common=Kf();Br.sha=X3();Br.ripemd=n6();Br.hmac=o6();Br.sha1=Br.sha.sha1;Br.sha256=Br.sha.sha256;Br.sha224=Br.sha.sha224;Br.sha384=Br.sha.sha384;Br.sha512=Br.sha.sha512;Br.ripemd160=Br.ripemd.ripemd160});var f6=De((NK,a6)=>{a6.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 Wh=De(l6=>{"use strict";var s1=l6,Ds=xu(),o1=Ym(),yR=Ln(),c6=yR.assert;function u6(t){t.type==="short"?this.curve=new o1.short(t):t.type==="edwards"?this.curve=new o1.edwards(t):this.curve=new o1.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,c6(this.g.validate(),"Invalid curve"),c6(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(u6,"PresetCurve");s1.PresetCurve=u6;function Os(t,e){Object.defineProperty(s1,t,{configurable:!0,enumerable:!0,get:function(){var r=new u6(e);return Object.defineProperty(s1,t,{configurable:!0,enumerable:!0,value:r}),r}})}o(Os,"defineCurve");Os("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:Ds.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Os("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:Ds.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Os("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:Ds.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Os("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:Ds.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"]});Os("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:Ds.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"]});Os("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ds.sha256,gRed:!1,g:["9"]});Os("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:Ds.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a1;try{a1=f6()}catch{a1=void 0}Os("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:Ds.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a1]})});var p6=De((LK,d6)=>{"use strict";var xR=xu(),Ca=zm(),h6=Ts();function Rs(t){if(!(this instanceof Rs))return new Rs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Ca.toArray(t.entropy,t.entropyEnc||"hex"),r=Ca.toArray(t.nonce,t.nonceEnc||"hex"),n=Ca.toArray(t.pers,t.persEnc||"hex");h6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(Rs,"HmacDRBG");d6.exports=Rs;Rs.prototype._init=o(function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");Rs.prototype._hmac=o(function(){return new xR.hmac(this.hash,this.K)},"hmac");Rs.prototype._update=o(function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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");Rs.prototype.reseed=o(function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Ca.toArray(e,r),n=Ca.toArray(n,i),h6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Rs.prototype.generate=o(function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Ca.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(n),this._reseed++,Ca.encode(c,r)},"generate")});var b6=De((BK,m6)=>{"use strict";var wR=no(),_R=Ln(),f1=_R.assert;function Gr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(Gr,"KeyPair");m6.exports=Gr;Gr.fromPublic=o(function(e,r,n){return r instanceof Gr?r:new Gr(e,{pub:r,pubEnc:n})},"fromPublic");Gr.fromPrivate=o(function(e,r,n){return r instanceof Gr?r:new Gr(e,{priv:r,privEnc:n})},"fromPrivate");Gr.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");Gr.prototype.getPublic=o(function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},"getPublic");Gr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Gr.prototype._importPrivate=o(function(e,r){this.priv=new wR(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Gr.prototype._importPublic=o(function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?f1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&f1(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,r)},"_importPublic");Gr.prototype.derive=o(function(e){return e.validate()||f1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Gr.prototype.sign=o(function(e,r,n){return this.ec.sign(e,this,r,n)},"sign");Gr.prototype.verify=o(function(e,r){return this.ec.verify(e,r,this)},"verify");Gr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var y6=De((UK,v6)=>{"use strict";var Jh=no(),l1=Ln(),ER=l1.assert;function Yh(t,e){if(t instanceof Yh)return t;this._importDER(t,e)||(ER(t.r&&t.s,"Signature without r or s"),this.r=new Jh(t.r,16),this.s=new Jh(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Yh,"Signature");v6.exports=Yh;function AR(){this.place=0}o(AR,"Position");function c1(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,c=e.place;a<n;a++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}o(c1,"getLength");function g6(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}o(g6,"rmPadding");Yh.prototype._importDER=o(function(e,r){e=l1.toArray(e,r);var n=new AR;if(e[n.place++]!==48)return!1;var i=c1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=c1(e,n);if(a===!1)return!1;var c=e.slice(n.place,a+n.place);if(n.place+=a,e[n.place++]!==2)return!1;var u=c1(e,n);if(u===!1||e.length!==u+n.place)return!1;var m=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(m[0]===0)if(m[1]&128)m=m.slice(1);else return!1;return this.r=new Jh(c),this.s=new Jh(m),this.recoveryParam=null,!0},"_importDER");function u1(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}o(u1,"constructLength");Yh.prototype.toDER=o(function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=g6(r),n=g6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];u1(i,r.length),i=i.concat(r),i.push(2),u1(i,n.length);var a=i.concat(n),c=[48];return u1(c,a.length),c=c.concat(a),l1.encode(c,e)},"toDER")});var E6=De(($K,_6)=>{"use strict";var ka=no(),x6=p6(),SR=Ln(),h1=Wh(),MR=Vm(),w6=SR.assert,d1=b6(),Xh=y6();function mi(t){if(!(this instanceof mi))return new mi(t);typeof t=="string"&&(w6(Object.prototype.hasOwnProperty.call(h1,t),"Unknown curve "+t),t=h1[t]),t instanceof h1.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}o(mi,"EC");_6.exports=mi;mi.prototype.keyPair=o(function(e){return new d1(this,e)},"keyPair");mi.prototype.keyFromPrivate=o(function(e,r){return d1.fromPrivate(this,e,r)},"keyFromPrivate");mi.prototype.keyFromPublic=o(function(e,r){return d1.fromPublic(this,e,r)},"keyFromPublic");mi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new x6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||MR(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ka(2));;){var a=new ka(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},"genKeyPair");mi.prototype._truncateToN=o(function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");mi.prototype.sign=o(function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ka(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),m=new x6({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new ka(1)),x=0;;x++){var S=i.k?i.k(x):new ka(m.generate(this.n.byteLength()));if(S=this._truncateToN(S,!0),!(S.cmpn(1)<=0||S.cmp(v)>=0)){var O=this.g.mul(S);if(!O.isInfinity()){var R=O.getX(),D=R.umod(this.n);if(D.cmpn(0)!==0){var P=S.invm(this.n).mul(D.mul(r.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(D)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),J^=1),new Xh({r:D,s:P,recoveryParam:J})}}}}}},"sign");mi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new ka(e,16)),n=this.keyFromPublic(n,i),r=new Xh(r,"hex");var a=r.r,c=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),m=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),x;return this.curve._maxwellTrick?(x=this.g.jmulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.eqXToP(a)):(x=this.g.mulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.getX().umod(this.n).cmp(a)===0)},"verify");mi.prototype.recoverPubKey=function(t,e,r,n){w6((3&r)===r,"The recovery param is more than two bits"),e=new Xh(e,n);var i=this.n,a=new ka(t),c=e.r,u=e.s,m=r&1,v=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?c=this.curve.pointFromX(c.add(this.curve.n),m):c=this.curve.pointFromX(c,m);var x=e.r.invm(i),S=i.sub(a).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(S,c,O)};mi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Xh(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var T6=De((FK,M6)=>{"use strict";var wu=Ln(),S6=wu.assert,A6=wu.parseBytes,Yf=wu.cachedProperty;function Tr(t,e){this.eddsa=t,this._secret=A6(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=A6(e.pub)}o(Tr,"KeyPair");Tr.fromPublic=o(function(e,r){return r instanceof Tr?r:new Tr(e,{pub:r})},"fromPublic");Tr.fromSecret=o(function(e,r){return r instanceof Tr?r:new Tr(e,{secret:r})},"fromSecret");Tr.prototype.secret=o(function(){return this._secret},"secret");Yf(Tr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));Yf(Tr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));Yf(Tr,"privBytes",o(function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));Yf(Tr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));Yf(Tr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));Yf(Tr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Tr.prototype.sign=o(function(e){return S6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Tr.prototype.verify=o(function(e,r){return this.eddsa.verify(e,r,this)},"verify");Tr.prototype.getSecret=o(function(e){return S6(this._secret,"KeyPair is public only"),wu.encode(this.secret(),e)},"getSecret");Tr.prototype.getPublic=o(function(e){return wu.encode(this.pubBytes(),e)},"getPublic");M6.exports=Tr});var k6=De((qK,C6)=>{"use strict";var TR=no(),Zh=Ln(),CR=Zh.assert,Qh=Zh.cachedProperty,kR=Zh.parseBytes;function Ia(t,e){this.eddsa=t,typeof e!="object"&&(e=kR(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),CR(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof TR&&(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(Ia,"Signature");Qh(Ia,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));Qh(Ia,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));Qh(Ia,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));Qh(Ia,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Ia.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Ia.prototype.toHex=o(function(){return Zh.encode(this.toBytes(),"hex").toUpperCase()},"toHex");C6.exports=Ia});var N6=De((HK,R6)=>{"use strict";var IR=xu(),DR=Wh(),Xf=Ln(),OR=Xf.assert,D6=Xf.parseBytes,O6=T6(),I6=k6();function yn(t){if(OR(t==="ed25519","only tested with ed25519 so far"),!(this instanceof yn))return new yn(t);t=DR[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=IR.sha512}o(yn,"EDDSA");R6.exports=yn;yn.prototype.sign=o(function(e,r){e=D6(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),c=this.encodePoint(a),u=this.hashInt(c,n.pubBytes(),e).mul(n.priv()),m=i.add(u).umod(this.curve.n);return this.makeSignature({R:a,S:m,Rencoded:c})},"sign");yn.prototype.verify=o(function(e,r,n){e=D6(e),r=this.makeSignature(r);var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),c=this.g.mul(r.S()),u=r.R().add(i.pub().mul(a));return u.eq(c)},"verify");yn.prototype.hashInt=o(function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return Xf.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");yn.prototype.keyFromPublic=o(function(e){return O6.fromPublic(this,e)},"keyFromPublic");yn.prototype.keyFromSecret=o(function(e){return O6.fromSecret(this,e)},"keyFromSecret");yn.prototype.makeSignature=o(function(e){return e instanceof I6?e:new I6(this,e)},"makeSignature");yn.prototype.encodePoint=o(function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},"encodePoint");yn.prototype.decodePoint=o(function(e){e=Xf.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,a=Xf.intFromLE(n);return this.curve.pointFromY(a,i)},"decodePoint");yn.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");yn.prototype.decodeInt=o(function(e){return Xf.intFromLE(e)},"decodeInt");yn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var L6=De(P6=>{"use strict";var Da=P6;Da.version=u3().version;Da.utils=Ln();Da.rand=Vm();Da.curve=Ym();Da.curves=Wh();Da.ec=E6();Da.eddsa=N6()});var U6=De(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.BrowserRandomSource=void 0;var B6=65536,ed=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 r=new Uint8Array(e);for(let n=0;n<r.length;n+=B6)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,B6)));return r}};o(ed,"BrowserRandomSource");td.BrowserRandomSource=ed});var $6=De(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.NodeRandomSource=void 0;var RR=hi(),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 r=this._crypto.randomBytes(e);if(r.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]=r[i];return(0,RR.wipe)(r),n}};o(rd,"NodeRandomSource");nd.NodeRandomSource=rd});var F6=De(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.SystemRandomSource=void 0;var NR=U6(),PR=$6(),id=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new NR.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new PR.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(id,"SystemRandomSource");od.SystemRandomSource=id});var Oa=De(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.randomStringForEntropy=Vr.randomString=Vr.randomUint32=Vr.randomBytes=Vr.defaultRandomSource=void 0;var LR=F6(),BR=Sa(),q6=hi();Vr.defaultRandomSource=new LR.SystemRandomSource;function p1(t,e=Vr.defaultRandomSource){return e.randomBytes(t)}o(p1,"randomBytes");Vr.randomBytes=p1;function UR(t=Vr.defaultRandomSource){let e=p1(4,t),r=(0,BR.readUint32LE)(e);return(0,q6.wipe)(e),r}o(UR,"randomUint32");Vr.randomUint32=UR;var H6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function z6(t,e=H6,r=Vr.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,a=256-256%i;for(;t>0;){let c=p1(Math.ceil(t*256/a),r);for(let u=0;u<c.length&&t>0;u++){let m=c[u];m<a&&(n+=e.charAt(m%i),t--)}(0,q6.wipe)(c)}return n}o(z6,"randomString");Vr.randomString=z6;function $R(t,e=H6,r=Vr.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return z6(n,e,r)}o($R,"randomStringForEntropy");Vr.randomStringForEntropy=$R});var G6=De(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var Qf=Sa(),Zf=hi();Go.DIGEST_LENGTH=64;Go.BLOCK_SIZE=128;var j6=function(){function t(){this.digestLength=Go.DIGEST_LENGTH,this.blockSize=Go.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(t,"SHA512"),t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Zf.wipe(this._buffer),Zf.wipe(this._tempHi),Zf.wipe(this._tempLo),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<Go.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(m1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=m1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,a=r<<3,c=r%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<c-8;u++)this._buffer[u]=0;Qf.writeUint32BE(i,this._buffer,c-8),Qf.writeUint32BE(a,this._buffer,c-4),m1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)Qf.writeUint32BE(this._stateHi[u],e,u*8),Qf.writeUint32BE(this._stateLo[u],e,u*8+4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.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},t.prototype.cleanSavedState=function(e){Zf.wipe(e.stateHi),Zf.wipe(e.stateLo),e.buffer&&Zf.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Go.SHA512=j6;var K6=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 m1(t,e,r,n,i,a,c){for(var u=r[0],m=r[1],v=r[2],x=r[3],S=r[4],O=r[5],R=r[6],D=r[7],P=n[0],J=n[1],L=n[2],W=n[3],Q=n[4],Y=n[5],oe=n[6],j=n[7],H,G,le,T,h,y,b,l;c>=128;){for(var p=0;p<16;p++){var _=8*p+a;t[p]=Qf.readUint32BE(i,_),e[p]=Qf.readUint32BE(i,_+4)}for(var p=0;p<80;p++){var A=u,E=m,g=v,C=x,N=S,w=O,k=R,he=D,I=P,Z=J,se=L,q=W,F=Q,ee=Y,ne=oe,ae=j;if(H=D,G=j,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=(S>>>14|Q<<32-14)^(S>>>18|Q<<32-18)^(Q>>>41-32|S<<32-(41-32)),G=(Q>>>14|S<<32-14)^(Q>>>18|S<<32-18)^(S>>>41-32|Q<<32-(41-32)),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=S&O^~S&R,G=Q&Y^~Q&oe,h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=K6[p*2],G=K6[p*2+1],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=t[p%16],G=e[p%16],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,le=b&65535|l<<16,T=h&65535|y<<16,H=le,G=T,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=(u>>>28|P<<32-28)^(P>>>34-32|u<<32-(34-32))^(P>>>39-32|u<<32-(39-32)),G=(P>>>28|u<<32-28)^(u>>>34-32|P<<32-(34-32))^(u>>>39-32|P<<32-(39-32)),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=u&m^u&v^m&v,G=P&J^P&L^J&L,h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,he=b&65535|l<<16,ae=h&65535|y<<16,H=C,G=q,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=le,G=T,h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,C=b&65535|l<<16,q=h&65535|y<<16,m=A,v=E,x=g,S=C,O=N,R=w,D=k,u=he,J=I,L=Z,W=se,Q=q,Y=F,oe=ee,j=ne,P=ae,p%16===15)for(var _=0;_<16;_++)H=t[_],G=e[_],h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=t[(_+9)%16],G=e[(_+9)%16],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,le=t[(_+1)%16],T=e[(_+1)%16],H=(le>>>1|T<<32-1)^(le>>>8|T<<32-8)^le>>>7,G=(T>>>1|le<<32-1)^(T>>>8|le<<32-8)^(T>>>7|le<<32-7),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,le=t[(_+14)%16],T=e[(_+14)%16],H=(le>>>19|T<<32-19)^(T>>>61-32|le<<32-(61-32))^le>>>6,G=(T>>>19|le<<32-19)^(le>>>61-32|T<<32-(61-32))^(T>>>6|le<<32-6),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,t[_]=b&65535|l<<16,e[_]=h&65535|y<<16}H=u,G=P,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[0],G=n[0],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[0]=u=b&65535|l<<16,n[0]=P=h&65535|y<<16,H=m,G=J,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[1],G=n[1],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[1]=m=b&65535|l<<16,n[1]=J=h&65535|y<<16,H=v,G=L,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[2],G=n[2],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[2]=v=b&65535|l<<16,n[2]=L=h&65535|y<<16,H=x,G=W,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[3],G=n[3],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[3]=x=b&65535|l<<16,n[3]=W=h&65535|y<<16,H=S,G=Q,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[4],G=n[4],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[4]=S=b&65535|l<<16,n[4]=Q=h&65535|y<<16,H=O,G=Y,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[5],G=n[5],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[5]=O=b&65535|l<<16,n[5]=Y=h&65535|y<<16,H=R,G=oe,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[6],G=n[6],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[6]=R=b&65535|l<<16,n[6]=oe=h&65535|y<<16,H=D,G=j,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[7],G=n[7],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[7]=D=b&65535|l<<16,n[7]=j=h&65535|y<<16,a+=128,c-=128}return a}o(m1,"hashBlocks");function FR(t){var e=new j6;e.update(t);var r=e.digest();return e.clean(),r}o(FR,"hash");Go.hash=FR});var Au=De(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.convertSecretKeyToX25519=Gt.convertPublicKeyToX25519=Gt.verify=Gt.sign=Gt.extractPublicKeyFromSecretKey=Gt.generateKeyPair=Gt.generateKeyPairFromSeed=Gt.SEED_LENGTH=Gt.SECRET_KEY_LENGTH=Gt.PUBLIC_KEY_LENGTH=Gt.SIGNATURE_LENGTH=void 0;var qR=Oa(),_u=G6(),X6=hi();Gt.SIGNATURE_LENGTH=64;Gt.PUBLIC_KEY_LENGTH=32;Gt.SECRET_KEY_LENGTH=64;Gt.SEED_LENGTH=32;function Ge(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}o(Ge,"gf");var HR=new Uint8Array(32);HR[0]=9;var v1=Ge(),ec=Ge([1]),zR=Ge([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),KR=Ge([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),V6=Ge([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),W6=Ge([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),jR=Ge([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ns(t,e){for(let r=0;r<16;r++)t[r]=e[r]|0}o(Ns,"set25519");function b1(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}o(b1,"car25519");function Z6(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let a=n&(t[i]^e[i]);t[i]^=a,e[i]^=a}}o(Z6,"sel25519");function Eu(t,e){let r=Ge(),n=Ge();for(let i=0;i<16;i++)n[i]=e[i];b1(n),b1(n),b1(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let a=r[15]>>16&1;r[14]&=65535,Z6(n,r,1-a)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}o(Eu,"pack25519");function Q6(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}o(Q6,"verify32");function J6(t,e){let r=new Uint8Array(32),n=new Uint8Array(32);return Eu(r,t),Eu(n,e),Q6(r,n)}o(J6,"neq25519");function ex(t){let e=new Uint8Array(32);return Eu(e,t),e[0]&1}o(ex,"par25519");function GR(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(GR,"unpack25519");function Ra(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(Ra,"add");function Pa(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(Pa,"sub");function Yt(t,e,r){let n,i,a=0,c=0,u=0,m=0,v=0,x=0,S=0,O=0,R=0,D=0,P=0,J=0,L=0,W=0,Q=0,Y=0,oe=0,j=0,H=0,G=0,le=0,T=0,h=0,y=0,b=0,l=0,p=0,_=0,A=0,E=0,g=0,C=r[0],N=r[1],w=r[2],k=r[3],he=r[4],I=r[5],Z=r[6],se=r[7],q=r[8],F=r[9],ee=r[10],ne=r[11],ae=r[12],Ae=r[13],ge=r[14],re=r[15];n=e[0],a+=n*C,c+=n*N,u+=n*w,m+=n*k,v+=n*he,x+=n*I,S+=n*Z,O+=n*se,R+=n*q,D+=n*F,P+=n*ee,J+=n*ne,L+=n*ae,W+=n*Ae,Q+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*N,m+=n*w,v+=n*k,x+=n*he,S+=n*I,O+=n*Z,R+=n*se,D+=n*q,P+=n*F,J+=n*ee,L+=n*ne,W+=n*ae,Q+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,m+=n*N,v+=n*w,x+=n*k,S+=n*he,O+=n*I,R+=n*Z,D+=n*se,P+=n*q,J+=n*F,L+=n*ee,W+=n*ne,Q+=n*ae,Y+=n*Ae,oe+=n*ge,j+=n*re,n=e[3],m+=n*C,v+=n*N,x+=n*w,S+=n*k,O+=n*he,R+=n*I,D+=n*Z,P+=n*se,J+=n*q,L+=n*F,W+=n*ee,Q+=n*ne,Y+=n*ae,oe+=n*Ae,j+=n*ge,H+=n*re,n=e[4],v+=n*C,x+=n*N,S+=n*w,O+=n*k,R+=n*he,D+=n*I,P+=n*Z,J+=n*se,L+=n*q,W+=n*F,Q+=n*ee,Y+=n*ne,oe+=n*ae,j+=n*Ae,H+=n*ge,G+=n*re,n=e[5],x+=n*C,S+=n*N,O+=n*w,R+=n*k,D+=n*he,P+=n*I,J+=n*Z,L+=n*se,W+=n*q,Q+=n*F,Y+=n*ee,oe+=n*ne,j+=n*ae,H+=n*Ae,G+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*N,R+=n*w,D+=n*k,P+=n*he,J+=n*I,L+=n*Z,W+=n*se,Q+=n*q,Y+=n*F,oe+=n*ee,j+=n*ne,H+=n*ae,G+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*N,D+=n*w,P+=n*k,J+=n*he,L+=n*I,W+=n*Z,Q+=n*se,Y+=n*q,oe+=n*F,j+=n*ee,H+=n*ne,G+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,D+=n*N,P+=n*w,J+=n*k,L+=n*he,W+=n*I,Q+=n*Z,Y+=n*se,oe+=n*q,j+=n*F,H+=n*ee,G+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,y+=n*re,n=e[9],D+=n*C,P+=n*N,J+=n*w,L+=n*k,W+=n*he,Q+=n*I,Y+=n*Z,oe+=n*se,j+=n*q,H+=n*F,G+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,y+=n*ge,b+=n*re,n=e[10],P+=n*C,J+=n*N,L+=n*w,W+=n*k,Q+=n*he,Y+=n*I,oe+=n*Z,j+=n*se,H+=n*q,G+=n*F,le+=n*ee,T+=n*ne,h+=n*ae,y+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,L+=n*N,W+=n*w,Q+=n*k,Y+=n*he,oe+=n*I,j+=n*Z,H+=n*se,G+=n*q,le+=n*F,T+=n*ee,h+=n*ne,y+=n*ae,b+=n*Ae,l+=n*ge,p+=n*re,n=e[12],L+=n*C,W+=n*N,Q+=n*w,Y+=n*k,oe+=n*he,j+=n*I,H+=n*Z,G+=n*se,le+=n*q,T+=n*F,h+=n*ee,y+=n*ne,b+=n*ae,l+=n*Ae,p+=n*ge,_+=n*re,n=e[13],W+=n*C,Q+=n*N,Y+=n*w,oe+=n*k,j+=n*he,H+=n*I,G+=n*Z,le+=n*se,T+=n*q,h+=n*F,y+=n*ee,b+=n*ne,l+=n*ae,p+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Q+=n*C,Y+=n*N,oe+=n*w,j+=n*k,H+=n*he,G+=n*I,le+=n*Z,T+=n*se,h+=n*q,y+=n*F,b+=n*ee,l+=n*ne,p+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*N,j+=n*w,H+=n*k,G+=n*he,le+=n*I,T+=n*Z,h+=n*se,y+=n*q,b+=n*F,l+=n*ee,p+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*j,u+=38*H,m+=38*G,v+=38*le,x+=38*T,S+=38*h,O+=38*y,R+=38*b,D+=38*l,P+=38*p,J+=38*_,L+=38*A,W+=38*E,Q+=38*g,i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),t[0]=a,t[1]=c,t[2]=u,t[3]=m,t[4]=v,t[5]=x,t[6]=S,t[7]=O,t[8]=R,t[9]=D,t[10]=P,t[11]=J,t[12]=L,t[13]=W,t[14]=Q,t[15]=Y}o(Yt,"mul");function Na(t,e){Yt(t,e,e)}o(Na,"square");function tx(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)Na(r,r),n!==2&&n!==4&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(tx,"inv25519");function VR(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)Na(r,r),n!==1&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(VR,"pow2523");function y1(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),m=Ge(),v=Ge(),x=Ge();Pa(r,t[1],t[0]),Pa(x,e[1],e[0]),Yt(r,r,x),Ra(n,t[0],t[1]),Ra(x,e[0],e[1]),Yt(n,n,x),Yt(i,t[3],e[3]),Yt(i,i,KR),Yt(a,t[2],e[2]),Ra(a,a,a),Pa(c,n,r),Pa(u,a,i),Ra(m,a,i),Ra(v,n,r),Yt(t[0],c,u),Yt(t[1],v,m),Yt(t[2],m,u),Yt(t[3],c,v)}o(y1,"edadd");function Y6(t,e,r){for(let n=0;n<4;n++)Z6(t[n],e[n],r)}o(Y6,"cswap");function w1(t,e){let r=Ge(),n=Ge(),i=Ge();tx(i,e[2]),Yt(r,e[0],i),Yt(n,e[1],i),Eu(t,n),t[31]^=ex(r)<<7}o(w1,"pack");function rx(t,e,r){Ns(t[0],v1),Ns(t[1],ec),Ns(t[2],ec),Ns(t[3],v1);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(n&7)&1;Y6(t,e,i),y1(e,t),y1(t,t),Y6(t,e,i)}}o(rx,"scalarmult");function _1(t,e){let r=[Ge(),Ge(),Ge(),Ge()];Ns(r[0],V6),Ns(r[1],W6),Ns(r[2],ec),Yt(r[3],V6,W6),rx(t,r,e)}o(_1,"scalarbase");function nx(t){if(t.length!==Gt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Gt.SEED_LENGTH} bytes`);let e=(0,_u.hash)(t);e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(32),n=[Ge(),Ge(),Ge(),Ge()];_1(n,e),w1(r,n);let i=new Uint8Array(64);return i.set(t),i.set(r,32),{publicKey:r,secretKey:i}}o(nx,"generateKeyPairFromSeed");Gt.generateKeyPairFromSeed=nx;function WR(t){let e=(0,qR.randomBytes)(32,t),r=nx(e);return(0,X6.wipe)(e),r}o(WR,"generateKeyPair");Gt.generateKeyPair=WR;function JR(t){if(t.length!==Gt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Gt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(t.subarray(32))}o(JR,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=JR;var g1=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 ix(t,e){let r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)e[i]+=r-16*e[n]*g1[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=r*256;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*g1[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*g1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=e[n]&255}o(ix,"modL");function x1(t){let e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let r=0;r<64;r++)t[r]=0;ix(t,e)}o(x1,"reduce");function YR(t,e){let r=new Float64Array(64),n=[Ge(),Ge(),Ge(),Ge()],i=(0,_u.hash)(t.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let a=new Uint8Array(64);a.set(i.subarray(32),32);let c=new _u.SHA512;c.update(a.subarray(32)),c.update(e);let u=c.digest();c.clean(),x1(u),_1(n,u),w1(a,n),c.reset(),c.update(a.subarray(0,32)),c.update(t.subarray(32)),c.update(e);let m=c.digest();x1(m);for(let v=0;v<32;v++)r[v]=u[v];for(let v=0;v<32;v++)for(let x=0;x<32;x++)r[v+x]+=m[v]*i[x];return ix(a.subarray(32),r),a}o(YR,"sign");Gt.sign=YR;function ox(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),m=Ge();return Ns(t[2],ec),GR(t[1],e),Na(i,t[1]),Yt(a,i,zR),Pa(i,i,t[2]),Ra(a,t[2],a),Na(c,a),Na(u,c),Yt(m,u,c),Yt(r,m,i),Yt(r,r,a),VR(r,r),Yt(r,r,i),Yt(r,r,a),Yt(r,r,a),Yt(t[0],r,a),Na(n,t[0]),Yt(n,n,a),J6(n,i)&&Yt(t[0],t[0],jR),Na(n,t[0]),Yt(n,n,a),J6(n,i)?-1:(ex(t[0])===e[31]>>7&&Pa(t[0],v1,t[0]),Yt(t[3],t[0],t[1]),0)}o(ox,"unpackneg");function XR(t,e,r){let n=new Uint8Array(32),i=[Ge(),Ge(),Ge(),Ge()],a=[Ge(),Ge(),Ge(),Ge()];if(r.length!==Gt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Gt.SIGNATURE_LENGTH} bytes`);if(ox(a,t))return!1;let c=new _u.SHA512;c.update(r.subarray(0,32)),c.update(t),c.update(e);let u=c.digest();return x1(u),rx(i,a,u),_1(a,r.subarray(32)),y1(i,a),w1(n,i),!Q6(r,n)}o(XR,"verify");Gt.verify=XR;function ZR(t){let e=[Ge(),Ge(),Ge(),Ge()];if(ox(e,t))throw new Error("Ed25519: invalid public key");let r=Ge(),n=Ge(),i=e[1];Ra(r,ec,i),Pa(n,ec,i),tx(n,n),Yt(r,r,n);let a=new Uint8Array(32);return Eu(a,r),a}o(ZR,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=ZR;function QR(t){let e=(0,_u.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(e.subarray(0,32));return(0,X6.wipe)(e),r}o(QR,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=QR});var ax=De((YK,sx)=>{"use strict";sx.exports=o(function t(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((r,n,i)=>{let a=i===0?"":",",c=n===void 0||typeof n=="symbol"?null:n;return r+a+t(c)},"")+"]":"{"+Object.keys(e).sort().reduce((r,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return r;let a=r.length===0?"":",";return r+a+t(n)+":"+t(e[n])},"")+"}"},"serialize")});var lx=De(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.sharedKey=lr.generateKeyPair=lr.generateKeyPairFromSeed=lr.scalarMultBase=lr.scalarMult=lr.SHARED_KEY_LENGTH=lr.SECRET_KEY_LENGTH=lr.PUBLIC_KEY_LENGTH=void 0;var eN=Oa(),tN=hi();lr.PUBLIC_KEY_LENGTH=32;lr.SECRET_KEY_LENGTH=32;lr.SHARED_KEY_LENGTH=32;function lo(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}o(lo,"gf");var fx=new Uint8Array(32);fx[0]=9;var rN=lo([56129,1]);function E1(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}o(E1,"car25519");function Su(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let a=n&(t[i]^e[i]);t[i]^=a,e[i]^=a}}o(Su,"sel25519");function nN(t,e){let r=lo(),n=lo();for(let i=0;i<16;i++)n[i]=e[i];E1(n),E1(n),E1(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let a=r[15]>>16&1;r[14]&=65535,Su(n,r,1-a)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}o(nN,"pack25519");function iN(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(iN,"unpack25519");function sd(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(sd,"add");function ad(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(ad,"sub");function Vo(t,e,r){let n,i,a=0,c=0,u=0,m=0,v=0,x=0,S=0,O=0,R=0,D=0,P=0,J=0,L=0,W=0,Q=0,Y=0,oe=0,j=0,H=0,G=0,le=0,T=0,h=0,y=0,b=0,l=0,p=0,_=0,A=0,E=0,g=0,C=r[0],N=r[1],w=r[2],k=r[3],he=r[4],I=r[5],Z=r[6],se=r[7],q=r[8],F=r[9],ee=r[10],ne=r[11],ae=r[12],Ae=r[13],ge=r[14],re=r[15];n=e[0],a+=n*C,c+=n*N,u+=n*w,m+=n*k,v+=n*he,x+=n*I,S+=n*Z,O+=n*se,R+=n*q,D+=n*F,P+=n*ee,J+=n*ne,L+=n*ae,W+=n*Ae,Q+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*N,m+=n*w,v+=n*k,x+=n*he,S+=n*I,O+=n*Z,R+=n*se,D+=n*q,P+=n*F,J+=n*ee,L+=n*ne,W+=n*ae,Q+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,m+=n*N,v+=n*w,x+=n*k,S+=n*he,O+=n*I,R+=n*Z,D+=n*se,P+=n*q,J+=n*F,L+=n*ee,W+=n*ne,Q+=n*ae,Y+=n*Ae,oe+=n*ge,j+=n*re,n=e[3],m+=n*C,v+=n*N,x+=n*w,S+=n*k,O+=n*he,R+=n*I,D+=n*Z,P+=n*se,J+=n*q,L+=n*F,W+=n*ee,Q+=n*ne,Y+=n*ae,oe+=n*Ae,j+=n*ge,H+=n*re,n=e[4],v+=n*C,x+=n*N,S+=n*w,O+=n*k,R+=n*he,D+=n*I,P+=n*Z,J+=n*se,L+=n*q,W+=n*F,Q+=n*ee,Y+=n*ne,oe+=n*ae,j+=n*Ae,H+=n*ge,G+=n*re,n=e[5],x+=n*C,S+=n*N,O+=n*w,R+=n*k,D+=n*he,P+=n*I,J+=n*Z,L+=n*se,W+=n*q,Q+=n*F,Y+=n*ee,oe+=n*ne,j+=n*ae,H+=n*Ae,G+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*N,R+=n*w,D+=n*k,P+=n*he,J+=n*I,L+=n*Z,W+=n*se,Q+=n*q,Y+=n*F,oe+=n*ee,j+=n*ne,H+=n*ae,G+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*N,D+=n*w,P+=n*k,J+=n*he,L+=n*I,W+=n*Z,Q+=n*se,Y+=n*q,oe+=n*F,j+=n*ee,H+=n*ne,G+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,D+=n*N,P+=n*w,J+=n*k,L+=n*he,W+=n*I,Q+=n*Z,Y+=n*se,oe+=n*q,j+=n*F,H+=n*ee,G+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,y+=n*re,n=e[9],D+=n*C,P+=n*N,J+=n*w,L+=n*k,W+=n*he,Q+=n*I,Y+=n*Z,oe+=n*se,j+=n*q,H+=n*F,G+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,y+=n*ge,b+=n*re,n=e[10],P+=n*C,J+=n*N,L+=n*w,W+=n*k,Q+=n*he,Y+=n*I,oe+=n*Z,j+=n*se,H+=n*q,G+=n*F,le+=n*ee,T+=n*ne,h+=n*ae,y+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,L+=n*N,W+=n*w,Q+=n*k,Y+=n*he,oe+=n*I,j+=n*Z,H+=n*se,G+=n*q,le+=n*F,T+=n*ee,h+=n*ne,y+=n*ae,b+=n*Ae,l+=n*ge,p+=n*re,n=e[12],L+=n*C,W+=n*N,Q+=n*w,Y+=n*k,oe+=n*he,j+=n*I,H+=n*Z,G+=n*se,le+=n*q,T+=n*F,h+=n*ee,y+=n*ne,b+=n*ae,l+=n*Ae,p+=n*ge,_+=n*re,n=e[13],W+=n*C,Q+=n*N,Y+=n*w,oe+=n*k,j+=n*he,H+=n*I,G+=n*Z,le+=n*se,T+=n*q,h+=n*F,y+=n*ee,b+=n*ne,l+=n*ae,p+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Q+=n*C,Y+=n*N,oe+=n*w,j+=n*k,H+=n*he,G+=n*I,le+=n*Z,T+=n*se,h+=n*q,y+=n*F,b+=n*ee,l+=n*ne,p+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*N,j+=n*w,H+=n*k,G+=n*he,le+=n*I,T+=n*Z,h+=n*se,y+=n*q,b+=n*F,l+=n*ee,p+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*j,u+=38*H,m+=38*G,v+=38*le,x+=38*T,S+=38*h,O+=38*y,R+=38*b,D+=38*l,P+=38*p,J+=38*_,L+=38*A,W+=38*E,Q+=38*g,i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=L+i+65535,i=Math.floor(n/65536),L=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),t[0]=a,t[1]=c,t[2]=u,t[3]=m,t[4]=v,t[5]=x,t[6]=S,t[7]=O,t[8]=R,t[9]=D,t[10]=P,t[11]=J,t[12]=L,t[13]=W,t[14]=Q,t[15]=Y}o(Vo,"mul");function Mu(t,e){Vo(t,e,e)}o(Mu,"square");function oN(t,e){let r=lo();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)Mu(r,r),n!==2&&n!==4&&Vo(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}o(oN,"inv25519");function A1(t,e){let r=new Uint8Array(32),n=new Float64Array(80),i=lo(),a=lo(),c=lo(),u=lo(),m=lo(),v=lo();for(let R=0;R<31;R++)r[R]=t[R];r[31]=t[31]&127|64,r[0]&=248,iN(n,e);for(let R=0;R<16;R++)a[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let D=r[R>>>3]>>>(R&7)&1;Su(i,a,D),Su(c,u,D),sd(m,i,c),ad(i,i,c),sd(c,a,u),ad(a,a,u),Mu(u,m),Mu(v,i),Vo(i,c,i),Vo(c,a,m),sd(m,i,c),ad(i,i,c),Mu(a,i),ad(c,u,v),Vo(i,c,rN),sd(i,i,u),Vo(c,c,i),Vo(i,u,v),Vo(u,a,n),Mu(a,m),Su(i,a,D),Su(c,u,D)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=c[R],n[R+48]=a[R],n[R+64]=u[R];let x=n.subarray(32),S=n.subarray(16);oN(x,x),Vo(S,S,x);let O=new Uint8Array(32);return nN(O,S),O}o(A1,"scalarMult");lr.scalarMult=A1;function cx(t){return A1(t,fx)}o(cx,"scalarMultBase");lr.scalarMultBase=cx;function ux(t){if(t.length!==lr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${lr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(t);return{publicKey:cx(e),secretKey:e}}o(ux,"generateKeyPairFromSeed");lr.generateKeyPairFromSeed=ux;function sN(t){let e=(0,eN.randomBytes)(32,t),r=ux(e);return(0,tN.wipe)(e),r}o(sN,"generateKeyPair");lr.generateKeyPair=sN;function aN(t,e,r=!1){if(t.length!==lr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==lr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=A1(t,e);if(r){let i=0;for(let a=0;a<n.length;a++)i|=n[a];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(aN,"sharedKey");lr.sharedKey=aN});var M1=De(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var Wr=Sa(),S1=hi(),fN=20;function cN(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],m=r[7]<<24|r[6]<<16|r[5]<<8|r[4],v=r[11]<<24|r[10]<<16|r[9]<<8|r[8],x=r[15]<<24|r[14]<<16|r[13]<<8|r[12],S=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],D=r[31]<<24|r[30]<<16|r[29]<<8|r[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],J=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],W=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Q=n,Y=i,oe=a,j=c,H=u,G=m,le=v,T=x,h=S,y=O,b=R,l=D,p=P,_=J,A=L,E=W,g=0;g<fN;g+=2)Q=Q+H|0,p^=Q,p=p>>>32-16|p<<16,h=h+p|0,H^=h,H=H>>>32-12|H<<12,Y=Y+G|0,_^=Y,_=_>>>32-16|_<<16,y=y+_|0,G^=y,G=G>>>32-12|G<<12,oe=oe+le|0,A^=oe,A=A>>>32-16|A<<16,b=b+A|0,le^=b,le=le>>>32-12|le<<12,j=j+T|0,E^=j,E=E>>>32-16|E<<16,l=l+E|0,T^=l,T=T>>>32-12|T<<12,oe=oe+le|0,A^=oe,A=A>>>32-8|A<<8,b=b+A|0,le^=b,le=le>>>32-7|le<<7,j=j+T|0,E^=j,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+G|0,_^=Y,_=_>>>32-8|_<<8,y=y+_|0,G^=y,G=G>>>32-7|G<<7,Q=Q+H|0,p^=Q,p=p>>>32-8|p<<8,h=h+p|0,H^=h,H=H>>>32-7|H<<7,Q=Q+G|0,E^=Q,E=E>>>32-16|E<<16,b=b+E|0,G^=b,G=G>>>32-12|G<<12,Y=Y+le|0,p^=Y,p=p>>>32-16|p<<16,l=l+p|0,le^=l,le=le>>>32-12|le<<12,oe=oe+T|0,_^=oe,_=_>>>32-16|_<<16,h=h+_|0,T^=h,T=T>>>32-12|T<<12,j=j+H|0,A^=j,A=A>>>32-16|A<<16,y=y+A|0,H^=y,H=H>>>32-12|H<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,j=j+H|0,A^=j,A=A>>>32-8|A<<8,y=y+A|0,H^=y,H=H>>>32-7|H<<7,Y=Y+le|0,p^=Y,p=p>>>32-8|p<<8,l=l+p|0,le^=l,le=le>>>32-7|le<<7,Q=Q+G|0,E^=Q,E=E>>>32-8|E<<8,b=b+E|0,G^=b,G=G>>>32-7|G<<7;Wr.writeUint32LE(Q+n|0,t,0),Wr.writeUint32LE(Y+i|0,t,4),Wr.writeUint32LE(oe+a|0,t,8),Wr.writeUint32LE(j+c|0,t,12),Wr.writeUint32LE(H+u|0,t,16),Wr.writeUint32LE(G+m|0,t,20),Wr.writeUint32LE(le+v|0,t,24),Wr.writeUint32LE(T+x|0,t,28),Wr.writeUint32LE(h+S|0,t,32),Wr.writeUint32LE(y+O|0,t,36),Wr.writeUint32LE(b+R|0,t,40),Wr.writeUint32LE(l+D|0,t,44),Wr.writeUint32LE(p+P|0,t,48),Wr.writeUint32LE(_+J|0,t,52),Wr.writeUint32LE(A+L|0,t,56),Wr.writeUint32LE(E+W|0,t,60)}o(cN,"core");function hx(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),m=0;m<r.length;m+=64){cN(u,a,t);for(var v=m;v<m+64&&v<r.length;v++)n[v]=r[v]^u[v-m];lN(a,0,c)}return S1.wipe(u),i===0&&S1.wipe(a),n}o(hx,"streamXOR");fd.streamXOR=hx;function uN(t,e,r,n){return n===void 0&&(n=0),S1.wipe(r),hx(t,e,r,r,n)}o(uN,"stream");fd.stream=uN;function lN(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(lN,"incrementCounter")});var bx=De(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});var Ps=Sa(),dx=hi(),hN=M1(),dN=20;function px(t,e,r,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=mx(t,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var c=hN.streamXOR(i,a,r,n);return dx.wipe(i),c}o(px,"streamXOR");Tu.streamXOR=px;function pN(t,e,r){return dx.wipe(r),px(t,e,r,r)}o(pN,"stream");Tu.stream=pN;function mx(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],m=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],x=t[15]<<24|t[14]<<16|t[13]<<8|t[12],S=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],D=t[31]<<24|t[30]<<16|t[29]<<8|t[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],J=e[7]<<24|e[6]<<16|e[5]<<8|e[4],L=e[11]<<24|e[10]<<16|e[9]<<8|e[8],W=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Q=n,Y=i,oe=a,j=c,H=u,G=m,le=v,T=x,h=S,y=O,b=R,l=D,p=P,_=J,A=L,E=W,g=0;g<dN;g+=2)Q=Q+H|0,p^=Q,p=p>>>32-16|p<<16,h=h+p|0,H^=h,H=H>>>32-12|H<<12,Y=Y+G|0,_^=Y,_=_>>>32-16|_<<16,y=y+_|0,G^=y,G=G>>>32-12|G<<12,oe=oe+le|0,A^=oe,A=A>>>32-16|A<<16,b=b+A|0,le^=b,le=le>>>32-12|le<<12,j=j+T|0,E^=j,E=E>>>32-16|E<<16,l=l+E|0,T^=l,T=T>>>32-12|T<<12,oe=oe+le|0,A^=oe,A=A>>>32-8|A<<8,b=b+A|0,le^=b,le=le>>>32-7|le<<7,j=j+T|0,E^=j,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+G|0,_^=Y,_=_>>>32-8|_<<8,y=y+_|0,G^=y,G=G>>>32-7|G<<7,Q=Q+H|0,p^=Q,p=p>>>32-8|p<<8,h=h+p|0,H^=h,H=H>>>32-7|H<<7,Q=Q+G|0,E^=Q,E=E>>>32-16|E<<16,b=b+E|0,G^=b,G=G>>>32-12|G<<12,Y=Y+le|0,p^=Y,p=p>>>32-16|p<<16,l=l+p|0,le^=l,le=le>>>32-12|le<<12,oe=oe+T|0,_^=oe,_=_>>>32-16|_<<16,h=h+_|0,T^=h,T=T>>>32-12|T<<12,j=j+H|0,A^=j,A=A>>>32-16|A<<16,y=y+A|0,H^=y,H=H>>>32-12|H<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,j=j+H|0,A^=j,A=A>>>32-8|A<<8,y=y+A|0,H^=y,H=H>>>32-7|H<<7,Y=Y+le|0,p^=Y,p=p>>>32-8|p<<8,l=l+p|0,le^=l,le=le>>>32-7|le<<7,Q=Q+G|0,E^=Q,E=E>>>32-8|E<<8,b=b+E|0,G^=b,G=G>>>32-7|G<<7;return Ps.writeUint32LE(Q,r,0),Ps.writeUint32LE(Y,r,4),Ps.writeUint32LE(oe,r,8),Ps.writeUint32LE(j,r,12),Ps.writeUint32LE(p,r,16),Ps.writeUint32LE(_,r,20),Ps.writeUint32LE(A,r,24),Ps.writeUint32LE(E,r,28),r}o(mx,"hchacha");Tu.hchacha=mx});var T1=De(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});function mN(t,e,r){return~(t-1)&e|t-1&r}o(mN,"select");tc.select=mN;function bN(t,e){return(t|0)-(e|0)-1>>>31&1}o(bN,"lessOrEqual");tc.lessOrEqual=bN;function gx(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}o(gx,"compare");tc.compare=gx;function gN(t,e){return t.length===0||e.length===0?!1:gx(t,e)!==0}o(gN,"equal");tc.equal=gN});var yx=De(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var vN=T1(),cd=hi();Wo.DIGEST_LENGTH=16;var vx=function(){function t(e){this.digestLength=Wo.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 r=e[0]|e[1]<<8;this._r[0]=r&8191;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var a=e[6]|e[7]<<8;this._r[3]=(i>>>7|a<<9)&8191;var c=e[8]|e[9]<<8;this._r[4]=(a>>>4|c<<12)&255,this._r[5]=c>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(c>>>14|u<<2)&8191;var m=e[12]|e[13]<<8;this._r[7]=(u>>>11|m<<5)&8065;var v=e[14]|e[15]<<8;this._r[8]=(m>>>8|v<<8)&8191,this._r[9]=v>>>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(t,"Poly1305"),t.prototype._blocks=function(e,r,n){for(var i=this._fin?0:2048,a=this._h[0],c=this._h[1],u=this._h[2],m=this._h[3],v=this._h[4],x=this._h[5],S=this._h[6],O=this._h[7],R=this._h[8],D=this._h[9],P=this._r[0],J=this._r[1],L=this._r[2],W=this._r[3],Q=this._r[4],Y=this._r[5],oe=this._r[6],j=this._r[7],H=this._r[8],G=this._r[9];n>=16;){var le=e[r+0]|e[r+1]<<8;a+=le&8191;var T=e[r+2]|e[r+3]<<8;c+=(le>>>13|T<<3)&8191;var h=e[r+4]|e[r+5]<<8;u+=(T>>>10|h<<6)&8191;var y=e[r+6]|e[r+7]<<8;m+=(h>>>7|y<<9)&8191;var b=e[r+8]|e[r+9]<<8;v+=(y>>>4|b<<12)&8191,x+=b>>>1&8191;var l=e[r+10]|e[r+11]<<8;S+=(b>>>14|l<<2)&8191;var p=e[r+12]|e[r+13]<<8;O+=(l>>>11|p<<5)&8191;var _=e[r+14]|e[r+15]<<8;R+=(p>>>8|_<<8)&8191,D+=_>>>5|i;var A=0,E=A;E+=a*P,E+=c*(5*G),E+=u*(5*H),E+=m*(5*j),E+=v*(5*oe),A=E>>>13,E&=8191,E+=x*(5*Y),E+=S*(5*Q),E+=O*(5*W),E+=R*(5*L),E+=D*(5*J),A+=E>>>13,E&=8191;var g=A;g+=a*J,g+=c*P,g+=u*(5*G),g+=m*(5*H),g+=v*(5*j),A=g>>>13,g&=8191,g+=x*(5*oe),g+=S*(5*Y),g+=O*(5*Q),g+=R*(5*W),g+=D*(5*L),A+=g>>>13,g&=8191;var C=A;C+=a*L,C+=c*J,C+=u*P,C+=m*(5*G),C+=v*(5*H),A=C>>>13,C&=8191,C+=x*(5*j),C+=S*(5*oe),C+=O*(5*Y),C+=R*(5*Q),C+=D*(5*W),A+=C>>>13,C&=8191;var N=A;N+=a*W,N+=c*L,N+=u*J,N+=m*P,N+=v*(5*G),A=N>>>13,N&=8191,N+=x*(5*H),N+=S*(5*j),N+=O*(5*oe),N+=R*(5*Y),N+=D*(5*Q),A+=N>>>13,N&=8191;var w=A;w+=a*Q,w+=c*W,w+=u*L,w+=m*J,w+=v*P,A=w>>>13,w&=8191,w+=x*(5*G),w+=S*(5*H),w+=O*(5*j),w+=R*(5*oe),w+=D*(5*Y),A+=w>>>13,w&=8191;var k=A;k+=a*Y,k+=c*Q,k+=u*W,k+=m*L,k+=v*J,A=k>>>13,k&=8191,k+=x*P,k+=S*(5*G),k+=O*(5*H),k+=R*(5*j),k+=D*(5*oe),A+=k>>>13,k&=8191;var he=A;he+=a*oe,he+=c*Y,he+=u*Q,he+=m*W,he+=v*L,A=he>>>13,he&=8191,he+=x*J,he+=S*P,he+=O*(5*G),he+=R*(5*H),he+=D*(5*j),A+=he>>>13,he&=8191;var I=A;I+=a*j,I+=c*oe,I+=u*Y,I+=m*Q,I+=v*W,A=I>>>13,I&=8191,I+=x*L,I+=S*J,I+=O*P,I+=R*(5*G),I+=D*(5*H),A+=I>>>13,I&=8191;var Z=A;Z+=a*H,Z+=c*j,Z+=u*oe,Z+=m*Y,Z+=v*Q,A=Z>>>13,Z&=8191,Z+=x*W,Z+=S*L,Z+=O*J,Z+=R*P,Z+=D*(5*G),A+=Z>>>13,Z&=8191;var se=A;se+=a*G,se+=c*H,se+=u*j,se+=m*oe,se+=v*Y,A=se>>>13,se&=8191,se+=x*Q,se+=S*W,se+=O*L,se+=R*J,se+=D*P,A+=se>>>13,se&=8191,A=(A<<2)+A|0,A=A+E|0,E=A&8191,A=A>>>13,g+=A,a=E,c=g,u=C,m=N,v=w,x=k,S=he,O=I,R=Z,D=se,r+=16,n-=16}this._h[0]=a,this._h[1]=c,this._h[2]=u,this._h[3]=m,this._h[4]=v,this._h[5]=x,this._h[6]=S,this._h[7]=O,this._h[8]=R,this._h[9]=D},t.prototype.finish=function(e,r){r===void 0&&(r=0);var n=new Uint16Array(10),i,a,c,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,a=(i^1)-1,u=0;u<10;u++)n[u]&=a;for(a=~a,u=0;u<10;u++)this._h[u]=this._h[u]&a|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,c=this._h[0]+this._pad[0],this._h[0]=c&65535,u=1;u<8;u++)c=(this._h[u]+this._pad[u]|0)+(c>>>16)|0,this._h[u]=c&65535;return e[r+0]=this._h[0]>>>0,e[r+1]=this._h[0]>>>8,e[r+2]=this._h[1]>>>0,e[r+3]=this._h[1]>>>8,e[r+4]=this._h[2]>>>0,e[r+5]=this._h[2]>>>8,e[r+6]=this._h[3]>>>0,e[r+7]=this._h[3]>>>8,e[r+8]=this._h[4]>>>0,e[r+9]=this._h[4]>>>8,e[r+10]=this._h[5]>>>0,e[r+11]=this._h[5]>>>8,e[r+12]=this._h[6]>>>0,e[r+13]=this._h[6]>>>8,e[r+14]=this._h[7]>>>0,e[r+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var r=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var a=0;a<i;a++)this._buffer[this._leftover+a]=e[r+a];if(n-=i,r+=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,r,i),r+=i,n-=i),n){for(var a=0;a<n;a++)this._buffer[this._leftover+a]=e[r+a];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return cd.wipe(this._buffer),cd.wipe(this._r),cd.wipe(this._h),cd.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();Wo.Poly1305=vx;function yN(t,e){var r=new vx(t);r.update(e);var n=r.digest();return r.clean(),n}o(yN,"oneTimeAuth");Wo.oneTimeAuth=yN;function xN(t,e){return t.length!==Wo.DIGEST_LENGTH||e.length!==Wo.DIGEST_LENGTH?!1:vN.equal(t,e)}o(xN,"equal");Wo.equal=xN});var _x=De(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var ud=M1(),wN=yx(),Cu=hi(),xx=Sa(),_N=T1();Jo.KEY_LENGTH=32;Jo.NONCE_LENGTH=12;Jo.TAG_LENGTH=16;var wx=new Uint8Array(16),EN=function(){function t(e){if(this.nonceLength=Jo.NONCE_LENGTH,this.tagLength=Jo.TAG_LENGTH,e.length!==Jo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(t,"ChaCha20Poly1305"),t.prototype.seal=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);ud.stream(this._key,a,c,4);var u=r.length+this.tagLength,m;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");m=i}else m=new Uint8Array(u);return ud.streamXOR(this._key,a,r,m,4),this._authenticate(m.subarray(m.length-this.tagLength,m.length),c,m.subarray(0,m.length-this.tagLength),n),Cu.wipe(a),m},t.prototype.open=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);ud.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,r.subarray(0,r.length-this.tagLength),n),!_N.equal(u,r.subarray(r.length-this.tagLength,r.length)))return null;var m=r.length-this.tagLength,v;if(i){if(i.length!==m)throw new Error("ChaCha20Poly1305: incorrect destination length");v=i}else v=new Uint8Array(m);return ud.streamXOR(this._key,a,r.subarray(0,r.length-this.tagLength),v,4),Cu.wipe(a),v},t.prototype.clean=function(){return Cu.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var a=new wN.Poly1305(r);i&&(a.update(i),i.length%16>0&&a.update(wx.subarray(i.length%16))),a.update(n),n.length%16>0&&a.update(wx.subarray(n.length%16));var c=new Uint8Array(8);i&&xx.writeUint64LE(i.length,c),a.update(c),xx.writeUint64LE(n.length,c),a.update(c);for(var u=a.digest(),m=0;m<u.length;m++)e[m]=u[m];a.clean(),Cu.wipe(u),Cu.wipe(c)},t}();Jo.ChaCha20Poly1305=EN});var Sx=De(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var Ex=bx(),Ax=_x(),ku=hi();Yo.KEY_LENGTH=32;Yo.NONCE_LENGTH=24;Yo.TAG_LENGTH=16;var AN=function(){function t(e){if(this.nonceLength=Yo.NONCE_LENGTH,this.tagLength=Yo.TAG_LENGTH,e.length!==Yo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(t,"XChaCha20Poly1305"),t.prototype.seal=function(e,r,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var a=Ex.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new Ax.ChaCha20Poly1305(a),m=u.seal(c,r,n,i);return ku.wipe(a),ku.wipe(c),u.clean(),m},t.prototype.open=function(e,r,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=Ex.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new Ax.ChaCha20Poly1305(a),m=u.open(c,r,n,i);return ku.wipe(a),ku.wipe(c),u.clean(),m},t.prototype.clean=function(){return ku.wipe(this._key),this},t}();Yo.XChaCha20Poly1305=AN});var zi=De((DG,p4)=>{p4.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 $u=De((OG,m4)=>{m4.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 v4=De($r=>{var b4=$r,Cd=4294967292,kd=4294967293,Q1=4294967294,g4=4294967295,Be=[0,1,3,7,15,31,63,127,255,511,1023],$s=["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"],KP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),qn=[];KP.forEach(t=>{qn.push(t.charCodeAt(0))});$r.utf8={encode(t){let e=[];return t.forEach(r=>{if(r>=0&&r<=127)e.push(r);else if(r<=2047)e.push(192+(r>>6&Be[5])),e.push(128+(r&Be[6]));else if(r<55296||r>57343&&r<=65535)e.push(224+(r>>12&Be[4])),e.push(128+(r>>6&Be[6])),e.push(128+(r&Be[6]));else if(r>=65536&&r<=1114111){let n=r>>16&Be[5];e.push(240+(n>>2)),e.push(128+((n&Be[2])<<4)+(r>>12&Be[4])),e.push(128+(r>>6&Be[6])),e.push(128+(r&Be[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${r}`)}),Buffer.from(e)},decode(t,e){function r(D,P){if((P&192)!==128)return kd;let J=((D&Be[5])<<6)+(P&Be[6]);return J<128?Cd:J}o(r,"bytes2");function n(D,P,J){if((J&192)!==128||(P&192)!==128)return kd;let L=((D&Be[4])<<12)+((P&Be[6])<<6)+(J&Be[6]);return L<2048?Cd:L>=55296&&L<=57343?Q1:L}o(n,"bytes3");function i(D,P,J,L){if((L&192)!==128||(J&192)!==128||(P&192)!==128)return kd;let W=(((D&Be[3])<<2)+(P>>4&Be[2])<<16)+((P&Be[4])<<12)+((J&Be[6])<<6)+(L&Be[6]);return W<65536?Cd:W>1114111?Q1:W}o(i,"bytes4");let a,c,u,m,v,x,S=t.length,O=e?3:0,R=[];for(;O<S;){c=t[O],a=g4;let D=!0;for(;D;){if(c>=0&&c<=127){a=c,x=1;break}if(u=O+1,u<S&&c>=194&&c<=223){a=r(c,t[u]),x=2;break}if(m=O+2,m<S&&c>=224&&c<=239){a=n(c,t[u],t[m]),x=3;break}if(v=O+3,v<S&&c>=240&&c<=244){a=i(c,t[u],t[m],t[v]),x=4;break}break}if(a>1114111){let P=`byte[${O}]`;throw a===g4?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${P}`):a===kd?new RangeError(`utf8.decode: illegal trailing byte found at: ${P}`):a===Q1?new RangeError(`utf8.decode: code point out of range found at: ${P}`):a===Cd?new RangeError(`utf8.decode: non-shortest form found at: ${P}`):new RangeError(`utf8.decode: unrecognized error found at: ${P}`)}R.push(a),O+=x}return R}};$r.utf16be={encode(t){let e=[],r,n,i;for(let a=0;a<t.length;a+=1)if(r=t[a],r>=0&&r<=55295||r>=57344&&r<=65535)e.push(r>>8&Be[8]),e.push(r&Be[8]);else if(r>=65536&&r<=1114111)i=r-65536,n=55296+(i>>10),i=56320+(i&Be[10]),e.push(n>>8&Be[8]),e.push(n&Be[8]),e.push(i>>8&Be[8]),e.push(i&Be[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${a}]: ${r}`);return Buffer.from(e)},decode(t,e){if(t.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${t.length}`);let r=[],n=t.length,i=e?2:0,a=0,c,u,m,v,x,S;for(;i<n;){for(;;){if(m=i+1,m<n){if(x=(t[i]<<8)+t[m],x<55296||x>57343){c=x,u=2;break}if(v=i+3,v<n&&(S=(t[i+2]<<8)+t[v],x<=56319&&S>=56320&&S<=57343)){c=65536+(x-55296<<10)+(S-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}r[a++]=c,i+=u}return r}};$r.utf16le={encode(t){let e=[],r,n,i;for(let a=0;a<t.length;a+=1)if(r=t[a],r>=0&&r<=55295||r>=57344&&r<=65535)e.push(r&Be[8]),e.push(r>>8&Be[8]);else if(r>=65536&&r<=1114111)i=r-65536,n=55296+(i>>10),i=56320+(i&Be[10]),e.push(n&Be[8]),e.push(n>>8&Be[8]),e.push(i&Be[8]),e.push(i>>8&Be[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${a}]: ${r}`);return Buffer.from(e)},decode(t,e){if(t.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${t.length}`);let r=[],n=t.length,i=e?2:0,a=0,c,u,m,v,x,S;for(;i<n;){for(;;){if(m=i+1,m<n){if(x=(t[m]<<8)+t[i],x<55296||x>57343){c=x,u=2;break}if(v=i+3,v<n&&(S=(t[v]<<8)+t[i+2],x<=56319&&S>=56320&&S<=57343)){c=65536+(x-55296<<10)+(S-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}r[a++]=c,i+=u}return r}};$r.utf32be={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${r/4}]: ${n}`);e[r++]=n>>24&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t,e){if(t.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${t.length}`);let r=[],n=e?4:0;for(;n<t.length;n+=4){let i=(t[n]<<24)+(t[n+1]<<16)+(t[n+2]<<8)+t[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);r.push(i)}return r}};$r.utf32le={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${n}`);e[r++]=n&Be[8],e[r++]=n>>8&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>24&Be[8]}),e},decode(t,e){if(t.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${t.length}`);let r=[],n=e?4:0;for(;n<t.length;n+=4){let i=(t[n+3]<<24)+(t[n+2]<<16)+(t[n+1]<<8)+t[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);r.push(i)}return r}};$r.uint7={encode(t){let e=Buffer.alloc(t.length);for(let r=0;r<t.length;r+=1){if(t[r]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${r}]: ${t[r]}`);e[r]=t[r]}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=1){if(t[r]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${r}]: ${t[r]}`);e[r]=t[r]}return e}};$r.uint8={encode(t){let e=Buffer.alloc(t.length);for(let r=0;r<t.length;r+=1){if(t[r]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${r}]: ${t[r]}`);e[r]=t[r]}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=1)e[r]=t[r];return e}};$r.uint16be={encode(t){let e=Buffer.alloc(t.length*2),r=0;return t.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${r/2}]: ${n}`);e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t){if(t.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=2)e.push((t[r]<<8)+t[r+1]);return e}};$r.uint16le={encode(t){let e=Buffer.alloc(t.length*2),r=0;return t.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${r/2}]: ${n}`);e[r++]=n&Be[8],e[r++]=n>>8&Be[8]}),e},decode(t){if(t.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=2)e.push((t[r+1]<<8)+t[r]);return e}};$r.uint32be={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{e[r++]=n>>24&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t){if(t.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=4)e.push((t[r]<<24)+(t[r+1]<<16)+(t[r+2]<<8)+t[r+3]);return e}};$r.uint32le={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{e[r++]=n&Be[8],e[r++]=n>>8&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>24&Be[8]}),e},decode(t){if(t.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=4)e.push((t[r+3]<<24)+(t[r+2]<<16)+(t[r+1]<<8)+t[r]);return e}};$r.string={encode(t){return b4.utf16le.encode(t).toString("utf16le")},decode(t){return b4.utf16le.decode(Buffer.from(t,"utf16le"),0)}};$r.escaped={encode(t){let e=[];for(let r=0;r<t.length;r+=1){let n=t[r];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${$s[n]}`;else if(n>=127&&n<=255)i+=`\`x${$s[n]}`;else if(n>=256&&n<=65535)i+=`\`u${$s[n>>8&Be[8]]}${$s[n&Be[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let c=n>>24&Be[8];c>0&&(i+=$s[c]),i+=`${$s[n>>16&Be[8]]+$s[n>>8&Be[8]]+$s[n&Be[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(c=>{e.push(c)})}}return Buffer.from(e)},decode(t){function e(S){return S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102}o(e,"isHex");function r(S,O,R){let D={char:null,nexti:S+2,error:!0};if(S+1<O&&e(R[S])&&e(R[S+1])){let P=String.fromCodePoint(R[S],R[S+1]);D.char=parseInt(P,16),Number.isNaN(D.char)||(D.error=!1)}return D}o(r,"getx");function n(S,O,R){let D={char:null,nexti:S+4,error:!0};if(S+3<O&&e(R[S])&&e(R[S+1])&&e(R[S+2])&&e(R[S+3])){let P=String.fromCodePoint(R[S],R[S+1],R[S+2],R[S+3]);D.char=parseInt(P,16),Number.isNaN(D.char)||(D.error=!1)}return D}o(n,"getu");function i(S,O,R){let D={char:null,nexti:S+4,error:!0},P="";for(;S<O&&e(R[S]);)P+=String.fromCodePoint(R[S]),S+=1;return D.char=parseInt(P,16),R[S]===125&&!Number.isNaN(D.char)&&(D.error=!1),D.nexti=S+1,D}o(i,"getU");let a=[],c=t.length,u,m,v,x=0;for(;x<c;){for(;;){if(v=!0,t[x]!==96){a.push(t[x]),x+=1,v=!1;break}if(u=x+1,u>=c)break;if(t[u]===96){a.push(96),x+=2,v=!1;break}if(t[u]===120){if(m=r(u+1,c,t),m.error)break;a.push(m.char),x=m.nexti,v=!1;break}if(t[u]===117){if(t[u+1]===123){if(m=i(u+2,c,t),m.error)break;a.push(m.char),x=m.nexti,v=!1;break}if(m=n(u+1,c,t),m.error)break;a.push(m.char),x=m.nexti,v=!1;break}break}if(v)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${x}]`)}return a}};var Fu=13,yi=10;$r.lineEnds={crlf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Fu:r+1<t.length&&t[r+1]===yi?r+=2:r+=1,e.push(Fu),e.push(yi);break;case yi:e.push(Fu),e.push(yi),r+=1;break;default:e.push(t[r]),r+=1;break}return e.length>0&&e[e.length-1]!==yi&&(e.push(Fu),e.push(yi)),e},lf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Fu:r+1<t.length&&t[r+1]===yi?r+=2:r+=1,e.push(yi);break;case yi:e.push(yi),r+=1;break;default:e.push(t[r]),r+=1;break}return e.length>0&&e[e.length-1]!==yi&&e.push(yi),e}};$r.base64={encode(t){if(t.length===0)return Buffer.alloc(0);let e,r,n,i=t.length%3;i=i>0?3-i:0;let a=(t.length+i)/3,c=Buffer.alloc(a*4);i>0&&(a-=1),e=0,r=0;for(let u=0;u<a;u+=1)n=t[e++]<<16,n+=t[e++]<<8,n+=t[e++],c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[n>>6&Be[6]],c[r++]=qn[n&Be[6]];if(i===0)return c;if(i===1)return n=t[e++]<<16,n+=t[e]<<8,c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[n>>6&Be[6]],c[r]=qn[64],c;if(i===2)return n=t[e]<<16,c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[64],c[r]=qn[64],c},decode(t){function e(x){let S=[],O=0;for(let R=0;R<x.length;R+=1){let D=x[R],P=!0;for(;P&&!(D===32||D===9||D===10||D===13);){if(D>=65&&D<=90){S.push(D-65);break}if(D>=97&&D<=122){S.push(D-71);break}if(D>=48&&D<=57){S.push(D+4);break}if(D===43){S.push(62);break}if(D===47){S.push(63);break}if(D===61){S.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${D}`)}}if(S.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${S.length}`);switch(O){case 0:break;case 1:if(S[S.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(S[S.length-1]!==64||S[S.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:Buffer.from(S)}}if(o(e,"validate"),t.length===0)return Buffer.alloc(0);let r=e(t),{tail:n}=r,i=r.buf,a,c,u,m=i.length/4,v=Buffer.alloc(m*3-n);n>0&&(m-=1),c=0,a=0;for(let x=0;x<m;x+=1)u=i[a++]<<18,u+=i[a++]<<12,u+=i[a++]<<6,u+=i[a++],v[c++]=u>>16&Be[8],v[c++]=u>>8&Be[8],v[c++]=u&Be[8];return n===1&&(u=i[a++]<<18,u+=i[a++]<<12,u+=i[a]<<6,v[c++]=u>>16&Be[8],v[c]=u>>8&Be[8]),n===2&&(u=i[a++]<<18,u+=i[a++]<<12,v[c]=u>>16&Be[8]),v},toString(t){if(t.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${t.length}`);let e="",r=0;function n(a,c,u,m){switch(r){case 76:e+=`\r
|
|
34
|
+
`});var Om=jt(()=>{Pi();Ch();As();Cm();Aa()});var pu,qz,Rm=jt(()=>{Ny();Py();Ly();By();Uy();wm();Uf();Sh();Mh();Fy();hu();Dm();Yy();Xy();Om();pu={...mm,...bm,...gm,...vm,...ym,...xm,..._m,...Em,...Am,...Sm},qz={...km,...Im}});function t3(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var e3,Nm,uD,Nh,Pm=jt(()=>{Rm();xh();o(t3,"createCodec");e3=t3("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),Nm=t3("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=fu(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),uD={utf8:e3,"utf-8":e3,hex:pu.base16,latin1:Nm,ascii:Nm,binary:Nm,...pu},Nh=uD});var r3={};Jt(r3,{fromString:()=>Ot});function Ot(t,e="utf8"){let r=Nh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?wa(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var mu=jt(()=>{Pm();au();o(Ot,"fromString")});var n3={};Jt(n3,{toString:()=>kt});function kt(t,e="utf8"){let r=Nh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var qf=jt(()=>{Pm();o(kt,"toString")});var i3=De(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});function lD(t,e){var r=t>>>16&65535,n=t&65535,i=e>>>16&65535,a=e&65535;return n*a+(r*a+n*i<<16>>>0)|0}o(lD,"imulShim");Pn.mul=Math.imul||lD;function hD(t,e){return t+e|0}o(hD,"add");Pn.add=hD;function dD(t,e){return t-e|0}o(dD,"sub");Pn.sub=dD;function pD(t,e){return t<<e|t>>>32-e}o(pD,"rotl");Pn.rotl=pD;function mD(t,e){return t<<32-e|t>>>e}o(mD,"rotr");Pn.rotr=mD;function bD(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}o(bD,"isIntegerShim");Pn.isInteger=Number.isInteger||bD;Pn.MAX_SAFE_INTEGER=9007199254740991;Pn.isSafeInteger=function(t){return Pn.isInteger(t)&&t>=-Pn.MAX_SAFE_INTEGER&&t<=Pn.MAX_SAFE_INTEGER}});var Sa=De(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});var o3=i3();function gD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}o(gD,"readInt16BE");Mt.readInt16BE=gD;function vD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}o(vD,"readUint16BE");Mt.readUint16BE=vD;function yD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}o(yD,"readInt16LE");Mt.readInt16LE=yD;function xD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}o(xD,"readUint16LE");Mt.readUint16LE=xD;function s3(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}o(s3,"writeUint16BE");Mt.writeUint16BE=s3;Mt.writeInt16BE=s3;function a3(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}o(a3,"writeUint16LE");Mt.writeUint16LE=a3;Mt.writeInt16LE=a3;function Lm(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}o(Lm,"readInt32BE");Mt.readInt32BE=Lm;function Bm(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}o(Bm,"readUint32BE");Mt.readUint32BE=Bm;function Um(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}o(Um,"readInt32LE");Mt.readInt32LE=Um;function $m(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}o($m,"readUint32LE");Mt.readUint32LE=$m;function Ph(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}o(Ph,"writeUint32BE");Mt.writeUint32BE=Ph;Mt.writeInt32BE=Ph;function Lh(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}o(Lh,"writeUint32LE");Mt.writeUint32LE=Lh;Mt.writeInt32LE=Lh;function wD(t,e){e===void 0&&(e=0);var r=Lm(t,e),n=Lm(t,e+4);return r*4294967296+n-(n>>31)*4294967296}o(wD,"readInt64BE");Mt.readInt64BE=wD;function _D(t,e){e===void 0&&(e=0);var r=Bm(t,e),n=Bm(t,e+4);return r*4294967296+n}o(_D,"readUint64BE");Mt.readUint64BE=_D;function ED(t,e){e===void 0&&(e=0);var r=Um(t,e),n=Um(t,e+4);return n*4294967296+r-(r>>31)*4294967296}o(ED,"readInt64LE");Mt.readInt64LE=ED;function AD(t,e){e===void 0&&(e=0);var r=$m(t,e),n=$m(t,e+4);return n*4294967296+r}o(AD,"readUint64LE");Mt.readUint64LE=AD;function f3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Ph(t/4294967296>>>0,e,r),Ph(t>>>0,e,r+4),e}o(f3,"writeUint64BE");Mt.writeUint64BE=f3;Mt.writeInt64BE=f3;function c3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Lh(t>>>0,e,r),Lh(t/4294967296>>>0,e,r+4),e}o(c3,"writeUint64LE");Mt.writeUint64LE=c3;Mt.writeInt64LE=c3;function SD(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}o(SD,"readUintBE");Mt.readUintBE=SD;function MD(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}o(MD,"readUintLE");Mt.readUintLE=MD;function TD(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!o3.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}o(TD,"writeUintBE");Mt.writeUintBE=TD;function CD(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!o3.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}o(CD,"writeUintLE");Mt.writeUintLE=CD;function kD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}o(kD,"readFloat32BE");Mt.readFloat32BE=kD;function ID(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}o(ID,"readFloat32LE");Mt.readFloat32LE=ID;function DD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}o(DD,"readFloat64BE");Mt.readFloat64BE=DD;function OD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}o(OD,"readFloat64LE");Mt.readFloat64LE=OD;function RD(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}o(RD,"writeFloat32BE");Mt.writeFloat32BE=RD;function ND(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}o(ND,"writeFloat32LE");Mt.writeFloat32LE=ND;function PD(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}o(PD,"writeFloat64BE");Mt.writeFloat64BE=PD;function LD(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}o(LD,"writeFloat64LE");Mt.writeFloat64LE=LD});var hi=De(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});function BD(t){for(var e=0;e<t.length;e++)t[e]=0;return t}o(BD,"wipe");Fm.wipe=BD});var l3=De(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});var Uh=Sa(),Bh=hi();Ts.DIGEST_LENGTH=32;Ts.BLOCK_SIZE=64;var u3=function(){function t(){this.digestLength=Ts.DIGEST_LENGTH,this.blockSize=Ts.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(t,"SHA256"),t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Bh.wipe(this._buffer),Bh.wipe(this._temp),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(qm(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=qm(this._temp,this._state,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,a=r<<3,c=r%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u<c-8;u++)this._buffer[u]=0;Uh.writeUint32BE(i,this._buffer,c-8),Uh.writeUint32BE(a,this._buffer,c-4),qm(this._temp,this._state,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)Uh.writeUint32BE(this._state[u],e,u*4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.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},t.prototype.cleanSavedState=function(e){Bh.wipe(e.state),e.buffer&&Bh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Ts.SHA256=u3;var UD=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 qm(t,e,r,n,i){for(;i>=64;){for(var a=e[0],c=e[1],u=e[2],m=e[3],v=e[4],x=e[5],S=e[6],O=e[7],R=0;R<16;R++){var D=n+R*4;t[R]=Uh.readUint32BE(r,D)}for(var R=16;R<64;R++){var P=t[R-2],J=(P>>>17|P<<32-17)^(P>>>19|P<<32-19)^P>>>10;P=t[R-15];var B=(P>>>7|P<<32-7)^(P>>>18|P<<32-18)^P>>>3;t[R]=(J+t[R-7]|0)+(B+t[R-16]|0)}for(var R=0;R<64;R++){var J=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&x^~v&S)|0)+(O+(UD[R]+t[R]|0)|0)|0,B=((a>>>2|a<<32-2)^(a>>>13|a<<32-13)^(a>>>22|a<<32-22))+(a&c^a&u^c&u)|0;O=S,S=x,x=v,v=m+J|0,m=u,u=c,c=a,a=J+B|0}e[0]+=a,e[1]+=c,e[2]+=u,e[3]+=m,e[4]+=v,e[5]+=x,e[6]+=S,e[7]+=O,n+=64,i-=64}return n}o(qm,"hashBlocks");function $D(t){var e=new u3;e.update(t);var r=e.digest();return e.clean(),r}o($D,"hash");Ts.hash=$D});var Hm=De((lK,$h)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=global:i&&(n=self);var c=!n.JS_SHA3_NO_COMMON_JS&&typeof $h=="object"&&$h.exports,u=typeof define=="function"&&define.amd,m=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),x=[31,7936,2031616,520093696],S=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],D=[0,8,16,24],P=[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],J=[224,256,384,512],B=[128,256],W=["hex","buffer","arrayBuffer","array","digest"],Q={"128":168,"256":136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),m&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(I){return typeof I=="object"&&I.buffer&&I.buffer.constructor===ArrayBuffer});for(var Y=o(function(I,Z,se){return function(q){return new w(I,Z,I).update(q)[se]()}},"createOutputMethod"),oe=o(function(I,Z,se){return function(q,F){return new w(I,Z,F).update(q)[se]()}},"createShakeOutputMethod"),j=o(function(I,Z,se){return function(q,F,ee,ne){return l["cshake"+I].update(q,F,ee,ne)[se]()}},"createCshakeOutputMethod"),H=o(function(I,Z,se){return function(q,F,ee,ne){return l["kmac"+I].update(q,F,ee,ne)[se]()}},"createKmacOutputMethod"),G=o(function(I,Z,se,q){for(var F=0;F<W.length;++F){var ee=W[F];I[ee]=Z(se,q,ee)}return I},"createOutputMethods"),le=o(function(I,Z){var se=Y(I,Z,"hex");return se.create=function(){return new w(I,Z,I)},se.update=function(q){return se.create().update(q)},G(se,Y,I,Z)},"createMethod"),T=o(function(I,Z){var se=oe(I,Z,"hex");return se.create=function(q){return new w(I,Z,q)},se.update=function(q,F){return se.create(F).update(q)},G(se,oe,I,Z)},"createShakeMethod"),h=o(function(I,Z){var se=Q[I],q=j(I,Z,"hex");return q.create=function(F,ee,ne){return!ee&&!ne?l["shake"+I].create(F):new w(I,Z,F).bytepad([ee,ne],se)},q.update=function(F,ee,ne,ae){return q.create(ee,ne,ae).update(F)},G(q,j,I,Z)},"createCshakeMethod"),y=o(function(I,Z){var se=Q[I],q=H(I,Z,"hex");return q.create=function(F,ee,ne){return new k(I,Z,ee).bytepad(["KMAC",ne],se).bytepad([F],se)},q.update=function(F,ee,ne,ae){return q.create(F,ne,ae).update(ee)},G(q,H,I,Z)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:J,createMethod:le},{name:"sha3",padding:R,bits:J,createMethod:le},{name:"shake",padding:x,bits:B,createMethod:T},{name:"cshake",padding:S,bits:B,createMethod:h},{name:"kmac",padding:S,bits:B,createMethod:y}],l={},p=[],_=0;_<b.length;++_)for(var A=b[_],E=A.bits,g=0;g<E.length;++g){var C=A.name+"_"+E[g];if(p.push(C),l[C]=A.createMethod(E[g],A.padding),A.name!=="sha3"){var N=A.name+E[g];p.push(N),l[N]=l[C]}}function w(I,Z,se){this.blocks=[],this.s=[],this.padding=Z,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(I<<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(w,"Keccak"),w.prototype.update=function(I){if(this.finalized)throw new Error(e);var Z,se=typeof I;if(se!=="string"){if(se==="object"){if(I===null)throw new Error(t);if(m&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!m||!ArrayBuffer.isView(I)))throw new Error(t)}else throw new Error(t);Z=!0}for(var q=this.blocks,F=this.byteCount,ee=I.length,ne=this.blockCount,ae=0,Ae=this.s,ge,re;ae<ee;){if(this.reset)for(this.reset=!1,q[0]=this.block,ge=1;ge<ne+1;++ge)q[ge]=0;if(Z)for(ge=this.start;ae<ee&&ge<F;++ae)q[ge>>2]|=I[ae]<<D[ge++&3];else for(ge=this.start;ae<ee&&ge<F;++ae)re=I.charCodeAt(ae),re<128?q[ge>>2]|=re<<D[ge++&3]:re<2048?(q[ge>>2]|=(192|re>>6)<<D[ge++&3],q[ge>>2]|=(128|re&63)<<D[ge++&3]):re<55296||re>=57344?(q[ge>>2]|=(224|re>>12)<<D[ge++&3],q[ge>>2]|=(128|re>>6&63)<<D[ge++&3],q[ge>>2]|=(128|re&63)<<D[ge++&3]):(re=65536+((re&1023)<<10|I.charCodeAt(++ae)&1023),q[ge>>2]|=(240|re>>18)<<D[ge++&3],q[ge>>2]|=(128|re>>12&63)<<D[ge++&3],q[ge>>2]|=(128|re>>6&63)<<D[ge++&3],q[ge>>2]|=(128|re&63)<<D[ge++&3]);if(this.lastByteIndex=ge,ge>=F){for(this.start=ge-F,this.block=q[ne],ge=0;ge<ne;++ge)Ae[ge]^=q[ge];he(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(I,Z){var se=I&255,q=1,F=[se];for(I=I>>8,se=I&255;se>0;)F.unshift(se),I=I>>8,se=I&255,++q;return Z?F.push(q):F.unshift(q),this.update(F),F.length},w.prototype.encodeString=function(I){var Z,se=typeof I;if(se!=="string"){if(se==="object"){if(I===null)throw new Error(t);if(m&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!m||!ArrayBuffer.isView(I)))throw new Error(t)}else throw new Error(t);Z=!0}var q=0,F=I.length;if(Z)q=F;else for(var ee=0;ee<I.length;++ee){var ne=I.charCodeAt(ee);ne<128?q+=1:ne<2048?q+=2:ne<55296||ne>=57344?q+=3:(ne=65536+((ne&1023)<<10|I.charCodeAt(++ee)&1023),q+=4)}return q+=this.encode(q*8),this.update(I),q},w.prototype.bytepad=function(I,Z){for(var se=this.encode(Z),q=0;q<I.length;++q)se+=this.encodeString(I[q]);var F=Z-se%Z,ee=[];return ee.length=F,this.update(ee),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var I=this.blocks,Z=this.lastByteIndex,se=this.blockCount,q=this.s;if(I[Z>>2]|=this.padding[Z&3],this.lastByteIndex===this.byteCount)for(I[0]=I[se],Z=1;Z<se+1;++Z)I[Z]=0;for(I[se-1]|=2147483648,Z=0;Z<se;++Z)q[Z]^=I[Z];he(q)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var I=this.blockCount,Z=this.s,se=this.outputBlocks,q=this.extraBytes,F=0,ee=0,ne="",ae;ee<se;){for(F=0;F<I&&ee<se;++F,++ee)ae=Z[F],ne+=v[ae>>4&15]+v[ae&15]+v[ae>>12&15]+v[ae>>8&15]+v[ae>>20&15]+v[ae>>16&15]+v[ae>>28&15]+v[ae>>24&15];ee%I===0&&(he(Z),F=0)}return q&&(ae=Z[F],ne+=v[ae>>4&15]+v[ae&15],q>1&&(ne+=v[ae>>12&15]+v[ae>>8&15]),q>2&&(ne+=v[ae>>20&15]+v[ae>>16&15])),ne},w.prototype.arrayBuffer=function(){this.finalize();var I=this.blockCount,Z=this.s,se=this.outputBlocks,q=this.extraBytes,F=0,ee=0,ne=this.outputBits>>3,ae;q?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(ne);for(var Ae=new Uint32Array(ae);ee<se;){for(F=0;F<I&&ee<se;++F,++ee)Ae[ee]=Z[F];ee%I===0&&he(Z)}return q&&(Ae[F]=Z[F],ae=ae.slice(0,ne)),ae},w.prototype.buffer=w.prototype.arrayBuffer,w.prototype.digest=w.prototype.array=function(){this.finalize();for(var I=this.blockCount,Z=this.s,se=this.outputBlocks,q=this.extraBytes,F=0,ee=0,ne=[],ae,Ae;ee<se;){for(F=0;F<I&&ee<se;++F,++ee)ae=ee<<2,Ae=Z[F],ne[ae]=Ae&255,ne[ae+1]=Ae>>8&255,ne[ae+2]=Ae>>16&255,ne[ae+3]=Ae>>24&255;ee%I===0&&he(Z)}return q&&(ae=ee<<2,Ae=Z[F],ne[ae]=Ae&255,q>1&&(ne[ae+1]=Ae>>8&255),q>2&&(ne[ae+2]=Ae>>16&255)),ne};function k(I,Z,se){w.call(this,I,Z,se)}o(k,"Kmac"),k.prototype=new w,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),w.prototype.finalize.call(this)};var he=o(function(I){var Z,se,q,F,ee,ne,ae,Ae,ge,re,Se,ce,ve,V,pe,Ce,He,Re,Ve,pr,ue,ie,$,X,me,ye,we,ke,It,Ue,Oe,Bt,je,Je,Tn,nt,it,Yn,ot,et,Xn,st,at,cn,ft,Xe,Zn,ct,ut,Qn,lt,ht,ei,dt,tt,Cn,Ft,qt,un,ln,hn,Nr,dn;for(q=0;q<48;q+=2)F=I[0]^I[10]^I[20]^I[30]^I[40],ee=I[1]^I[11]^I[21]^I[31]^I[41],ne=I[2]^I[12]^I[22]^I[32]^I[42],ae=I[3]^I[13]^I[23]^I[33]^I[43],Ae=I[4]^I[14]^I[24]^I[34]^I[44],ge=I[5]^I[15]^I[25]^I[35]^I[45],re=I[6]^I[16]^I[26]^I[36]^I[46],Se=I[7]^I[17]^I[27]^I[37]^I[47],ce=I[8]^I[18]^I[28]^I[38]^I[48],ve=I[9]^I[19]^I[29]^I[39]^I[49],Z=ce^(ne<<1|ae>>>31),se=ve^(ae<<1|ne>>>31),I[0]^=Z,I[1]^=se,I[10]^=Z,I[11]^=se,I[20]^=Z,I[21]^=se,I[30]^=Z,I[31]^=se,I[40]^=Z,I[41]^=se,Z=F^(Ae<<1|ge>>>31),se=ee^(ge<<1|Ae>>>31),I[2]^=Z,I[3]^=se,I[12]^=Z,I[13]^=se,I[22]^=Z,I[23]^=se,I[32]^=Z,I[33]^=se,I[42]^=Z,I[43]^=se,Z=ne^(re<<1|Se>>>31),se=ae^(Se<<1|re>>>31),I[4]^=Z,I[5]^=se,I[14]^=Z,I[15]^=se,I[24]^=Z,I[25]^=se,I[34]^=Z,I[35]^=se,I[44]^=Z,I[45]^=se,Z=Ae^(ce<<1|ve>>>31),se=ge^(ve<<1|ce>>>31),I[6]^=Z,I[7]^=se,I[16]^=Z,I[17]^=se,I[26]^=Z,I[27]^=se,I[36]^=Z,I[37]^=se,I[46]^=Z,I[47]^=se,Z=re^(F<<1|ee>>>31),se=Se^(ee<<1|F>>>31),I[8]^=Z,I[9]^=se,I[18]^=Z,I[19]^=se,I[28]^=Z,I[29]^=se,I[38]^=Z,I[39]^=se,I[48]^=Z,I[49]^=se,V=I[0],pe=I[1],Xe=I[11]<<4|I[10]>>>28,Zn=I[10]<<4|I[11]>>>28,ke=I[20]<<3|I[21]>>>29,It=I[21]<<3|I[20]>>>29,ln=I[31]<<9|I[30]>>>23,hn=I[30]<<9|I[31]>>>23,st=I[40]<<18|I[41]>>>14,at=I[41]<<18|I[40]>>>14,Je=I[2]<<1|I[3]>>>31,Tn=I[3]<<1|I[2]>>>31,Ce=I[13]<<12|I[12]>>>20,He=I[12]<<12|I[13]>>>20,ct=I[22]<<10|I[23]>>>22,ut=I[23]<<10|I[22]>>>22,Ue=I[33]<<13|I[32]>>>19,Oe=I[32]<<13|I[33]>>>19,Nr=I[42]<<2|I[43]>>>30,dn=I[43]<<2|I[42]>>>30,dt=I[5]<<30|I[4]>>>2,tt=I[4]<<30|I[5]>>>2,nt=I[14]<<6|I[15]>>>26,it=I[15]<<6|I[14]>>>26,Re=I[25]<<11|I[24]>>>21,Ve=I[24]<<11|I[25]>>>21,Qn=I[34]<<15|I[35]>>>17,lt=I[35]<<15|I[34]>>>17,Bt=I[45]<<29|I[44]>>>3,je=I[44]<<29|I[45]>>>3,X=I[6]<<28|I[7]>>>4,me=I[7]<<28|I[6]>>>4,Cn=I[17]<<23|I[16]>>>9,Ft=I[16]<<23|I[17]>>>9,Yn=I[26]<<25|I[27]>>>7,ot=I[27]<<25|I[26]>>>7,pr=I[36]<<21|I[37]>>>11,ue=I[37]<<21|I[36]>>>11,ht=I[47]<<24|I[46]>>>8,ei=I[46]<<24|I[47]>>>8,cn=I[8]<<27|I[9]>>>5,ft=I[9]<<27|I[8]>>>5,ye=I[18]<<20|I[19]>>>12,we=I[19]<<20|I[18]>>>12,qt=I[29]<<7|I[28]>>>25,un=I[28]<<7|I[29]>>>25,et=I[38]<<8|I[39]>>>24,Xn=I[39]<<8|I[38]>>>24,ie=I[48]<<14|I[49]>>>18,$=I[49]<<14|I[48]>>>18,I[0]=V^~Ce&Re,I[1]=pe^~He&Ve,I[10]=X^~ye&ke,I[11]=me^~we&It,I[20]=Je^~nt&Yn,I[21]=Tn^~it&ot,I[30]=cn^~Xe&ct,I[31]=ft^~Zn&ut,I[40]=dt^~Cn&qt,I[41]=tt^~Ft&un,I[2]=Ce^~Re&pr,I[3]=He^~Ve&ue,I[12]=ye^~ke&Ue,I[13]=we^~It&Oe,I[22]=nt^~Yn&et,I[23]=it^~ot&Xn,I[32]=Xe^~ct&Qn,I[33]=Zn^~ut<,I[42]=Cn^~qt&ln,I[43]=Ft^~un&hn,I[4]=Re^~pr&ie,I[5]=Ve^~ue&$,I[14]=ke^~Ue&Bt,I[15]=It^~Oe&je,I[24]=Yn^~et&st,I[25]=ot^~Xn&at,I[34]=ct^~Qn&ht,I[35]=ut^~lt&ei,I[44]=qt^~ln&Nr,I[45]=un^~hn&dn,I[6]=pr^~ie&V,I[7]=ue^~$&pe,I[16]=Ue^~Bt&X,I[17]=Oe^~je&me,I[26]=et^~st&Je,I[27]=Xn^~at&Tn,I[36]=Qn^~ht&cn,I[37]=lt^~ei&ft,I[46]=ln^~Nr&dt,I[47]=hn^~dn&tt,I[8]=ie^~V&Ce,I[9]=$^~pe&He,I[18]=Bt^~X&ye,I[19]=je^~me&we,I[28]=st^~Je&nt,I[29]=at^~Tn&it,I[38]=ht^~cn&Xe,I[39]=ei^~ft&Zn,I[48]=Nr^~dt&Cn,I[49]=dn^~tt&Ft,I[0]^=P[q],I[1]^=P[q+1]},"f");if(c)$h.exports=l;else{for(_=0;_<p.length;++_)n[p[_]]=l[p[_]];u&&define(function(){return l})}})()});var h3=De((hK,FD)=>{FD.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var zm=De(()=>{});var no=De((d3,Km)=>{(function(t,e){"use strict";function r(T,h){if(!T)throw new Error(h||"Assertion failed")}o(r,"assert");function n(T,h){T.super_=h;var y=o(function(){},"TempCtor");y.prototype=h.prototype,T.prototype=new y,T.prototype.constructor=T}o(n,"inherits");function i(T,h,y){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((h==="le"||h==="be")&&(y=h,h=10),this._init(T||0,h||10,y||"be"))}o(i,"BN"),typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=zm().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,y){return h.cmp(y)>0?h:y},"max"),i.min=o(function(h,y){return h.cmp(y)<0?h:y},"min"),i.prototype._init=o(function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),r(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(y===16?this._parseHex(h,l,b):(this._parseBase(h,y,l),b==="le"&&this._initArray(this.toArray(),y,b)))},"init"),i.prototype._initNumber=o(function(h,y,b){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):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},"_initNumber"),i.prototype._initArray=o(function(h,y,b){if(r(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 p,_,A=0;if(b==="be")for(l=h.length-1,p=0;l>=0;l-=3)_=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[p]|=_<<A&67108863,this.words[p+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,p++);else if(b==="le")for(l=0,p=0;l<h.length;l+=3)_=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[p]|=_<<A&67108863,this.words[p+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,p++);return this.strip()},"_initArray");function c(T,h){var y=T.charCodeAt(h);return y>=65&&y<=70?y-55:y>=97&&y<=102?y-87:y-48&15}o(c,"parseHex4Bits");function u(T,h,y){var b=c(T,y);return y-1>=h&&(b|=c(T,y-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var p=0,_=0,A;if(b==="be")for(l=h.length-1;l>=y;l-=2)A=u(h,y,l)<<p,this.words[_]|=A&67108863,p>=18?(p-=18,_+=1,this.words[_]|=A>>>26):p+=8;else{var E=h.length-y;for(l=E%2===0?y+1:y;l<h.length;l+=2)A=u(h,y,l)<<p,this.words[_]|=A&67108863,p>=18?(p-=18,_+=1,this.words[_]|=A>>>26):p+=8}this.strip()},"_parseHex");function m(T,h,y,b){for(var l=0,p=Math.min(T.length,y),_=h;_<p;_++){var A=T.charCodeAt(_)-48;l*=b,A>=49?l+=A-49+10:A>=17?l+=A-17+10:l+=A}return l}o(m,"parseBase"),i.prototype._parseBase=o(function(h,y,b){this.words=[0],this.length=1;for(var l=0,p=1;p<=67108863;p*=y)l++;l--,p=p/y|0;for(var _=h.length-b,A=_%l,E=Math.min(_,_-A)+b,g=0,C=b;C<E;C+=l)g=m(h,C,C+l,y),this.imuln(p),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(A!==0){var N=1;for(g=m(h,C,h.length,y),C=0;C<A;C++)N*=y;this.imuln(N),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},"_parseBase"),i.prototype.copy=o(function(h){h.words=new Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];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 v=["","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"],x=[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],S=[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,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,p=0,_=0;_<this.length;_++){var A=this.words[_],E=((A<<l|p)&16777215).toString(16);p=A>>>24-l&16777215,p!==0||_!==this.length-1?b=v[6-E.length]+E+b:b=E+b,l+=2,l>=26&&(l-=26,_--)}for(p!==0&&(b=p.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var g=x[h],C=S[h];b="";var N=this.clone();for(N.negative=0;!N.isZero();){var w=N.modn(C).toString(h);N=N.idivn(C),N.isZero()?b=w+b:b=v[g-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!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&&r(!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,y){return r(typeof a<"u"),this.toArrayLike(a,h,y)},"toBuffer"),i.prototype.toArray=o(function(h,y){return this.toArrayLike(Array,h,y)},"toArray"),i.prototype.toArrayLike=o(function(h,y,b){var l=this.byteLength(),p=b||Math.max(1,l);r(l<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var _=y==="le",A=new h(p),E,g,C=this.clone();if(_){for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[g]=E;for(;g<p;g++)A[g]=0}else{for(g=0;g<p-l;g++)A[g]=0;for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[p-g-1]=E}return A},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(h){return 32-Math.clz32(h)},"_countBits"):i.prototype._countBits=o(function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y},"bitLength");function O(T){for(var h=new Array(T.bitLength()),y=0;y<h.length;y++){var b=y/26|0,l=y%26;h[y]=(T.words[b]&1<<l)>>>l}return h}o(O,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==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 y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},"iuor"),i.prototype.ior=o(function(h){return r((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 y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},"iuand"),i.prototype.iand=o(function(h){return r((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 y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=y.words[l]^b.words[l];if(this!==y)for(;l<y.length;l++)this.words[l]=y.words[l];return this.length=y.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(h){return r((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){r(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var l=0;l<y;l++)this.words[l]=~this.words[l]&67108863;return b>0&&(this.words[l]=~this.words[l]&67108863>>26-b),this.strip()},"inotn"),i.prototype.notn=o(function(h){return this.clone().inotn(h)},"notn"),i.prototype.setn=o(function(h,y){r(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<l:this.words[b]=this.words[b]&~(1<<l),this.strip()},"setn"),i.prototype.iadd=o(function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var p=0,_=0;_<l.length;_++)y=(b.words[_]|0)+(l.words[_]|0)+p,this.words[_]=y&67108863,p=y>>>26;for(;p!==0&&_<b.length;_++)y=(b.words[_]|0)+p,this.words[_]=y&67108863,p=y>>>26;if(this.length=b.length,p!==0)this.words[this.length]=p,this.length++;else if(b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this},"iadd"),i.prototype.add=o(function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):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 y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,p;b>0?(l=this,p=h):(l=h,p=this);for(var _=0,A=0;A<p.length;A++)y=(l.words[A]|0)-(p.words[A]|0)+_,_=y>>26,this.words[A]=y&67108863;for(;_!==0&&A<l.length;A++)y=(l.words[A]|0)+_,_=y>>26,this.words[A]=y&67108863;if(_===0&&A<l.length&&l!==this)for(;A<l.length;A++)this.words[A]=l.words[A];return this.length=Math.max(this.length,A),l!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(h){return this.clone().isub(h)},"sub");function R(T,h,y){y.negative=h.negative^T.negative;var b=T.length+h.length|0;y.length=b,b=b-1|0;var l=T.words[0]|0,p=h.words[0]|0,_=l*p,A=_&67108863,E=_/67108864|0;y.words[0]=A;for(var g=1;g<b;g++){for(var C=E>>>26,N=E&67108863,w=Math.min(g,h.length-1),k=Math.max(0,g-T.length+1);k<=w;k++){var he=g-k|0;l=T.words[he]|0,p=h.words[k]|0,_=l*p+N,C+=_/67108864|0,N=_&67108863}y.words[g]=N|0,E=C|0}return E!==0?y.words[g]=E|0:y.length--,y.strip()}o(R,"smallMulTo");var D=o(function(h,y,b){var l=h.words,p=y.words,_=b.words,A=0,E,g,C,N=l[0]|0,w=N&8191,k=N>>>13,he=l[1]|0,I=he&8191,Z=he>>>13,se=l[2]|0,q=se&8191,F=se>>>13,ee=l[3]|0,ne=ee&8191,ae=ee>>>13,Ae=l[4]|0,ge=Ae&8191,re=Ae>>>13,Se=l[5]|0,ce=Se&8191,ve=Se>>>13,V=l[6]|0,pe=V&8191,Ce=V>>>13,He=l[7]|0,Re=He&8191,Ve=He>>>13,pr=l[8]|0,ue=pr&8191,ie=pr>>>13,$=l[9]|0,X=$&8191,me=$>>>13,ye=p[0]|0,we=ye&8191,ke=ye>>>13,It=p[1]|0,Ue=It&8191,Oe=It>>>13,Bt=p[2]|0,je=Bt&8191,Je=Bt>>>13,Tn=p[3]|0,nt=Tn&8191,it=Tn>>>13,Yn=p[4]|0,ot=Yn&8191,et=Yn>>>13,Xn=p[5]|0,st=Xn&8191,at=Xn>>>13,cn=p[6]|0,ft=cn&8191,Xe=cn>>>13,Zn=p[7]|0,ct=Zn&8191,ut=Zn>>>13,Qn=p[8]|0,lt=Qn&8191,ht=Qn>>>13,ei=p[9]|0,dt=ei&8191,tt=ei>>>13;b.negative=h.negative^y.negative,b.length=19,E=Math.imul(w,we),g=Math.imul(w,ke),g=g+Math.imul(k,we)|0,C=Math.imul(k,ke);var Cn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,E=Math.imul(I,we),g=Math.imul(I,ke),g=g+Math.imul(Z,we)|0,C=Math.imul(Z,ke),E=E+Math.imul(w,Ue)|0,g=g+Math.imul(w,Oe)|0,g=g+Math.imul(k,Ue)|0,C=C+Math.imul(k,Oe)|0;var Ft=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,E=Math.imul(q,we),g=Math.imul(q,ke),g=g+Math.imul(F,we)|0,C=Math.imul(F,ke),E=E+Math.imul(I,Ue)|0,g=g+Math.imul(I,Oe)|0,g=g+Math.imul(Z,Ue)|0,C=C+Math.imul(Z,Oe)|0,E=E+Math.imul(w,je)|0,g=g+Math.imul(w,Je)|0,g=g+Math.imul(k,je)|0,C=C+Math.imul(k,Je)|0;var qt=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(qt>>>26)|0,qt&=67108863,E=Math.imul(ne,we),g=Math.imul(ne,ke),g=g+Math.imul(ae,we)|0,C=Math.imul(ae,ke),E=E+Math.imul(q,Ue)|0,g=g+Math.imul(q,Oe)|0,g=g+Math.imul(F,Ue)|0,C=C+Math.imul(F,Oe)|0,E=E+Math.imul(I,je)|0,g=g+Math.imul(I,Je)|0,g=g+Math.imul(Z,je)|0,C=C+Math.imul(Z,Je)|0,E=E+Math.imul(w,nt)|0,g=g+Math.imul(w,it)|0,g=g+Math.imul(k,nt)|0,C=C+Math.imul(k,it)|0;var un=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(un>>>26)|0,un&=67108863,E=Math.imul(ge,we),g=Math.imul(ge,ke),g=g+Math.imul(re,we)|0,C=Math.imul(re,ke),E=E+Math.imul(ne,Ue)|0,g=g+Math.imul(ne,Oe)|0,g=g+Math.imul(ae,Ue)|0,C=C+Math.imul(ae,Oe)|0,E=E+Math.imul(q,je)|0,g=g+Math.imul(q,Je)|0,g=g+Math.imul(F,je)|0,C=C+Math.imul(F,Je)|0,E=E+Math.imul(I,nt)|0,g=g+Math.imul(I,it)|0,g=g+Math.imul(Z,nt)|0,C=C+Math.imul(Z,it)|0,E=E+Math.imul(w,ot)|0,g=g+Math.imul(w,et)|0,g=g+Math.imul(k,ot)|0,C=C+Math.imul(k,et)|0;var ln=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ln>>>26)|0,ln&=67108863,E=Math.imul(ce,we),g=Math.imul(ce,ke),g=g+Math.imul(ve,we)|0,C=Math.imul(ve,ke),E=E+Math.imul(ge,Ue)|0,g=g+Math.imul(ge,Oe)|0,g=g+Math.imul(re,Ue)|0,C=C+Math.imul(re,Oe)|0,E=E+Math.imul(ne,je)|0,g=g+Math.imul(ne,Je)|0,g=g+Math.imul(ae,je)|0,C=C+Math.imul(ae,Je)|0,E=E+Math.imul(q,nt)|0,g=g+Math.imul(q,it)|0,g=g+Math.imul(F,nt)|0,C=C+Math.imul(F,it)|0,E=E+Math.imul(I,ot)|0,g=g+Math.imul(I,et)|0,g=g+Math.imul(Z,ot)|0,C=C+Math.imul(Z,et)|0,E=E+Math.imul(w,st)|0,g=g+Math.imul(w,at)|0,g=g+Math.imul(k,st)|0,C=C+Math.imul(k,at)|0;var hn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(hn>>>26)|0,hn&=67108863,E=Math.imul(pe,we),g=Math.imul(pe,ke),g=g+Math.imul(Ce,we)|0,C=Math.imul(Ce,ke),E=E+Math.imul(ce,Ue)|0,g=g+Math.imul(ce,Oe)|0,g=g+Math.imul(ve,Ue)|0,C=C+Math.imul(ve,Oe)|0,E=E+Math.imul(ge,je)|0,g=g+Math.imul(ge,Je)|0,g=g+Math.imul(re,je)|0,C=C+Math.imul(re,Je)|0,E=E+Math.imul(ne,nt)|0,g=g+Math.imul(ne,it)|0,g=g+Math.imul(ae,nt)|0,C=C+Math.imul(ae,it)|0,E=E+Math.imul(q,ot)|0,g=g+Math.imul(q,et)|0,g=g+Math.imul(F,ot)|0,C=C+Math.imul(F,et)|0,E=E+Math.imul(I,st)|0,g=g+Math.imul(I,at)|0,g=g+Math.imul(Z,st)|0,C=C+Math.imul(Z,at)|0,E=E+Math.imul(w,ft)|0,g=g+Math.imul(w,Xe)|0,g=g+Math.imul(k,ft)|0,C=C+Math.imul(k,Xe)|0;var Nr=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,E=Math.imul(Re,we),g=Math.imul(Re,ke),g=g+Math.imul(Ve,we)|0,C=Math.imul(Ve,ke),E=E+Math.imul(pe,Ue)|0,g=g+Math.imul(pe,Oe)|0,g=g+Math.imul(Ce,Ue)|0,C=C+Math.imul(Ce,Oe)|0,E=E+Math.imul(ce,je)|0,g=g+Math.imul(ce,Je)|0,g=g+Math.imul(ve,je)|0,C=C+Math.imul(ve,Je)|0,E=E+Math.imul(ge,nt)|0,g=g+Math.imul(ge,it)|0,g=g+Math.imul(re,nt)|0,C=C+Math.imul(re,it)|0,E=E+Math.imul(ne,ot)|0,g=g+Math.imul(ne,et)|0,g=g+Math.imul(ae,ot)|0,C=C+Math.imul(ae,et)|0,E=E+Math.imul(q,st)|0,g=g+Math.imul(q,at)|0,g=g+Math.imul(F,st)|0,C=C+Math.imul(F,at)|0,E=E+Math.imul(I,ft)|0,g=g+Math.imul(I,Xe)|0,g=g+Math.imul(Z,ft)|0,C=C+Math.imul(Z,Xe)|0,E=E+Math.imul(w,ct)|0,g=g+Math.imul(w,ut)|0,g=g+Math.imul(k,ct)|0,C=C+Math.imul(k,ut)|0;var dn=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(dn>>>26)|0,dn&=67108863,E=Math.imul(ue,we),g=Math.imul(ue,ke),g=g+Math.imul(ie,we)|0,C=Math.imul(ie,ke),E=E+Math.imul(Re,Ue)|0,g=g+Math.imul(Re,Oe)|0,g=g+Math.imul(Ve,Ue)|0,C=C+Math.imul(Ve,Oe)|0,E=E+Math.imul(pe,je)|0,g=g+Math.imul(pe,Je)|0,g=g+Math.imul(Ce,je)|0,C=C+Math.imul(Ce,Je)|0,E=E+Math.imul(ce,nt)|0,g=g+Math.imul(ce,it)|0,g=g+Math.imul(ve,nt)|0,C=C+Math.imul(ve,it)|0,E=E+Math.imul(ge,ot)|0,g=g+Math.imul(ge,et)|0,g=g+Math.imul(re,ot)|0,C=C+Math.imul(re,et)|0,E=E+Math.imul(ne,st)|0,g=g+Math.imul(ne,at)|0,g=g+Math.imul(ae,st)|0,C=C+Math.imul(ae,at)|0,E=E+Math.imul(q,ft)|0,g=g+Math.imul(q,Xe)|0,g=g+Math.imul(F,ft)|0,C=C+Math.imul(F,Xe)|0,E=E+Math.imul(I,ct)|0,g=g+Math.imul(I,ut)|0,g=g+Math.imul(Z,ct)|0,C=C+Math.imul(Z,ut)|0,E=E+Math.imul(w,lt)|0,g=g+Math.imul(w,ht)|0,g=g+Math.imul(k,lt)|0,C=C+Math.imul(k,ht)|0;var ti=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ti>>>26)|0,ti&=67108863,E=Math.imul(X,we),g=Math.imul(X,ke),g=g+Math.imul(me,we)|0,C=Math.imul(me,ke),E=E+Math.imul(ue,Ue)|0,g=g+Math.imul(ue,Oe)|0,g=g+Math.imul(ie,Ue)|0,C=C+Math.imul(ie,Oe)|0,E=E+Math.imul(Re,je)|0,g=g+Math.imul(Re,Je)|0,g=g+Math.imul(Ve,je)|0,C=C+Math.imul(Ve,Je)|0,E=E+Math.imul(pe,nt)|0,g=g+Math.imul(pe,it)|0,g=g+Math.imul(Ce,nt)|0,C=C+Math.imul(Ce,it)|0,E=E+Math.imul(ce,ot)|0,g=g+Math.imul(ce,et)|0,g=g+Math.imul(ve,ot)|0,C=C+Math.imul(ve,et)|0,E=E+Math.imul(ge,st)|0,g=g+Math.imul(ge,at)|0,g=g+Math.imul(re,st)|0,C=C+Math.imul(re,at)|0,E=E+Math.imul(ne,ft)|0,g=g+Math.imul(ne,Xe)|0,g=g+Math.imul(ae,ft)|0,C=C+Math.imul(ae,Xe)|0,E=E+Math.imul(q,ct)|0,g=g+Math.imul(q,ut)|0,g=g+Math.imul(F,ct)|0,C=C+Math.imul(F,ut)|0,E=E+Math.imul(I,lt)|0,g=g+Math.imul(I,ht)|0,g=g+Math.imul(Z,lt)|0,C=C+Math.imul(Z,ht)|0,E=E+Math.imul(w,dt)|0,g=g+Math.imul(w,tt)|0,g=g+Math.imul(k,dt)|0,C=C+Math.imul(k,tt)|0;var So=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(So>>>26)|0,So&=67108863,E=Math.imul(X,Ue),g=Math.imul(X,Oe),g=g+Math.imul(me,Ue)|0,C=Math.imul(me,Oe),E=E+Math.imul(ue,je)|0,g=g+Math.imul(ue,Je)|0,g=g+Math.imul(ie,je)|0,C=C+Math.imul(ie,Je)|0,E=E+Math.imul(Re,nt)|0,g=g+Math.imul(Re,it)|0,g=g+Math.imul(Ve,nt)|0,C=C+Math.imul(Ve,it)|0,E=E+Math.imul(pe,ot)|0,g=g+Math.imul(pe,et)|0,g=g+Math.imul(Ce,ot)|0,C=C+Math.imul(Ce,et)|0,E=E+Math.imul(ce,st)|0,g=g+Math.imul(ce,at)|0,g=g+Math.imul(ve,st)|0,C=C+Math.imul(ve,at)|0,E=E+Math.imul(ge,ft)|0,g=g+Math.imul(ge,Xe)|0,g=g+Math.imul(re,ft)|0,C=C+Math.imul(re,Xe)|0,E=E+Math.imul(ne,ct)|0,g=g+Math.imul(ne,ut)|0,g=g+Math.imul(ae,ct)|0,C=C+Math.imul(ae,ut)|0,E=E+Math.imul(q,lt)|0,g=g+Math.imul(q,ht)|0,g=g+Math.imul(F,lt)|0,C=C+Math.imul(F,ht)|0,E=E+Math.imul(I,dt)|0,g=g+Math.imul(I,tt)|0,g=g+Math.imul(Z,dt)|0,C=C+Math.imul(Z,tt)|0;var Mo=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,E=Math.imul(X,je),g=Math.imul(X,Je),g=g+Math.imul(me,je)|0,C=Math.imul(me,Je),E=E+Math.imul(ue,nt)|0,g=g+Math.imul(ue,it)|0,g=g+Math.imul(ie,nt)|0,C=C+Math.imul(ie,it)|0,E=E+Math.imul(Re,ot)|0,g=g+Math.imul(Re,et)|0,g=g+Math.imul(Ve,ot)|0,C=C+Math.imul(Ve,et)|0,E=E+Math.imul(pe,st)|0,g=g+Math.imul(pe,at)|0,g=g+Math.imul(Ce,st)|0,C=C+Math.imul(Ce,at)|0,E=E+Math.imul(ce,ft)|0,g=g+Math.imul(ce,Xe)|0,g=g+Math.imul(ve,ft)|0,C=C+Math.imul(ve,Xe)|0,E=E+Math.imul(ge,ct)|0,g=g+Math.imul(ge,ut)|0,g=g+Math.imul(re,ct)|0,C=C+Math.imul(re,ut)|0,E=E+Math.imul(ne,lt)|0,g=g+Math.imul(ne,ht)|0,g=g+Math.imul(ae,lt)|0,C=C+Math.imul(ae,ht)|0,E=E+Math.imul(q,dt)|0,g=g+Math.imul(q,tt)|0,g=g+Math.imul(F,dt)|0,C=C+Math.imul(F,tt)|0;var To=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(To>>>26)|0,To&=67108863,E=Math.imul(X,nt),g=Math.imul(X,it),g=g+Math.imul(me,nt)|0,C=Math.imul(me,it),E=E+Math.imul(ue,ot)|0,g=g+Math.imul(ue,et)|0,g=g+Math.imul(ie,ot)|0,C=C+Math.imul(ie,et)|0,E=E+Math.imul(Re,st)|0,g=g+Math.imul(Re,at)|0,g=g+Math.imul(Ve,st)|0,C=C+Math.imul(Ve,at)|0,E=E+Math.imul(pe,ft)|0,g=g+Math.imul(pe,Xe)|0,g=g+Math.imul(Ce,ft)|0,C=C+Math.imul(Ce,Xe)|0,E=E+Math.imul(ce,ct)|0,g=g+Math.imul(ce,ut)|0,g=g+Math.imul(ve,ct)|0,C=C+Math.imul(ve,ut)|0,E=E+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ht)|0,g=g+Math.imul(re,lt)|0,C=C+Math.imul(re,ht)|0,E=E+Math.imul(ne,dt)|0,g=g+Math.imul(ne,tt)|0,g=g+Math.imul(ae,dt)|0,C=C+Math.imul(ae,tt)|0;var Xi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,E=Math.imul(X,ot),g=Math.imul(X,et),g=g+Math.imul(me,ot)|0,C=Math.imul(me,et),E=E+Math.imul(ue,st)|0,g=g+Math.imul(ue,at)|0,g=g+Math.imul(ie,st)|0,C=C+Math.imul(ie,at)|0,E=E+Math.imul(Re,ft)|0,g=g+Math.imul(Re,Xe)|0,g=g+Math.imul(Ve,ft)|0,C=C+Math.imul(Ve,Xe)|0,E=E+Math.imul(pe,ct)|0,g=g+Math.imul(pe,ut)|0,g=g+Math.imul(Ce,ct)|0,C=C+Math.imul(Ce,ut)|0,E=E+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ht)|0,g=g+Math.imul(ve,lt)|0,C=C+Math.imul(ve,ht)|0,E=E+Math.imul(ge,dt)|0,g=g+Math.imul(ge,tt)|0,g=g+Math.imul(re,dt)|0,C=C+Math.imul(re,tt)|0;var Zi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,E=Math.imul(X,st),g=Math.imul(X,at),g=g+Math.imul(me,st)|0,C=Math.imul(me,at),E=E+Math.imul(ue,ft)|0,g=g+Math.imul(ue,Xe)|0,g=g+Math.imul(ie,ft)|0,C=C+Math.imul(ie,Xe)|0,E=E+Math.imul(Re,ct)|0,g=g+Math.imul(Re,ut)|0,g=g+Math.imul(Ve,ct)|0,C=C+Math.imul(Ve,ut)|0,E=E+Math.imul(pe,lt)|0,g=g+Math.imul(pe,ht)|0,g=g+Math.imul(Ce,lt)|0,C=C+Math.imul(Ce,ht)|0,E=E+Math.imul(ce,dt)|0,g=g+Math.imul(ce,tt)|0,g=g+Math.imul(ve,dt)|0,C=C+Math.imul(ve,tt)|0;var Qi=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,E=Math.imul(X,ft),g=Math.imul(X,Xe),g=g+Math.imul(me,ft)|0,C=Math.imul(me,Xe),E=E+Math.imul(ue,ct)|0,g=g+Math.imul(ue,ut)|0,g=g+Math.imul(ie,ct)|0,C=C+Math.imul(ie,ut)|0,E=E+Math.imul(Re,lt)|0,g=g+Math.imul(Re,ht)|0,g=g+Math.imul(Ve,lt)|0,C=C+Math.imul(Ve,ht)|0,E=E+Math.imul(pe,dt)|0,g=g+Math.imul(pe,tt)|0,g=g+Math.imul(Ce,dt)|0,C=C+Math.imul(Ce,tt)|0;var Co=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Co>>>26)|0,Co&=67108863,E=Math.imul(X,ct),g=Math.imul(X,ut),g=g+Math.imul(me,ct)|0,C=Math.imul(me,ut),E=E+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ht)|0,g=g+Math.imul(ie,lt)|0,C=C+Math.imul(ie,ht)|0,E=E+Math.imul(Re,dt)|0,g=g+Math.imul(Re,tt)|0,g=g+Math.imul(Ve,dt)|0,C=C+Math.imul(Ve,tt)|0;var ko=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(ko>>>26)|0,ko&=67108863,E=Math.imul(X,lt),g=Math.imul(X,ht),g=g+Math.imul(me,lt)|0,C=Math.imul(me,ht),E=E+Math.imul(ue,dt)|0,g=g+Math.imul(ue,tt)|0,g=g+Math.imul(ie,dt)|0,C=C+Math.imul(ie,tt)|0;var Io=(A+E|0)+((g&8191)<<13)|0;A=(C+(g>>>13)|0)+(Io>>>26)|0,Io&=67108863,E=Math.imul(X,dt),g=Math.imul(X,tt),g=g+Math.imul(me,dt)|0,C=Math.imul(me,tt);var Do=(A+E|0)+((g&8191)<<13)|0;return A=(C+(g>>>13)|0)+(Do>>>26)|0,Do&=67108863,_[0]=Cn,_[1]=Ft,_[2]=qt,_[3]=un,_[4]=ln,_[5]=hn,_[6]=Nr,_[7]=dn,_[8]=ti,_[9]=So,_[10]=Mo,_[11]=To,_[12]=Xi,_[13]=Zi,_[14]=Qi,_[15]=Co,_[16]=ko,_[17]=Io,_[18]=Do,A!==0&&(_[19]=A,b.length++),b},"comb10MulTo");Math.imul||(D=R);function P(T,h,y){y.negative=h.negative^T.negative,y.length=T.length+h.length;for(var b=0,l=0,p=0;p<y.length-1;p++){var _=l;l=0;for(var A=b&67108863,E=Math.min(p,h.length-1),g=Math.max(0,p-T.length+1);g<=E;g++){var C=p-g,N=T.words[C]|0,w=h.words[g]|0,k=N*w,he=k&67108863;_=_+(k/67108864|0)|0,he=he+A|0,A=he&67108863,_=_+(he>>>26)|0,l+=_>>>26,_&=67108863}y.words[p]=A,b=_,_=l}return b!==0?y.words[p]=b:y.length--,y.strip()}o(P,"bigMulTo");function J(T,h,y){var b=new B;return b.mulp(T,h,y)}o(J,"jumboMulTo"),i.prototype.mulTo=o(function(h,y){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=D(this,h,y):l<63?b=R(this,h,y):l<1024?b=P(this,h,y):b=J(this,h,y),b},"mulTo");function B(T,h){this.x=T,this.y=h}o(B,"FFTM"),B.prototype.makeRBT=o(function(h){for(var y=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)y[l]=this.revBin(l,b,h);return y},"makeRBT"),B.prototype.revBin=o(function(h,y,b){if(h===0||h===b-1)return h;for(var l=0,p=0;p<y;p++)l|=(h&1)<<y-p-1,h>>=1;return l},"revBin"),B.prototype.permute=o(function(h,y,b,l,p,_){for(var A=0;A<_;A++)l[A]=y[h[A]],p[A]=b[h[A]]},"permute"),B.prototype.transform=o(function(h,y,b,l,p,_){this.permute(_,h,y,b,l,p);for(var A=1;A<p;A<<=1)for(var E=A<<1,g=Math.cos(2*Math.PI/E),C=Math.sin(2*Math.PI/E),N=0;N<p;N+=E)for(var w=g,k=C,he=0;he<A;he++){var I=b[N+he],Z=l[N+he],se=b[N+he+A],q=l[N+he+A],F=w*se-k*q;q=w*q+k*se,se=F,b[N+he]=I+se,l[N+he]=Z+q,b[N+he+A]=I-se,l[N+he+A]=Z-q,he!==E&&(F=g*w-C*k,k=g*k+C*w,w=F)}},"transform"),B.prototype.guessLen13b=o(function(h,y){var b=Math.max(y,h)|1,l=b&1,p=0;for(b=b/2|0;b;b=b>>>1)p++;return 1<<p+1+l},"guessLen13b"),B.prototype.conjugate=o(function(h,y,b){if(!(b<=1))for(var l=0;l<b/2;l++){var p=h[l];h[l]=h[b-l-1],h[b-l-1]=p,p=y[l],y[l]=-y[b-l-1],y[b-l-1]=-p}},"conjugate"),B.prototype.normalize13b=o(function(h,y){for(var b=0,l=0;l<y/2;l++){var p=Math.round(h[2*l+1]/y)*8192+Math.round(h[2*l]/y)+b;h[l]=p&67108863,p<67108864?b=0:b=p/67108864|0}return h},"normalize13b"),B.prototype.convert13b=o(function(h,y,b,l){for(var p=0,_=0;_<y;_++)p=p+(h[_]|0),b[2*_]=p&8191,p=p>>>13,b[2*_+1]=p&8191,p=p>>>13;for(_=2*y;_<l;++_)b[_]=0;r(p===0),r((p&-8192)===0)},"convert13b"),B.prototype.stub=o(function(h){for(var y=new Array(h),b=0;b<h;b++)y[b]=0;return y},"stub"),B.prototype.mulp=o(function(h,y,b){var l=2*this.guessLen13b(h.length,y.length),p=this.makeRBT(l),_=this.stub(l),A=new Array(l),E=new Array(l),g=new Array(l),C=new Array(l),N=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,A,l),this.convert13b(y.words,y.length,C,l),this.transform(A,_,E,g,l,p),this.transform(C,_,N,w,l,p);for(var he=0;he<l;he++){var I=E[he]*N[he]-g[he]*w[he];g[he]=E[he]*w[he]+g[he]*N[he],E[he]=I}return this.conjugate(E,g,l),this.transform(E,g,k,_,l,p),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var y=new i(null);return y.words=new Array(this.length+h.length),this.mulTo(h,y)},"mul"),i.prototype.mulf=o(function(h){var y=new i(null);return y.words=new Array(this.length+h.length),J(this,h,y)},"mulf"),i.prototype.imul=o(function(h){return this.clone().mulTo(h,this)},"imul"),i.prototype.imuln=o(function(h){r(typeof h=="number"),r(h<67108864);for(var y=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,p=(l&67108863)+(y&67108863);y>>=26,y+=l/67108864|0,y+=p>>>26,this.words[b]=p&67108863}return y!==0&&(this.words[b]=y,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 y=O(h);if(y.length===0)return new i(1);for(var b=this,l=0;l<y.length&&y[l]===0;l++,b=b.sqr());if(++l<y.length)for(var p=b.sqr();l<y.length;l++,p=p.sqr())y[l]!==0&&(b=b.mul(p));return b},"pow"),i.prototype.iushln=o(function(h){r(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,l=67108863>>>26-y<<26-y,p;if(y!==0){var _=0;for(p=0;p<this.length;p++){var A=this.words[p]&l,E=(this.words[p]|0)-A<<y;this.words[p]=E|_,_=A>>>26-y}_&&(this.words[p]=_,this.length++)}if(b!==0){for(p=this.length-1;p>=0;p--)this.words[p+b]=this.words[p];for(p=0;p<b;p++)this.words[p]=0;this.length+=b}return this.strip()},"iushln"),i.prototype.ishln=o(function(h){return r(this.negative===0),this.iushln(h)},"ishln"),i.prototype.iushrn=o(function(h,y,b){r(typeof h=="number"&&h>=0);var l;y?l=(y-y%26)/26:l=0;var p=h%26,_=Math.min((h-p)/26,this.length),A=67108863^67108863>>>p<<p,E=b;if(l-=_,l=Math.max(0,l),E){for(var g=0;g<_;g++)E.words[g]=this.words[g];E.length=_}if(_!==0)if(this.length>_)for(this.length-=_,g=0;g<this.length;g++)this.words[g]=this.words[g+_];else this.words[0]=0,this.length=1;var C=0;for(g=this.length-1;g>=0&&(C!==0||g>=l);g--){var N=this.words[g]|0;this.words[g]=C<<26-p|N>>>p,C=N&A}return E&&C!==0&&(E.words[E.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(h,y,b){return r(this.negative===0),this.iushrn(h,y,b)},"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){r(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,l=1<<y;if(this.length<=b)return!1;var p=this.words[b];return!!(p&l)},"testn"),i.prototype.imaskn=o(function(h){r(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var l=67108863^67108863>>>y<<y;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 r(typeof h=="number"),r(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 y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},"_iaddn"),i.prototype.isubn=o(function(h){if(r(typeof h=="number"),r(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 y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+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,y,b){var l=h.length+b,p;this._expand(l);var _,A=0;for(p=0;p<h.length;p++){_=(this.words[p+b]|0)+A;var E=(h.words[p]|0)*y;_-=E&67108863,A=(_>>26)-(E/67108864|0),this.words[p+b]=_&67108863}for(;p<this.length-b;p++)_=(this.words[p+b]|0)+A,A=_>>26,this.words[p+b]=_&67108863;if(A===0)return this.strip();for(r(A===-1),A=0,p=0;p<this.length;p++)_=-(this.words[p]|0)+A,A=_>>26,this.words[p]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,y){var b=this.length-h.length,l=this.clone(),p=h,_=p.words[p.length-1]|0,A=this._countBits(_);b=26-A,b!==0&&(p=p.ushln(b),l.iushln(b),_=p.words[p.length-1]|0);var E=l.length-p.length,g;if(y!=="mod"){g=new i(null),g.length=E+1,g.words=new Array(g.length);for(var C=0;C<g.length;C++)g.words[C]=0}var N=l.clone()._ishlnsubmul(p,1,E);N.negative===0&&(l=N,g&&(g.words[E]=1));for(var w=E-1;w>=0;w--){var k=(l.words[p.length+w]|0)*67108864+(l.words[p.length+w-1]|0);for(k=Math.min(k/_|0,67108863),l._ishlnsubmul(p,k,w);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(p,1,w),l.isZero()||(l.negative^=1);g&&(g.words[w]=k)}return g&&g.strip(),l.strip(),y!=="div"&&b!==0&&l.iushrn(b),{div:g||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,y,b){if(r(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,p,_;return this.negative!==0&&h.negative===0?(_=this.neg().divmod(h,y),y!=="mod"&&(l=_.div.neg()),y!=="div"&&(p=_.mod.neg(),b&&p.negative!==0&&p.iadd(h)),{div:l,mod:p}):this.negative===0&&h.negative!==0?(_=this.divmod(h.neg(),y),y!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),y),y!=="div"&&(p=_.mod.neg(),b&&p.negative!==0&&p.isub(h)),{div:_.div,mod:p}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="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,y)},"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 y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,l=h.ushrn(1),p=h.andln(1),_=b.cmp(l);return _<0||p===1&&_===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){r(h<=67108863);for(var y=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(y*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){r(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+y*67108864;this.words[b]=l/h|0,y=l%h}return this.strip()},"idivn"),i.prototype.divn=o(function(h){return this.clone().idivn(h)},"divn"),i.prototype.egcd=o(function(h){r(h.negative===0),r(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var l=new i(1),p=new i(0),_=new i(0),A=new i(1),E=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++E;for(var g=b.clone(),C=y.clone();!y.isZero();){for(var N=0,w=1;(y.words[0]&w)===0&&N<26;++N,w<<=1);if(N>0)for(y.iushrn(N);N-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(g),p.isub(C)),l.iushrn(1),p.iushrn(1);for(var k=0,he=1;(b.words[0]&he)===0&&k<26;++k,he<<=1);if(k>0)for(b.iushrn(k);k-- >0;)(_.isOdd()||A.isOdd())&&(_.iadd(g),A.isub(C)),_.iushrn(1),A.iushrn(1);y.cmp(b)>=0?(y.isub(b),l.isub(_),p.isub(A)):(b.isub(y),_.isub(l),A.isub(p))}return{a:_,b:A,gcd:b.iushln(E)}},"egcd"),i.prototype._invmp=o(function(h){r(h.negative===0),r(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var l=new i(1),p=new i(0),_=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var A=0,E=1;(y.words[0]&E)===0&&A<26;++A,E<<=1);if(A>0)for(y.iushrn(A);A-- >0;)l.isOdd()&&l.iadd(_),l.iushrn(1);for(var g=0,C=1;(b.words[0]&C)===0&&g<26;++g,C<<=1);if(g>0)for(b.iushrn(g);g-- >0;)p.isOdd()&&p.iadd(_),p.iushrn(1);y.cmp(b)>=0?(y.isub(b),l.isub(p)):(b.isub(y),p.isub(l))}var N;return y.cmpn(1)===0?N=l:N=p,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 y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var l=0;y.isEven()&&b.isEven();l++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var p=y.cmp(b);if(p<0){var _=y;y=b,b=_}else if(p===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.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){r(typeof h=="number");var y=h%26,b=(h-y)/26,l=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var p=l,_=b;p!==0&&_<this.length;_++){var A=this.words[_]|0;A+=p,p=A>>>26,A&=67108863,this.words[_]=A}return p!==0&&(this.words[_]=p,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 y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),r(h<=67108863,"Number is too big");var l=this.words[0]|0;b=l===h?0:l<h?-1:1}return this.negative!==0?-b|0:b},"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 y=this.ucmp(h);return this.negative!==0?-y|0:y},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,p=h.words[b]|0;if(l!==p){l<p?y=-1:l>p&&(y=1);break}}return y},"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 G(h)},"red"),i.prototype.toRed=o(function(h){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},"toRed"),i.prototype.fromRed=o(function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(h)},"forceRed"),i.prototype.redAdd=o(function(h){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},"redAdd"),i.prototype.redIAdd=o(function(h){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},"redIAdd"),i.prototype.redSub=o(function(h){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},"redSub"),i.prototype.redISub=o(function(h){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},"redISub"),i.prototype.redShl=o(function(h){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},"redShl"),i.prototype.redMul=o(function(h){return r(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 r(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 r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(h){return r(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)},"redPow");var W={k256:null,p224:null,p192:null,p25519:null};function Q(T,h){this.name=T,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(Q,"MPrime"),Q.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),Q.prototype.ireduce=o(function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var l=b<this.n?-1:y.ucmp(this.p);return l===0?(y.words[0]=0,y.length=1):l>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},"ireduce"),Q.prototype.split=o(function(h,y){h.iushrn(this.n,0,y)},"split"),Q.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Y(){Q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Y,"K256"),n(Y,Q),Y.prototype.split=o(function(h,y){for(var b=4194303,l=Math.min(h.length,9),p=0;p<l;p++)y.words[p]=h.words[p];if(y.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(y.words[y.length++]=_&b,p=10;p<h.length;p++){var A=h.words[p]|0;h.words[p-10]=(A&b)<<4|_>>>22,_=A}_>>>=22,h.words[p-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},"split"),Y.prototype.imulK=o(function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var l=h.words[b]|0;y+=l*977,h.words[b]=y&67108863,y=l*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function oe(){Q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(oe,"P224"),n(oe,Q);function j(){Q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(j,"P192"),n(j,Q);function H(){Q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(H,"P25519"),n(H,Q),H.prototype.imulK=o(function(h){for(var y=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+y,p=l&67108863;l>>>=26,h.words[b]=p,y=l}return y!==0&&(h.words[h.length++]=y),h},"imulK"),i._prime=o(function(h){if(W[h])return W[h];var y;if(h==="k256")y=new Y;else if(h==="p224")y=new oe;else if(h==="p192")y=new j;else if(h==="p25519")y=new H;else throw new Error("Unknown prime "+h);return W[h]=y,y},"prime");function G(T){if(typeof T=="string"){var h=i._prime(T);this.m=h.p,this.prime=h}else r(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}o(G,"Red"),G.prototype._verify1=o(function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},"_verify1"),G.prototype._verify2=o(function(h,y){r((h.negative|y.negative)===0,"red works only with positives"),r(h.red&&h.red===y.red,"red works only with red numbers")},"_verify2"),G.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),G.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),G.prototype.add=o(function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),G.prototype.iadd=o(function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),G.prototype.sub=o(function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),G.prototype.isub=o(function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),G.prototype.shl=o(function(h,y){return this._verify1(h),this.imod(h.ushln(y))},"shl"),G.prototype.imul=o(function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},"imul"),G.prototype.mul=o(function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},"mul"),G.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),G.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),G.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(r(y%2===1),y===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var l=this.m.subn(1),p=0;!l.isZero()&&l.andln(1)===0;)p++,l.iushrn(1);r(!l.isZero());var _=new i(1).toRed(this),A=_.redNeg(),E=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new i(2*g*g).toRed(this);this.pow(g,E).cmp(A)!==0;)g.redIAdd(A);for(var C=this.pow(g,l),N=this.pow(h,l.addn(1).iushrn(1)),w=this.pow(h,l),k=p;w.cmp(_)!==0;){for(var he=w,I=0;he.cmp(_)!==0;I++)he=he.redSqr();r(I<k);var Z=this.pow(C,new i(1).iushln(k-I-1));N=N.redMul(Z),C=Z.redSqr(),w=w.redMul(C),k=I}return N},"sqrt"),G.prototype.invm=o(function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},"invm"),G.prototype.pow=o(function(h,y){if(y.isZero())return new i(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,l=new Array(1<<b);l[0]=new i(1).toRed(this),l[1]=h;for(var p=2;p<l.length;p++)l[p]=this.mul(l[p-1],h);var _=l[0],A=0,E=0,g=y.bitLength()%26;for(g===0&&(g=26),p=y.length-1;p>=0;p--){for(var C=y.words[p],N=g-1;N>=0;N--){var w=C>>N&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&A===0){E=0;continue}A<<=1,A|=w,E++,!(E!==b&&(p!==0||N!==0))&&(_=this.mul(_,l[A]),E=0,A=0)}g=26}return _},"pow"),G.prototype.convertTo=o(function(h){var y=h.umod(this.m);return y===h?y.clone():y},"convertTo"),G.prototype.convertFrom=o(function(h){var y=h.clone();return y.red=null,y},"convertFrom"),i.mont=o(function(h){return new le(h)},"mont");function le(T){G.call(this,T),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(le,"Mont"),n(le,G),le.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),le.prototype.convertFrom=o(function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},"convertFrom"),le.prototype.imul=o(function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=b.isub(l).iushrn(this.shift),_=p;return p.cmp(this.m)>=0?_=p.isub(this.m):p.cmpn(0)<0&&(_=p.iadd(this.m)),_._forceRed(this)},"imul"),le.prototype.mul=o(function(h,y){if(h.isZero()||y.isZero())return new i(0)._forceRed(this);var b=h.mul(y),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=b.isub(l).iushrn(this.shift),_=p;return p.cmp(this.m)>=0?_=p.isub(this.m):p.cmpn(0)<0&&(_=p.iadd(this.m)),_._forceRed(this)},"mul"),le.prototype.invm=o(function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)},"invm")})(typeof Km>"u"||Km,d3)});var Cs=De((mK,m3)=>{m3.exports=p3;function p3(t,e){if(!t)throw new Error(e||"Assertion failed")}o(p3,"assert");p3.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual")});var jm=De(v3=>{"use strict";var Fh=v3;function qD(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t!="string"){for(var n=0;n<t.length;n++)r[n]=t[n]|0;return r}if(e==="hex"){t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),a=i>>8,c=i&255;a?r.push(a,c):r.push(c)}return r}o(qD,"toArray");Fh.toArray=qD;function b3(t){return t.length===1?"0"+t:t}o(b3,"zero2");Fh.zero2=b3;function g3(t){for(var e="",r=0;r<t.length;r++)e+=b3(t[r].toString(16));return e}o(g3,"toHex");Fh.toHex=g3;Fh.encode=o(function(e,r){return r==="hex"?g3(e):e},"encode")});var Ln=De(y3=>{"use strict";var Li=y3,HD=no(),zD=Cs(),qh=jm();Li.assert=zD;Li.toArray=qh.toArray;Li.zero2=qh.zero2;Li.toHex=qh.toHex;Li.encode=qh.encode;function KD(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,a=t.clone(),c=0;c<n.length;c++){var u,m=a.andln(i-1);a.isOdd()?(m>(i>>1)-1?u=(i>>1)-m:u=m,a.isubn(u)):u=0,n[c]=u,a.iushrn(1)}return n}o(KD,"getNAF");Li.getNAF=KD;function jD(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0,a;t.cmpn(-n)>0||e.cmpn(-i)>0;){var c=t.andln(3)+n&3,u=e.andln(3)+i&3;c===3&&(c=-1),u===3&&(u=-1);var m;(c&1)===0?m=0:(a=t.andln(7)+n&7,(a===3||a===5)&&u===2?m=-c:m=c),r[0].push(m);var v;(u&1)===0?v=0:(a=e.andln(7)+i&7,(a===3||a===5)&&c===2?v=-u:v=u),r[1].push(v),2*n===m+1&&(n=1-n),2*i===v+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}o(jD,"getJSF");Li.getJSF=jD;function GD(t,e,r){var n="_"+e;t.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)},"cachedProperty")}o(GD,"cachedProperty");Li.cachedProperty=GD;function VD(t){return typeof t=="string"?Li.toArray(t,"hex"):t}o(VD,"parseBytes");Li.parseBytes=VD;function WD(t){return new HD(t,"hex","le")}o(WD,"intFromLE");Li.intFromLE=WD});var Jm=De((vK,Wm)=>{var Gm;Wm.exports=o(function(e){return Gm||(Gm=new ks(null)),Gm.generate(e)},"rand");function ks(t){this.rand=t}o(ks,"Rand");Wm.exports.Rand=ks;ks.prototype.generate=o(function(e){return this._rand(e)},"generate");ks.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n<r.length;n++)r[n]=this.rand.getByte();return r},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?ks.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?ks.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r},"_rand"):typeof window=="object"&&(ks.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(Vm=require("crypto"),typeof Vm.randomBytes!="function")throw new Error("Not supported");ks.prototype._rand=o(function(e){return Vm.randomBytes(e)},"_rand")}catch{}var Vm});var gu=De((yK,x3)=>{"use strict";var Ma=no(),bu=Ln(),Hh=bu.getNAF,JD=bu.getJSF,zh=bu.assert;function Is(t,e){this.type=t,this.p=new Ma(e.p,16),this.red=e.prime?Ma.red(e.prime):Ma.mont(this.p),this.zero=new Ma(0).toRed(this.red),this.one=new Ma(1).toRed(this.red),this.two=new Ma(2).toRed(this.red),this.n=e.n&&new Ma(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Is,"BaseCurve");x3.exports=Is;Is.prototype.point=o(function(){throw new Error("Not implemented")},"point");Is.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Is.prototype._fixedNafMul=o(function(e,r){zh(e.precomputed);var n=e._getDoubles(),i=Hh(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],u,m;for(u=0;u<i.length;u+=n.step){m=0;for(var v=u+n.step-1;v>=u;v--)m=(m<<1)+i[v];c.push(m)}for(var x=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)m=c[u],m===O?S=S.mixedAdd(n.points[u]):m===-O&&(S=S.mixedAdd(n.points[u].neg()));x=x.add(S)}return x.toP()},"_fixedNafMul");Is.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=Hh(r,n,this._bitLength),u=this.jpoint(null,null,null),m=c.length-1;m>=0;m--){for(var v=0;m>=0&&c[m]===0;m--)v++;if(m>=0&&v++,u=u.dblp(v),m<0)break;var x=c[m];zh(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(a[x-1>>1]):u=u.mixedAdd(a[-x-1>>1].neg()):x>0?u=u.add(a[x-1>>1]):u=u.add(a[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Is.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,m=this._wnafT3,v=0,x,S,O;for(x=0;x<i;x++){O=r[x];var R=O._getNAFPoints(e);c[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var D=x-1,P=x;if(c[D]!==1||c[P]!==1){m[D]=Hh(n[D],c[D],this._bitLength),m[P]=Hh(n[P],c[P],this._bitLength),v=Math.max(m[D].length,v),v=Math.max(m[P].length,v);continue}var J=[r[D],null,null,r[P]];r[D].y.cmp(r[P].y)===0?(J[1]=r[D].add(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg())):r[D].y.cmp(r[P].y.redNeg())===0?(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].add(r[P].neg())):(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg()));var B=[-3,-1,-5,-7,0,7,5,1,3],W=JD(n[D],n[P]);for(v=Math.max(W[0].length,v),m[D]=new Array(v),m[P]=new Array(v),S=0;S<v;S++){var Q=W[0][S]|0,Y=W[1][S]|0;m[D][S]=B[(Q+1)*3+(Y+1)],m[P][S]=0,u[D]=J}}var oe=this.jpoint(null,null,null),j=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var G=!0;for(S=0;S<i;S++)j[S]=m[S][x]|0,j[S]!==0&&(G=!1);if(!G)break;H++,x--}if(x>=0&&H++,oe=oe.dblp(H),x<0)break;for(S=0;S<i;S++){var le=j[S];le!==0&&(le>0?O=u[S][le-1>>1]:le<0&&(O=u[S][-le-1>>1].neg()),O.type==="affine"?oe=oe.mixedAdd(O):oe=oe.add(O))}}for(x=0;x<i;x++)u[x]=null;return a?oe:oe.toP()},"_wnafMulAdd");function di(t,e){this.curve=t,this.type=e,this.precomputed=null}o(di,"BasePoint");Is.BasePoint=di;di.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");di.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Is.prototype.decodePoint=o(function(e,r){e=bu.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?zh(e[e.length-1]%2===0):e[0]===7&&zh(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");di.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");di.prototype._encode=o(function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode");di.prototype.encode=o(function(e,r){return bu.encode(this._encode(r),e)},"encode");di.prototype.precompute=o(function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},"precompute");di.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},"_hasDoubles");di.prototype._getDoubles=o(function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=e){for(var c=0;c<e;c++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");di.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:e,points:r}},"_getNAFPoints");di.prototype._getBeta=o(function(){return null},"_getBeta");di.prototype.dblp=o(function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r},"dblp")});var vu=De((xK,Ym)=>{typeof Object.create=="function"?Ym.exports=o(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Ym.exports=o(function(e,r){if(r){e.super_=r;var n=o(function(){},"TempCtor");n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var _3=De((wK,w3)=>{"use strict";var YD=Ln(),ur=no(),Xm=vu(),Hf=gu(),XD=YD.assert;function pi(t){Hf.call(this,"short",t),this.a=new ur(t.a,16).toRed(this.red),this.b=new ur(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(pi,"ShortCurve");Xm(pi,Hf);w3.exports=pi;pi.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ur(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new ur(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],XD(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new ur(u.a,16),b:new ur(u.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism");pi.prototype._getEndoRoots=o(function(e){var r=e===this.p?this.red:ur.mont(e),n=new ur(2).toRed(r).redInvm(),i=n.redNeg(),a=new ur(3).toRed(r).redNeg().redSqrt().redMul(n),c=i.redAdd(a).fromRed(),u=i.redSub(a).fromRed();return[c,u]},"_getEndoRoots");pi.prototype._getEndoBasis=o(function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),a=new ur(1),c=new ur(0),u=new ur(0),m=new ur(1),v,x,S,O,R,D,P,J=0,B,W;n.cmpn(0)!==0;){var Q=i.div(n);B=i.sub(Q.mul(n)),W=u.sub(Q.mul(a));var Y=m.sub(Q.mul(c));if(!S&&B.cmp(r)<0)v=P.neg(),x=a,S=B.neg(),O=W;else if(S&&++J===2)break;P=B,i=n,n=B,u=a,a=W,m=c,c=Y}R=B.neg(),D=W;var oe=S.sqr().add(O.sqr()),j=R.sqr().add(D.sqr());return j.cmp(oe)>=0&&(R=v,D=x),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),D=D.neg()),[{a:S,b:O},{a:R,b:D}]},"_getEndoBasis");pi.prototype._endoSplit=o(function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),c=n.b.neg().mul(e).divRound(this.n),u=a.mul(n.a),m=c.mul(i.a),v=a.mul(n.b),x=c.mul(i.b),S=e.sub(u).sub(m),O=v.add(x).neg();return{k1:S,k2:O}},"_endoSplit");pi.prototype.pointFromX=o(function(e,r){e=new ur(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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");pi.prototype.validate=o(function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},"validate");pi.prototype._endoWnafMulAdd=o(function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var u=this._endoSplit(r[c]),m=e[c],v=m._getBeta();u.k1.negative&&(u.k1.ineg(),m=m.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=m,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return x},"_endoWnafMulAdd");function Sr(t,e,r,n){Hf.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ur(e,16),this.y=new ur(r,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(Sr,"Point");Xm(Sr,Hf.BasePoint);pi.prototype.point=o(function(e,r,n){return new Sr(this,e,r,n)},"point");pi.prototype.pointFromJSON=o(function(e,r){return Sr.fromJSON(this,e,r)},"pointFromJSON");Sr.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(a){return n.point(a.x.redMul(n.endo.beta),a.y)},"endoMul");e.beta=r,r.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 r}},"_getBeta");Sr.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");Sr.fromJSON=o(function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function a(u){return e.point(u[0],u[1],n)}o(a,"obj2point");var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(a))}},i},"fromJSON");Sr.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");Sr.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Sr.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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Sr.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),c=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,u)},"dbl");Sr.prototype.getX=o(function(){return this.x.fromRed()},"getX");Sr.prototype.getY=o(function(){return this.y.fromRed()},"getY");Sr.prototype.mul=o(function(e){return e=new ur(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");Sr.prototype.mulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},"mulAdd");Sr.prototype.jmulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)},"jmulAdd");Sr.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");Sr.prototype.neg=o(function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(a){return a.neg()},"negate");r.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 r},"neg");Sr.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 Lr(t,e,r,n){Hf.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ur(0)):(this.x=new ur(e,16),this.y=new ur(r,16),this.z=new ur(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(Lr,"JPoint");Xm(Lr,Hf.BasePoint);pi.prototype.jpoint=o(function(e,r,n){return new Lr(this,e,r,n)},"jpoint");Lr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)},"toP");Lr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Lr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),m=i.redSub(a),v=c.redSub(u);if(m.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=m.redSqr(),S=x.redMul(m),O=i.redMul(x),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),D=v.redMul(O.redISub(R)).redISub(c.redMul(S)),P=this.z.redMul(e.z).redMul(m);return this.curve.jpoint(R,D,P)},"add");Lr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,c=e.y.redMul(r).redMul(this.z),u=n.redSub(i),m=a.redSub(c);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),x=v.redMul(u),S=n.redMul(v),O=m.redSqr().redIAdd(x).redISub(S).redISub(S),R=m.redMul(S.redISub(O)).redISub(a.redMul(x)),D=this.z.redMul(u);return this.curve.jpoint(O,R,D)},"mixedAdd");Lr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,c=this.x,u=this.y,m=this.z,v=m.redSqr().redSqr(),x=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=x.redSqr(),R=O.redSqr(),D=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),P=c.redMul(O),J=D.redSqr().redISub(P.redAdd(P)),B=P.redISub(J),W=D.redMul(B);W=W.redIAdd(W).redISub(R);var Q=x.redMul(m);r+1<e&&(v=v.redMul(R)),c=J,m=Q,x=W}return this.curve.jpoint(c,x.redMul(a),m)},"dblp");Lr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Lr.prototype._zeroDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i),v=m.redSqr().redISub(u).redISub(u),x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),e=v,r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),D=this.x.redAdd(O).redSqr().redISub(S).redISub(R);D=D.redIAdd(D);var P=S.redAdd(S).redIAdd(S),J=P.redSqr(),B=R.redIAdd(R);B=B.redIAdd(B),B=B.redIAdd(B),e=J.redISub(D).redISub(D),r=P.redMul(D.redISub(e)).redISub(B),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)},"_zeroDbl");Lr.prototype._threeDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),v=m.redSqr().redISub(u).redISub(u);e=v;var x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),D=this.x.redSub(S).redMul(this.x.redAdd(S));D=D.redAdd(D).redIAdd(D);var P=R.redIAdd(R);P=P.redIAdd(P);var J=P.redAdd(P);e=D.redSqr().redISub(J),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(S);var B=O.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B),r=D.redMul(P.redISub(e)).redISub(B)}return this.curve.jpoint(e,r,n)},"_threeDbl");Lr.prototype._dbl=o(function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),c=r.redSqr(),u=n.redSqr(),m=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var x=v.redMul(u),S=m.redSqr().redISub(x.redAdd(x)),O=x.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=m.redMul(O).redISub(R),P=n.redAdd(n).redMul(i);return this.curve.jpoint(S,D,P)},"_dbl");Lr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(c);var m=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=a.redIAdd(u).redSqr().redISub(c).redISub(m).redISub(v),S=r.redMul(x);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(m).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(x.redMul(v.redISub(x)).redISub(u.redMul(m)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=this.z.redAdd(u).redSqr().redISub(n).redISub(m);return this.curve.jpoint(O,R,D)},"trpl");Lr.prototype.mul=o(function(e,r){return e=new ur(e,r),this.curve._wnafMul(this,e)},"mul");Lr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Lr.prototype.eqXToP=o(function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},"eqXToP");Lr.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");Lr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var S3=De((_K,A3)=>{"use strict";var zf=no(),E3=vu(),Kh=gu(),ZD=Ln();function Kf(t){Kh.call(this,"mont",t),this.a=new zf(t.a,16).toRed(this.red),this.b=new zf(t.b,16).toRed(this.red),this.i4=new zf(4).toRed(this.red).redInvm(),this.two=new zf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Kf,"MontCurve");E3(Kf,Kh);A3.exports=Kf;Kf.prototype.validate=o(function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0},"validate");function Mr(t,e,r){Kh.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new zf(e,16),this.z=new zf(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(Mr,"Point");E3(Mr,Kh.BasePoint);Kf.prototype.decodePoint=o(function(e,r){return this.point(ZD.toArray(e,r),1)},"decodePoint");Kf.prototype.point=o(function(e,r){return new Mr(this,e,r)},"point");Kf.prototype.pointFromJSON=o(function(e){return Mr.fromJSON(this,e)},"pointFromJSON");Mr.prototype.precompute=o(function(){},"precompute");Mr.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");Mr.fromJSON=o(function(e,r){return new Mr(e,r[0],r[1]||e.one)},"fromJSON");Mr.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");Mr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");Mr.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),c=r.redMul(i),u=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(c,u)},"dbl");Mr.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");Mr.prototype.diffAdd=o(function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z),u=c.redMul(n),m=a.redMul(i),v=r.z.redMul(u.redAdd(m).redSqr()),x=r.x.redMul(u.redISub(m).redSqr());return this.curve.point(v,x)},"diffAdd");Mr.prototype.mul=o(function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,c=[];r.cmpn(0)!==0;r.iushrn(1))c.push(r.andln(1));for(var u=c.length-1;u>=0;u--)c[u]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i},"mul");Mr.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");Mr.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");Mr.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");Mr.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");Mr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var C3=De((EK,T3)=>{"use strict";var QD=Ln(),zo=no(),M3=vu(),jh=gu(),eO=QD.assert;function io(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,jh.call(this,"edwards",t),this.a=new zo(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new zo(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new zo(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),eO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}o(io,"EdwardsCurve");M3(io,jh);T3.exports=io;io.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");io.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");io.prototype.jpoint=o(function(e,r,n,i){return this.point(e,r,n,i)},"jpoint");io.prototype.pointFromX=o(function(e,r){e=new zo(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),c=i.redMul(a.redInvm()),u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var m=u.fromRed().isOdd();return(r&&!m||!r&&m)&&(u=u.redNeg()),this.point(e,u)},"pointFromX");io.prototype.pointFromY=o(function(e,r){e=new zo(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),c=i.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=c.redSqrt();if(u.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)},"pointFromY");io.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0},"validate");function rr(t,e,r,n,i){jh.BasePoint.call(this,t,"projective"),e===null&&r===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 zo(e,16),this.y=new zo(r,16),this.z=n?new zo(n,16):this.curve.one,this.t=i&&new zo(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(rr,"Point");M3(rr,jh.BasePoint);io.prototype.pointFromJSON=o(function(e){return rr.fromJSON(this,e)},"pointFromJSON");io.prototype.point=o(function(e,r,n,i){return new rr(this,e,r,n,i)},"point");rr.fromJSON=o(function(e,r){return new rr(e,r[0],r[1],r[2])},"fromJSON");rr.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");rr.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");rr.prototype._extDbl=o(function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),c=i.redAdd(r),u=c.redSub(n),m=i.redSub(r),v=a.redMul(u),x=c.redMul(m),S=a.redMul(m),O=u.redMul(c);return this.curve.point(v,x,O,S)},"_extDbl");rr.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,c,u,m,v;if(this.curve.twisted){u=this.curve._mulA(r);var x=u.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(x.redSub(this.curve.two)),a=x.redMul(u.redSub(n)),c=x.redSqr().redSub(x).redSub(x)):(m=this.z.redSqr(),v=x.redSub(m).redISub(m),i=e.redSub(r).redISub(n).redMul(v),a=x.redMul(u.redSub(n)),c=x.redMul(v))}else u=r.redAdd(n),m=this.curve._mulC(this.z).redSqr(),v=u.redSub(m).redSub(m),i=this.curve._mulC(e.redISub(u)).redMul(v),a=this.curve._mulC(u).redMul(r.redISub(n)),c=u.redMul(v);return this.curve.point(i,a,c)},"_projDbl");rr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");rr.prototype._extAdd=o(function(e){var r=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),a=this.z.redMul(e.z.redAdd(e.z)),c=n.redSub(r),u=a.redSub(i),m=a.redAdd(i),v=n.redAdd(r),x=c.redMul(u),S=m.redMul(v),O=c.redMul(v),R=u.redMul(m);return this.curve.point(x,S,R,O)},"_extAdd");rr.prototype._projAdd=o(function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(i).redMul(a),u=n.redSub(c),m=n.redAdd(c),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),x=r.redMul(u).redMul(v),S,O;return this.curve.twisted?(S=r.redMul(m).redMul(a.redSub(this.curve._mulA(i))),O=u.redMul(m)):(S=r.redMul(m).redMul(a.redSub(i)),O=this.curve._mulC(u).redMul(m)),this.curve.point(x,S,O)},"_projAdd");rr.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");rr.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");rr.prototype.mulAdd=o(function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)},"mulAdd");rr.prototype.jmulAdd=o(function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)},"jmulAdd");rr.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");rr.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");rr.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");rr.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");rr.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");rr.prototype.eqXToP=o(function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===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(r.redIAdd(i),this.x.cmp(r)===0)return!0}},"eqXToP");rr.prototype.toP=rr.prototype.normalize;rr.prototype.mixedAdd=rr.prototype.add});var Zm=De(k3=>{"use strict";var Gh=k3;Gh.base=gu();Gh.short=_3();Gh.mont=S3();Gh.edwards=C3()});var Bi=De(Qt=>{"use strict";var tO=Cs(),rO=vu();Qt.inherits=rO;function nO(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}o(nO,"isSurrogatePair");function iO(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=a&63|128):nO(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}o(iO,"toArray");Qt.toArray=iO;function oO(t){for(var e="",r=0;r<t.length;r++)e+=D3(t[r].toString(16));return e}o(oO,"toHex");Qt.toHex=oO;function I3(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}o(I3,"htonl");Qt.htonl=I3;function sO(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=I3(i)),r+=O3(i.toString(16))}return r}o(sO,"toHex32");Qt.toHex32=sO;function D3(t){return t.length===1?"0"+t:t}o(D3,"zero2");Qt.zero2=D3;function O3(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}o(O3,"zero8");Qt.zero8=O3;function aO(t,e,r,n){var i=r-e;tO(i%4===0);for(var a=new Array(i/4),c=0,u=e;c<a.length;c++,u+=4){var m;n==="big"?m=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:m=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],a[c]=m>>>0}return a}o(aO,"join32");Qt.join32=aO;function fO(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var a=t[n];e==="big"?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}o(fO,"split32");Qt.split32=fO;function cO(t,e){return t>>>e|t<<32-e}o(cO,"rotr32");Qt.rotr32=cO;function uO(t,e){return t<<e|t>>>32-e}o(uO,"rotl32");Qt.rotl32=uO;function lO(t,e){return t+e>>>0}o(lO,"sum32");Qt.sum32=lO;function hO(t,e,r){return t+e+r>>>0}o(hO,"sum32_3");Qt.sum32_3=hO;function dO(t,e,r,n){return t+e+r+n>>>0}o(dO,"sum32_4");Qt.sum32_4=dO;function pO(t,e,r,n,i){return t+e+r+n+i>>>0}o(pO,"sum32_5");Qt.sum32_5=pO;function mO(t,e,r,n){var i=t[e],a=t[e+1],c=n+a>>>0,u=(c<n?1:0)+r+i;t[e]=u>>>0,t[e+1]=c}o(mO,"sum64");Qt.sum64=mO;function bO(t,e,r,n){var i=e+n>>>0,a=(i<e?1:0)+t+r;return a>>>0}o(bO,"sum64_hi");Qt.sum64_hi=bO;function gO(t,e,r,n){var i=e+n;return i>>>0}o(gO,"sum64_lo");Qt.sum64_lo=gO;function vO(t,e,r,n,i,a,c,u){var m=0,v=e;v=v+n>>>0,m+=v<e?1:0,v=v+a>>>0,m+=v<a?1:0,v=v+u>>>0,m+=v<u?1:0;var x=t+r+i+c+m;return x>>>0}o(vO,"sum64_4_hi");Qt.sum64_4_hi=vO;function yO(t,e,r,n,i,a,c,u){var m=e+n+a+u;return m>>>0}o(yO,"sum64_4_lo");Qt.sum64_4_lo=yO;function xO(t,e,r,n,i,a,c,u,m,v){var x=0,S=e;S=S+n>>>0,x+=S<e?1:0,S=S+a>>>0,x+=S<a?1:0,S=S+u>>>0,x+=S<u?1:0,S=S+v>>>0,x+=S<v?1:0;var O=t+r+i+c+m+x;return O>>>0}o(xO,"sum64_5_hi");Qt.sum64_5_hi=xO;function wO(t,e,r,n,i,a,c,u,m,v){var x=e+n+a+u+v;return x>>>0}o(wO,"sum64_5_lo");Qt.sum64_5_lo=wO;function _O(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}o(_O,"rotr64_hi");Qt.rotr64_hi=_O;function EO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(EO,"rotr64_lo");Qt.rotr64_lo=EO;function AO(t,e,r){return t>>>r}o(AO,"shr64_hi");Qt.shr64_hi=AO;function SO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(SO,"shr64_lo");Qt.shr64_lo=SO});var jf=De(N3=>{"use strict";var R3=Bi(),MO=Cs();function Vh(){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(Vh,"BlockHash");N3.BlockHash=Vh;Vh.prototype.update=o(function(e,r){if(e=R3.toArray(e,r),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=R3.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");Vh.prototype.digest=o(function(e){return this.update(this._pad()),MO(this.pending===null),this._digest(e)},"digest");Vh.prototype._pad=o(function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var a=1;a<n;a++)i[a]=0;if(e<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)i[a++]=0;i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=e>>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,c=8;c<this.padLength;c++)i[a++]=0;return i},"pad")});var Qm=De(Ko=>{"use strict";var TO=Bi(),oo=TO.rotr32;function CO(t,e,r,n){if(t===0)return P3(e,r,n);if(t===1||t===3)return B3(e,r,n);if(t===2)return L3(e,r,n)}o(CO,"ft_1");Ko.ft_1=CO;function P3(t,e,r){return t&e^~t&r}o(P3,"ch32");Ko.ch32=P3;function L3(t,e,r){return t&e^t&r^e&r}o(L3,"maj32");Ko.maj32=L3;function B3(t,e,r){return t^e^r}o(B3,"p32");Ko.p32=B3;function kO(t){return oo(t,2)^oo(t,13)^oo(t,22)}o(kO,"s0_256");Ko.s0_256=kO;function IO(t){return oo(t,6)^oo(t,11)^oo(t,25)}o(IO,"s1_256");Ko.s1_256=IO;function DO(t){return oo(t,7)^oo(t,18)^t>>>3}o(DO,"g0_256");Ko.g0_256=DO;function OO(t){return oo(t,17)^oo(t,19)^t>>>10}o(OO,"g1_256");Ko.g1_256=OO});var F3=De((CK,$3)=>{"use strict";var Gf=Bi(),RO=jf(),NO=Qm(),e1=Gf.rotl32,yu=Gf.sum32,PO=Gf.sum32_5,LO=NO.ft_1,U3=RO.BlockHash,BO=[1518500249,1859775393,2400959708,3395469782];function so(){if(!(this instanceof so))return new so;U3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(so,"SHA1");Gf.inherits(so,U3);$3.exports=so;so.blockSize=512;so.outSize=160;so.hmacStrength=80;so.padLength=64;so.prototype._update=o(function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=e1(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var a=this.h[0],c=this.h[1],u=this.h[2],m=this.h[3],v=this.h[4];for(i=0;i<n.length;i++){var x=~~(i/20),S=PO(e1(a,5),LO(x,c,u,m),v,n[i],BO[x]);v=m,m=u,u=e1(c,30),c=a,a=S}this.h[0]=yu(this.h[0],a),this.h[1]=yu(this.h[1],c),this.h[2]=yu(this.h[2],u),this.h[3]=yu(this.h[3],m),this.h[4]=yu(this.h[4],v)},"_update");so.prototype._digest=o(function(e){return e==="hex"?Gf.toHex32(this.h,"big"):Gf.split32(this.h,"big")},"digest")});var t1=De((kK,H3)=>{"use strict";var Vf=Bi(),UO=jf(),Wf=Qm(),$O=Cs(),Ui=Vf.sum32,FO=Vf.sum32_4,qO=Vf.sum32_5,HO=Wf.ch32,zO=Wf.maj32,KO=Wf.s0_256,jO=Wf.s1_256,GO=Wf.g0_256,VO=Wf.g1_256,q3=UO.BlockHash,WO=[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 ao(){if(!(this instanceof ao))return new ao;q3.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=WO,this.W=new Array(64)}o(ao,"SHA256");Vf.inherits(ao,q3);H3.exports=ao;ao.blockSize=512;ao.outSize=256;ao.hmacStrength=192;ao.padLength=64;ao.prototype._update=o(function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=FO(VO(n[i-2]),n[i-7],GO(n[i-15]),n[i-16]);var a=this.h[0],c=this.h[1],u=this.h[2],m=this.h[3],v=this.h[4],x=this.h[5],S=this.h[6],O=this.h[7];for($O(this.k.length===n.length),i=0;i<n.length;i++){var R=qO(O,jO(v),HO(v,x,S),this.k[i],n[i]),D=Ui(KO(a),zO(a,c,u));O=S,S=x,x=v,v=Ui(m,R),m=u,u=c,c=a,a=Ui(R,D)}this.h[0]=Ui(this.h[0],a),this.h[1]=Ui(this.h[1],c),this.h[2]=Ui(this.h[2],u),this.h[3]=Ui(this.h[3],m),this.h[4]=Ui(this.h[4],v),this.h[5]=Ui(this.h[5],x),this.h[6]=Ui(this.h[6],S),this.h[7]=Ui(this.h[7],O)},"_update");ao.prototype._digest=o(function(e){return e==="hex"?Vf.toHex32(this.h,"big"):Vf.split32(this.h,"big")},"digest")});var j3=De((IK,K3)=>{"use strict";var r1=Bi(),z3=t1();function jo(){if(!(this instanceof jo))return new jo;z3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(jo,"SHA224");r1.inherits(jo,z3);K3.exports=jo;jo.blockSize=512;jo.outSize=224;jo.hmacStrength=192;jo.padLength=64;jo.prototype._digest=o(function(e){return e==="hex"?r1.toHex32(this.h.slice(0,7),"big"):r1.split32(this.h.slice(0,7),"big")},"digest")});var o1=De((DK,J3)=>{"use strict";var vn=Bi(),JO=jf(),YO=Cs(),fo=vn.rotr64_hi,co=vn.rotr64_lo,G3=vn.shr64_hi,V3=vn.shr64_lo,Ds=vn.sum64,n1=vn.sum64_hi,i1=vn.sum64_lo,XO=vn.sum64_4_hi,ZO=vn.sum64_4_lo,QO=vn.sum64_5_hi,eR=vn.sum64_5_lo,W3=JO.BlockHash,tR=[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 $i(){if(!(this instanceof $i))return new $i;W3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=tR,this.W=new Array(160)}o($i,"SHA512");vn.inherits($i,W3);J3.exports=$i;$i.blockSize=1024;$i.outSize=512;$i.hmacStrength=192;$i.padLength=128;$i.prototype._prepareBlock=o(function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var a=hR(n[i-4],n[i-3]),c=dR(n[i-4],n[i-3]),u=n[i-14],m=n[i-13],v=uR(n[i-30],n[i-29]),x=lR(n[i-30],n[i-29]),S=n[i-32],O=n[i-31];n[i]=XO(a,c,u,m,v,x,S,O),n[i+1]=ZO(a,c,u,m,v,x,S,O)}},"_prepareBlock");$i.prototype._update=o(function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],a=this.h[1],c=this.h[2],u=this.h[3],m=this.h[4],v=this.h[5],x=this.h[6],S=this.h[7],O=this.h[8],R=this.h[9],D=this.h[10],P=this.h[11],J=this.h[12],B=this.h[13],W=this.h[14],Q=this.h[15];YO(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var oe=W,j=Q,H=fR(O,R),G=cR(O,R),le=rR(O,R,D,P,J,B),T=nR(O,R,D,P,J,B),h=this.k[Y],y=this.k[Y+1],b=n[Y],l=n[Y+1],p=QO(oe,j,H,G,le,T,h,y,b,l),_=eR(oe,j,H,G,le,T,h,y,b,l);oe=sR(i,a),j=aR(i,a),H=iR(i,a,c,u,m,v),G=oR(i,a,c,u,m,v);var A=n1(oe,j,H,G),E=i1(oe,j,H,G);W=J,Q=B,J=D,B=P,D=O,P=R,O=n1(x,S,p,_),R=i1(S,S,p,_),x=m,S=v,m=c,v=u,c=i,u=a,i=n1(p,_,A,E),a=i1(p,_,A,E)}Ds(this.h,0,i,a),Ds(this.h,2,c,u),Ds(this.h,4,m,v),Ds(this.h,6,x,S),Ds(this.h,8,O,R),Ds(this.h,10,D,P),Ds(this.h,12,J,B),Ds(this.h,14,W,Q)},"_update");$i.prototype._digest=o(function(e){return e==="hex"?vn.toHex32(this.h,"big"):vn.split32(this.h,"big")},"digest");function rR(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}o(rR,"ch64_hi");function nR(t,e,r,n,i,a){var c=e&n^~e&a;return c<0&&(c+=4294967296),c}o(nR,"ch64_lo");function iR(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}o(iR,"maj64_hi");function oR(t,e,r,n,i,a){var c=e&n^e&a^n&a;return c<0&&(c+=4294967296),c}o(oR,"maj64_lo");function sR(t,e){var r=fo(t,e,28),n=fo(e,t,2),i=fo(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(sR,"s0_512_hi");function aR(t,e){var r=co(t,e,28),n=co(e,t,2),i=co(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(aR,"s0_512_lo");function fR(t,e){var r=fo(t,e,14),n=fo(t,e,18),i=fo(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}o(fR,"s1_512_hi");function cR(t,e){var r=co(t,e,14),n=co(t,e,18),i=co(e,t,9),a=r^n^i;return a<0&&(a+=4294967296),a}o(cR,"s1_512_lo");function uR(t,e){var r=fo(t,e,1),n=fo(t,e,8),i=G3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(uR,"g0_512_hi");function lR(t,e){var r=co(t,e,1),n=co(t,e,8),i=V3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(lR,"g0_512_lo");function hR(t,e){var r=fo(t,e,19),n=fo(e,t,29),i=G3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(hR,"g1_512_hi");function dR(t,e){var r=co(t,e,19),n=co(e,t,29),i=V3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(dR,"g1_512_lo")});var Z3=De((OK,X3)=>{"use strict";var s1=Bi(),Y3=o1();function Go(){if(!(this instanceof Go))return new Go;Y3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(Go,"SHA384");s1.inherits(Go,Y3);X3.exports=Go;Go.blockSize=1024;Go.outSize=384;Go.hmacStrength=192;Go.padLength=128;Go.prototype._digest=o(function(e){return e==="hex"?s1.toHex32(this.h.slice(0,12),"big"):s1.split32(this.h.slice(0,12),"big")},"digest")});var Q3=De(Jf=>{"use strict";Jf.sha1=F3();Jf.sha224=j3();Jf.sha256=t1();Jf.sha384=Z3();Jf.sha512=o1()});var o6=De(i6=>{"use strict";var Ta=Bi(),pR=jf(),Wh=Ta.rotl32,e6=Ta.sum32,xu=Ta.sum32_3,t6=Ta.sum32_4,n6=pR.BlockHash;function uo(){if(!(this instanceof uo))return new uo;n6.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(uo,"RIPEMD160");Ta.inherits(uo,n6);i6.ripemd160=uo;uo.blockSize=512;uo.outSize=160;uo.hmacStrength=192;uo.padLength=64;uo.prototype._update=o(function(e,r){for(var n=this.h[0],i=this.h[1],a=this.h[2],c=this.h[3],u=this.h[4],m=n,v=i,x=a,S=c,O=u,R=0;R<80;R++){var D=e6(Wh(t6(n,r6(R,i,a,c),e[gR[R]+r],mR(R)),yR[R]),u);n=u,u=c,c=Wh(a,10),a=i,i=D,D=e6(Wh(t6(m,r6(79-R,v,x,S),e[vR[R]+r],bR(R)),xR[R]),O),m=O,O=S,S=Wh(x,10),x=v,v=D}D=xu(this.h[1],a,S),this.h[1]=xu(this.h[2],c,O),this.h[2]=xu(this.h[3],u,m),this.h[3]=xu(this.h[4],n,v),this.h[4]=xu(this.h[0],i,x),this.h[0]=D},"update");uo.prototype._digest=o(function(e){return e==="hex"?Ta.toHex32(this.h,"little"):Ta.split32(this.h,"little")},"digest");function r6(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}o(r6,"f");function mR(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}o(mR,"K");function bR(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}o(bR,"Kh");var gR=[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],vR=[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],yR=[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],xR=[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 a6=De((PK,s6)=>{"use strict";var wR=Bi(),_R=Cs();function Yf(t,e,r){if(!(this instanceof Yf))return new Yf(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(wR.toArray(e,r))}o(Yf,"Hmac");s6.exports=Yf;Yf.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),_R(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},"init");Yf.prototype.update=o(function(e,r){return this.inner.update(e,r),this},"update");Yf.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var wu=De(f6=>{var Br=f6;Br.utils=Bi();Br.common=jf();Br.sha=Q3();Br.ripemd=o6();Br.hmac=a6();Br.sha1=Br.sha.sha1;Br.sha256=Br.sha.sha256;Br.sha224=Br.sha.sha224;Br.sha384=Br.sha.sha384;Br.sha512=Br.sha.sha512;Br.ripemd160=Br.ripemd.ripemd160});var u6=De((BK,c6)=>{c6.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 Jh=De(d6=>{"use strict";var f1=d6,Os=wu(),a1=Zm(),ER=Ln(),l6=ER.assert;function h6(t){t.type==="short"?this.curve=new a1.short(t):t.type==="edwards"?this.curve=new a1.edwards(t):this.curve=new a1.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,l6(this.g.validate(),"Invalid curve"),l6(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(h6,"PresetCurve");f1.PresetCurve=h6;function Rs(t,e){Object.defineProperty(f1,t,{configurable:!0,enumerable:!0,get:function(){var r=new h6(e);return Object.defineProperty(f1,t,{configurable:!0,enumerable:!0,value:r}),r}})}o(Rs,"defineCurve");Rs("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:Os.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Rs("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:Os.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Rs("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:Os.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Rs("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:Os.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"]});Rs("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:Os.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"]});Rs("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Os.sha256,gRed:!1,g:["9"]});Rs("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:Os.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c1;try{c1=u6()}catch{c1=void 0}Rs("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:Os.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c1]})});var b6=De(($K,m6)=>{"use strict";var AR=wu(),Ca=jm(),p6=Cs();function Ns(t){if(!(this instanceof Ns))return new Ns(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Ca.toArray(t.entropy,t.entropyEnc||"hex"),r=Ca.toArray(t.nonce,t.nonceEnc||"hex"),n=Ca.toArray(t.pers,t.persEnc||"hex");p6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(Ns,"HmacDRBG");m6.exports=Ns;Ns.prototype._init=o(function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");Ns.prototype._hmac=o(function(){return new AR.hmac(this.hash,this.K)},"hmac");Ns.prototype._update=o(function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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");Ns.prototype.reseed=o(function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Ca.toArray(e,r),n=Ca.toArray(n,i),p6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");Ns.prototype.generate=o(function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Ca.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(n),this._reseed++,Ca.encode(c,r)},"generate")});var v6=De((FK,g6)=>{"use strict";var SR=no(),MR=Ln(),u1=MR.assert;function Gr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(Gr,"KeyPair");g6.exports=Gr;Gr.fromPublic=o(function(e,r,n){return r instanceof Gr?r:new Gr(e,{pub:r,pubEnc:n})},"fromPublic");Gr.fromPrivate=o(function(e,r,n){return r instanceof Gr?r:new Gr(e,{priv:r,privEnc:n})},"fromPrivate");Gr.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");Gr.prototype.getPublic=o(function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},"getPublic");Gr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Gr.prototype._importPrivate=o(function(e,r){this.priv=new SR(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Gr.prototype._importPublic=o(function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?u1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&u1(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,r)},"_importPublic");Gr.prototype.derive=o(function(e){return e.validate()||u1(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Gr.prototype.sign=o(function(e,r,n){return this.ec.sign(e,this,r,n)},"sign");Gr.prototype.verify=o(function(e,r){return this.ec.verify(e,r,this)},"verify");Gr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var w6=De((qK,x6)=>{"use strict";var Yh=no(),d1=Ln(),TR=d1.assert;function Xh(t,e){if(t instanceof Xh)return t;this._importDER(t,e)||(TR(t.r&&t.s,"Signature without r or s"),this.r=new Yh(t.r,16),this.s=new Yh(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Xh,"Signature");x6.exports=Xh;function CR(){this.place=0}o(CR,"Position");function l1(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,c=e.place;a<n;a++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}o(l1,"getLength");function y6(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}o(y6,"rmPadding");Xh.prototype._importDER=o(function(e,r){e=d1.toArray(e,r);var n=new CR;if(e[n.place++]!==48)return!1;var i=l1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=l1(e,n);if(a===!1)return!1;var c=e.slice(n.place,a+n.place);if(n.place+=a,e[n.place++]!==2)return!1;var u=l1(e,n);if(u===!1||e.length!==u+n.place)return!1;var m=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(m[0]===0)if(m[1]&128)m=m.slice(1);else return!1;return this.r=new Yh(c),this.s=new Yh(m),this.recoveryParam=null,!0},"_importDER");function h1(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}o(h1,"constructLength");Xh.prototype.toDER=o(function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=y6(r),n=y6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];h1(i,r.length),i=i.concat(r),i.push(2),h1(i,n.length);var a=i.concat(n),c=[48];return h1(c,a.length),c=c.concat(a),d1.encode(c,e)},"toDER")});var S6=De((HK,A6)=>{"use strict";var ka=no(),_6=b6(),kR=Ln(),p1=Jh(),IR=Jm(),E6=kR.assert,m1=v6(),Zh=w6();function mi(t){if(!(this instanceof mi))return new mi(t);typeof t=="string"&&(E6(Object.prototype.hasOwnProperty.call(p1,t),"Unknown curve "+t),t=p1[t]),t instanceof p1.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}o(mi,"EC");A6.exports=mi;mi.prototype.keyPair=o(function(e){return new m1(this,e)},"keyPair");mi.prototype.keyFromPrivate=o(function(e,r){return m1.fromPrivate(this,e,r)},"keyFromPrivate");mi.prototype.keyFromPublic=o(function(e,r){return m1.fromPublic(this,e,r)},"keyFromPublic");mi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new _6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||IR(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ka(2));;){var a=new ka(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},"genKeyPair");mi.prototype._truncateToN=o(function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");mi.prototype.sign=o(function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ka(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),m=new _6({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new ka(1)),x=0;;x++){var S=i.k?i.k(x):new ka(m.generate(this.n.byteLength()));if(S=this._truncateToN(S,!0),!(S.cmpn(1)<=0||S.cmp(v)>=0)){var O=this.g.mul(S);if(!O.isInfinity()){var R=O.getX(),D=R.umod(this.n);if(D.cmpn(0)!==0){var P=S.invm(this.n).mul(D.mul(r.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(D)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),J^=1),new Zh({r:D,s:P,recoveryParam:J})}}}}}},"sign");mi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new ka(e,16)),n=this.keyFromPublic(n,i),r=new Zh(r,"hex");var a=r.r,c=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),m=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),x;return this.curve._maxwellTrick?(x=this.g.jmulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.eqXToP(a)):(x=this.g.mulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.getX().umod(this.n).cmp(a)===0)},"verify");mi.prototype.recoverPubKey=function(t,e,r,n){E6((3&r)===r,"The recovery param is more than two bits"),e=new Zh(e,n);var i=this.n,a=new ka(t),c=e.r,u=e.s,m=r&1,v=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?c=this.curve.pointFromX(c.add(this.curve.n),m):c=this.curve.pointFromX(c,m);var x=e.r.invm(i),S=i.sub(a).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(S,c,O)};mi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Zh(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var k6=De((zK,C6)=>{"use strict";var _u=Ln(),T6=_u.assert,M6=_u.parseBytes,Xf=_u.cachedProperty;function Tr(t,e){this.eddsa=t,this._secret=M6(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=M6(e.pub)}o(Tr,"KeyPair");Tr.fromPublic=o(function(e,r){return r instanceof Tr?r:new Tr(e,{pub:r})},"fromPublic");Tr.fromSecret=o(function(e,r){return r instanceof Tr?r:new Tr(e,{secret:r})},"fromSecret");Tr.prototype.secret=o(function(){return this._secret},"secret");Xf(Tr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));Xf(Tr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));Xf(Tr,"privBytes",o(function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));Xf(Tr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));Xf(Tr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));Xf(Tr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Tr.prototype.sign=o(function(e){return T6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Tr.prototype.verify=o(function(e,r){return this.eddsa.verify(e,r,this)},"verify");Tr.prototype.getSecret=o(function(e){return T6(this._secret,"KeyPair is public only"),_u.encode(this.secret(),e)},"getSecret");Tr.prototype.getPublic=o(function(e){return _u.encode(this.pubBytes(),e)},"getPublic");C6.exports=Tr});var D6=De((KK,I6)=>{"use strict";var DR=no(),Qh=Ln(),OR=Qh.assert,ed=Qh.cachedProperty,RR=Qh.parseBytes;function Ia(t,e){this.eddsa=t,typeof e!="object"&&(e=RR(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),OR(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof DR&&(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(Ia,"Signature");ed(Ia,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));ed(Ia,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));ed(Ia,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));ed(Ia,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Ia.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Ia.prototype.toHex=o(function(){return Qh.encode(this.toBytes(),"hex").toUpperCase()},"toHex");I6.exports=Ia});var L6=De((jK,P6)=>{"use strict";var NR=wu(),PR=Jh(),Zf=Ln(),LR=Zf.assert,R6=Zf.parseBytes,N6=k6(),O6=D6();function yn(t){if(LR(t==="ed25519","only tested with ed25519 so far"),!(this instanceof yn))return new yn(t);t=PR[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=NR.sha512}o(yn,"EDDSA");P6.exports=yn;yn.prototype.sign=o(function(e,r){e=R6(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),c=this.encodePoint(a),u=this.hashInt(c,n.pubBytes(),e).mul(n.priv()),m=i.add(u).umod(this.curve.n);return this.makeSignature({R:a,S:m,Rencoded:c})},"sign");yn.prototype.verify=o(function(e,r,n){e=R6(e),r=this.makeSignature(r);var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),c=this.g.mul(r.S()),u=r.R().add(i.pub().mul(a));return u.eq(c)},"verify");yn.prototype.hashInt=o(function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return Zf.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");yn.prototype.keyFromPublic=o(function(e){return N6.fromPublic(this,e)},"keyFromPublic");yn.prototype.keyFromSecret=o(function(e){return N6.fromSecret(this,e)},"keyFromSecret");yn.prototype.makeSignature=o(function(e){return e instanceof O6?e:new O6(this,e)},"makeSignature");yn.prototype.encodePoint=o(function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},"encodePoint");yn.prototype.decodePoint=o(function(e){e=Zf.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,a=Zf.intFromLE(n);return this.curve.pointFromY(a,i)},"decodePoint");yn.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");yn.prototype.decodeInt=o(function(e){return Zf.intFromLE(e)},"decodeInt");yn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var U6=De(B6=>{"use strict";var Da=B6;Da.version=h3().version;Da.utils=Ln();Da.rand=Jm();Da.curve=Zm();Da.curves=Jh();Da.ec=S6();Da.eddsa=L6()});var F6=De(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.BrowserRandomSource=void 0;var $6=65536,td=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 r=new Uint8Array(e);for(let n=0;n<r.length;n+=$6)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,$6)));return r}};o(td,"BrowserRandomSource");rd.BrowserRandomSource=td});var q6=De(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.NodeRandomSource=void 0;var BR=hi(),nd=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 r=this._crypto.randomBytes(e);if(r.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]=r[i];return(0,BR.wipe)(r),n}};o(nd,"NodeRandomSource");id.NodeRandomSource=nd});var H6=De(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.SystemRandomSource=void 0;var UR=F6(),$R=q6(),od=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new UR.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new $R.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(od,"SystemRandomSource");sd.SystemRandomSource=od});var Oa=De(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.randomStringForEntropy=Vr.randomString=Vr.randomUint32=Vr.randomBytes=Vr.defaultRandomSource=void 0;var FR=H6(),qR=Sa(),z6=hi();Vr.defaultRandomSource=new FR.SystemRandomSource;function b1(t,e=Vr.defaultRandomSource){return e.randomBytes(t)}o(b1,"randomBytes");Vr.randomBytes=b1;function HR(t=Vr.defaultRandomSource){let e=b1(4,t),r=(0,qR.readUint32LE)(e);return(0,z6.wipe)(e),r}o(HR,"randomUint32");Vr.randomUint32=HR;var K6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function j6(t,e=K6,r=Vr.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,a=256-256%i;for(;t>0;){let c=b1(Math.ceil(t*256/a),r);for(let u=0;u<c.length&&t>0;u++){let m=c[u];m<a&&(n+=e.charAt(m%i),t--)}(0,z6.wipe)(c)}return n}o(j6,"randomString");Vr.randomString=j6;function zR(t,e=K6,r=Vr.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return j6(n,e,r)}o(zR,"randomStringForEntropy");Vr.randomStringForEntropy=zR});var W6=De(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var ec=Sa(),Qf=hi();Vo.DIGEST_LENGTH=64;Vo.BLOCK_SIZE=128;var V6=function(){function t(){this.digestLength=Vo.DIGEST_LENGTH,this.blockSize=Vo.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(t,"SHA512"),t.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},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){Qf.wipe(this._buffer),Qf.wipe(this._tempHi),Qf.wipe(this._tempLo),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<Vo.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(g1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=g1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,a=r<<3,c=r%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u<c-8;u++)this._buffer[u]=0;ec.writeUint32BE(i,this._buffer,c-8),ec.writeUint32BE(a,this._buffer,c-4),g1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)ec.writeUint32BE(this._stateHi[u],e,u*8),ec.writeUint32BE(this._stateLo[u],e,u*8+4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.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}},t.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},t.prototype.cleanSavedState=function(e){Qf.wipe(e.stateHi),Qf.wipe(e.stateLo),e.buffer&&Qf.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Vo.SHA512=V6;var G6=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 g1(t,e,r,n,i,a,c){for(var u=r[0],m=r[1],v=r[2],x=r[3],S=r[4],O=r[5],R=r[6],D=r[7],P=n[0],J=n[1],B=n[2],W=n[3],Q=n[4],Y=n[5],oe=n[6],j=n[7],H,G,le,T,h,y,b,l;c>=128;){for(var p=0;p<16;p++){var _=8*p+a;t[p]=ec.readUint32BE(i,_),e[p]=ec.readUint32BE(i,_+4)}for(var p=0;p<80;p++){var A=u,E=m,g=v,C=x,N=S,w=O,k=R,he=D,I=P,Z=J,se=B,q=W,F=Q,ee=Y,ne=oe,ae=j;if(H=D,G=j,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=(S>>>14|Q<<32-14)^(S>>>18|Q<<32-18)^(Q>>>41-32|S<<32-(41-32)),G=(Q>>>14|S<<32-14)^(Q>>>18|S<<32-18)^(S>>>41-32|Q<<32-(41-32)),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=S&O^~S&R,G=Q&Y^~Q&oe,h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=G6[p*2],G=G6[p*2+1],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=t[p%16],G=e[p%16],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,le=b&65535|l<<16,T=h&65535|y<<16,H=le,G=T,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=(u>>>28|P<<32-28)^(P>>>34-32|u<<32-(34-32))^(P>>>39-32|u<<32-(39-32)),G=(P>>>28|u<<32-28)^(u>>>34-32|P<<32-(34-32))^(u>>>39-32|P<<32-(39-32)),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,H=u&m^u&v^m&v,G=P&J^P&B^J&B,h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,he=b&65535|l<<16,ae=h&65535|y<<16,H=C,G=q,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=le,G=T,h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,C=b&65535|l<<16,q=h&65535|y<<16,m=A,v=E,x=g,S=C,O=N,R=w,D=k,u=he,J=I,B=Z,W=se,Q=q,Y=F,oe=ee,j=ne,P=ae,p%16===15)for(var _=0;_<16;_++)H=t[_],G=e[_],h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=t[(_+9)%16],G=e[(_+9)%16],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,le=t[(_+1)%16],T=e[(_+1)%16],H=(le>>>1|T<<32-1)^(le>>>8|T<<32-8)^le>>>7,G=(T>>>1|le<<32-1)^(T>>>8|le<<32-8)^(T>>>7|le<<32-7),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,le=t[(_+14)%16],T=e[(_+14)%16],H=(le>>>19|T<<32-19)^(T>>>61-32|le<<32-(61-32))^le>>>6,G=(T>>>19|le<<32-19)^(le>>>61-32|T<<32-(61-32))^(T>>>6|le<<32-6),h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,t[_]=b&65535|l<<16,e[_]=h&65535|y<<16}H=u,G=P,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[0],G=n[0],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[0]=u=b&65535|l<<16,n[0]=P=h&65535|y<<16,H=m,G=J,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[1],G=n[1],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[1]=m=b&65535|l<<16,n[1]=J=h&65535|y<<16,H=v,G=B,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[2],G=n[2],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[2]=v=b&65535|l<<16,n[2]=B=h&65535|y<<16,H=x,G=W,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[3],G=n[3],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[3]=x=b&65535|l<<16,n[3]=W=h&65535|y<<16,H=S,G=Q,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[4],G=n[4],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[4]=S=b&65535|l<<16,n[4]=Q=h&65535|y<<16,H=O,G=Y,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[5],G=n[5],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[5]=O=b&65535|l<<16,n[5]=Y=h&65535|y<<16,H=R,G=oe,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[6],G=n[6],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[6]=R=b&65535|l<<16,n[6]=oe=h&65535|y<<16,H=D,G=j,h=G&65535,y=G>>>16,b=H&65535,l=H>>>16,H=r[7],G=n[7],h+=G&65535,y+=G>>>16,b+=H&65535,l+=H>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[7]=D=b&65535|l<<16,n[7]=j=h&65535|y<<16,a+=128,c-=128}return a}o(g1,"hashBlocks");function KR(t){var e=new V6;e.update(t);var r=e.digest();return e.clean(),r}o(KR,"hash");Vo.hash=KR});var Su=De(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.convertSecretKeyToX25519=Gt.convertPublicKeyToX25519=Gt.verify=Gt.sign=Gt.extractPublicKeyFromSecretKey=Gt.generateKeyPair=Gt.generateKeyPairFromSeed=Gt.SEED_LENGTH=Gt.SECRET_KEY_LENGTH=Gt.PUBLIC_KEY_LENGTH=Gt.SIGNATURE_LENGTH=void 0;var jR=Oa(),Eu=W6(),Q6=hi();Gt.SIGNATURE_LENGTH=64;Gt.PUBLIC_KEY_LENGTH=32;Gt.SECRET_KEY_LENGTH=64;Gt.SEED_LENGTH=32;function Ge(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}o(Ge,"gf");var GR=new Uint8Array(32);GR[0]=9;var x1=Ge(),tc=Ge([1]),VR=Ge([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),WR=Ge([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),J6=Ge([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Y6=Ge([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),JR=Ge([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ps(t,e){for(let r=0;r<16;r++)t[r]=e[r]|0}o(Ps,"set25519");function v1(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}o(v1,"car25519");function ex(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let a=n&(t[i]^e[i]);t[i]^=a,e[i]^=a}}o(ex,"sel25519");function Au(t,e){let r=Ge(),n=Ge();for(let i=0;i<16;i++)n[i]=e[i];v1(n),v1(n),v1(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let a=r[15]>>16&1;r[14]&=65535,ex(n,r,1-a)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}o(Au,"pack25519");function tx(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}o(tx,"verify32");function X6(t,e){let r=new Uint8Array(32),n=new Uint8Array(32);return Au(r,t),Au(n,e),tx(r,n)}o(X6,"neq25519");function rx(t){let e=new Uint8Array(32);return Au(e,t),e[0]&1}o(rx,"par25519");function YR(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(YR,"unpack25519");function Ra(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(Ra,"add");function Pa(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(Pa,"sub");function Yt(t,e,r){let n,i,a=0,c=0,u=0,m=0,v=0,x=0,S=0,O=0,R=0,D=0,P=0,J=0,B=0,W=0,Q=0,Y=0,oe=0,j=0,H=0,G=0,le=0,T=0,h=0,y=0,b=0,l=0,p=0,_=0,A=0,E=0,g=0,C=r[0],N=r[1],w=r[2],k=r[3],he=r[4],I=r[5],Z=r[6],se=r[7],q=r[8],F=r[9],ee=r[10],ne=r[11],ae=r[12],Ae=r[13],ge=r[14],re=r[15];n=e[0],a+=n*C,c+=n*N,u+=n*w,m+=n*k,v+=n*he,x+=n*I,S+=n*Z,O+=n*se,R+=n*q,D+=n*F,P+=n*ee,J+=n*ne,B+=n*ae,W+=n*Ae,Q+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*N,m+=n*w,v+=n*k,x+=n*he,S+=n*I,O+=n*Z,R+=n*se,D+=n*q,P+=n*F,J+=n*ee,B+=n*ne,W+=n*ae,Q+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,m+=n*N,v+=n*w,x+=n*k,S+=n*he,O+=n*I,R+=n*Z,D+=n*se,P+=n*q,J+=n*F,B+=n*ee,W+=n*ne,Q+=n*ae,Y+=n*Ae,oe+=n*ge,j+=n*re,n=e[3],m+=n*C,v+=n*N,x+=n*w,S+=n*k,O+=n*he,R+=n*I,D+=n*Z,P+=n*se,J+=n*q,B+=n*F,W+=n*ee,Q+=n*ne,Y+=n*ae,oe+=n*Ae,j+=n*ge,H+=n*re,n=e[4],v+=n*C,x+=n*N,S+=n*w,O+=n*k,R+=n*he,D+=n*I,P+=n*Z,J+=n*se,B+=n*q,W+=n*F,Q+=n*ee,Y+=n*ne,oe+=n*ae,j+=n*Ae,H+=n*ge,G+=n*re,n=e[5],x+=n*C,S+=n*N,O+=n*w,R+=n*k,D+=n*he,P+=n*I,J+=n*Z,B+=n*se,W+=n*q,Q+=n*F,Y+=n*ee,oe+=n*ne,j+=n*ae,H+=n*Ae,G+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*N,R+=n*w,D+=n*k,P+=n*he,J+=n*I,B+=n*Z,W+=n*se,Q+=n*q,Y+=n*F,oe+=n*ee,j+=n*ne,H+=n*ae,G+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*N,D+=n*w,P+=n*k,J+=n*he,B+=n*I,W+=n*Z,Q+=n*se,Y+=n*q,oe+=n*F,j+=n*ee,H+=n*ne,G+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,D+=n*N,P+=n*w,J+=n*k,B+=n*he,W+=n*I,Q+=n*Z,Y+=n*se,oe+=n*q,j+=n*F,H+=n*ee,G+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,y+=n*re,n=e[9],D+=n*C,P+=n*N,J+=n*w,B+=n*k,W+=n*he,Q+=n*I,Y+=n*Z,oe+=n*se,j+=n*q,H+=n*F,G+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,y+=n*ge,b+=n*re,n=e[10],P+=n*C,J+=n*N,B+=n*w,W+=n*k,Q+=n*he,Y+=n*I,oe+=n*Z,j+=n*se,H+=n*q,G+=n*F,le+=n*ee,T+=n*ne,h+=n*ae,y+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,B+=n*N,W+=n*w,Q+=n*k,Y+=n*he,oe+=n*I,j+=n*Z,H+=n*se,G+=n*q,le+=n*F,T+=n*ee,h+=n*ne,y+=n*ae,b+=n*Ae,l+=n*ge,p+=n*re,n=e[12],B+=n*C,W+=n*N,Q+=n*w,Y+=n*k,oe+=n*he,j+=n*I,H+=n*Z,G+=n*se,le+=n*q,T+=n*F,h+=n*ee,y+=n*ne,b+=n*ae,l+=n*Ae,p+=n*ge,_+=n*re,n=e[13],W+=n*C,Q+=n*N,Y+=n*w,oe+=n*k,j+=n*he,H+=n*I,G+=n*Z,le+=n*se,T+=n*q,h+=n*F,y+=n*ee,b+=n*ne,l+=n*ae,p+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Q+=n*C,Y+=n*N,oe+=n*w,j+=n*k,H+=n*he,G+=n*I,le+=n*Z,T+=n*se,h+=n*q,y+=n*F,b+=n*ee,l+=n*ne,p+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*N,j+=n*w,H+=n*k,G+=n*he,le+=n*I,T+=n*Z,h+=n*se,y+=n*q,b+=n*F,l+=n*ee,p+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*j,u+=38*H,m+=38*G,v+=38*le,x+=38*T,S+=38*h,O+=38*y,R+=38*b,D+=38*l,P+=38*p,J+=38*_,B+=38*A,W+=38*E,Q+=38*g,i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),t[0]=a,t[1]=c,t[2]=u,t[3]=m,t[4]=v,t[5]=x,t[6]=S,t[7]=O,t[8]=R,t[9]=D,t[10]=P,t[11]=J,t[12]=B,t[13]=W,t[14]=Q,t[15]=Y}o(Yt,"mul");function Na(t,e){Yt(t,e,e)}o(Na,"square");function nx(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)Na(r,r),n!==2&&n!==4&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(nx,"inv25519");function XR(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)Na(r,r),n!==1&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(XR,"pow2523");function w1(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),m=Ge(),v=Ge(),x=Ge();Pa(r,t[1],t[0]),Pa(x,e[1],e[0]),Yt(r,r,x),Ra(n,t[0],t[1]),Ra(x,e[0],e[1]),Yt(n,n,x),Yt(i,t[3],e[3]),Yt(i,i,WR),Yt(a,t[2],e[2]),Ra(a,a,a),Pa(c,n,r),Pa(u,a,i),Ra(m,a,i),Ra(v,n,r),Yt(t[0],c,u),Yt(t[1],v,m),Yt(t[2],m,u),Yt(t[3],c,v)}o(w1,"edadd");function Z6(t,e,r){for(let n=0;n<4;n++)ex(t[n],e[n],r)}o(Z6,"cswap");function E1(t,e){let r=Ge(),n=Ge(),i=Ge();nx(i,e[2]),Yt(r,e[0],i),Yt(n,e[1],i),Au(t,n),t[31]^=rx(r)<<7}o(E1,"pack");function ix(t,e,r){Ps(t[0],x1),Ps(t[1],tc),Ps(t[2],tc),Ps(t[3],x1);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(n&7)&1;Z6(t,e,i),w1(e,t),w1(t,t),Z6(t,e,i)}}o(ix,"scalarmult");function A1(t,e){let r=[Ge(),Ge(),Ge(),Ge()];Ps(r[0],J6),Ps(r[1],Y6),Ps(r[2],tc),Yt(r[3],J6,Y6),ix(t,r,e)}o(A1,"scalarbase");function ox(t){if(t.length!==Gt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Gt.SEED_LENGTH} bytes`);let e=(0,Eu.hash)(t);e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(32),n=[Ge(),Ge(),Ge(),Ge()];A1(n,e),E1(r,n);let i=new Uint8Array(64);return i.set(t),i.set(r,32),{publicKey:r,secretKey:i}}o(ox,"generateKeyPairFromSeed");Gt.generateKeyPairFromSeed=ox;function ZR(t){let e=(0,jR.randomBytes)(32,t),r=ox(e);return(0,Q6.wipe)(e),r}o(ZR,"generateKeyPair");Gt.generateKeyPair=ZR;function QR(t){if(t.length!==Gt.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Gt.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(t.subarray(32))}o(QR,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=QR;var y1=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 sx(t,e){let r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)e[i]+=r-16*e[n]*y1[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=r*256;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*y1[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*y1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=e[n]&255}o(sx,"modL");function _1(t){let e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let r=0;r<64;r++)t[r]=0;sx(t,e)}o(_1,"reduce");function eN(t,e){let r=new Float64Array(64),n=[Ge(),Ge(),Ge(),Ge()],i=(0,Eu.hash)(t.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let a=new Uint8Array(64);a.set(i.subarray(32),32);let c=new Eu.SHA512;c.update(a.subarray(32)),c.update(e);let u=c.digest();c.clean(),_1(u),A1(n,u),E1(a,n),c.reset(),c.update(a.subarray(0,32)),c.update(t.subarray(32)),c.update(e);let m=c.digest();_1(m);for(let v=0;v<32;v++)r[v]=u[v];for(let v=0;v<32;v++)for(let x=0;x<32;x++)r[v+x]+=m[v]*i[x];return sx(a.subarray(32),r),a}o(eN,"sign");Gt.sign=eN;function ax(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),m=Ge();return Ps(t[2],tc),YR(t[1],e),Na(i,t[1]),Yt(a,i,VR),Pa(i,i,t[2]),Ra(a,t[2],a),Na(c,a),Na(u,c),Yt(m,u,c),Yt(r,m,i),Yt(r,r,a),XR(r,r),Yt(r,r,i),Yt(r,r,a),Yt(r,r,a),Yt(t[0],r,a),Na(n,t[0]),Yt(n,n,a),X6(n,i)&&Yt(t[0],t[0],JR),Na(n,t[0]),Yt(n,n,a),X6(n,i)?-1:(rx(t[0])===e[31]>>7&&Pa(t[0],x1,t[0]),Yt(t[3],t[0],t[1]),0)}o(ax,"unpackneg");function tN(t,e,r){let n=new Uint8Array(32),i=[Ge(),Ge(),Ge(),Ge()],a=[Ge(),Ge(),Ge(),Ge()];if(r.length!==Gt.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Gt.SIGNATURE_LENGTH} bytes`);if(ax(a,t))return!1;let c=new Eu.SHA512;c.update(r.subarray(0,32)),c.update(t),c.update(e);let u=c.digest();return _1(u),ix(i,a,u),A1(a,r.subarray(32)),w1(i,a),E1(n,i),!tx(r,n)}o(tN,"verify");Gt.verify=tN;function rN(t){let e=[Ge(),Ge(),Ge(),Ge()];if(ax(e,t))throw new Error("Ed25519: invalid public key");let r=Ge(),n=Ge(),i=e[1];Ra(r,tc,i),Pa(n,tc,i),nx(n,n),Yt(r,r,n);let a=new Uint8Array(32);return Au(a,r),a}o(rN,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=rN;function nN(t){let e=(0,Eu.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(e.subarray(0,32));return(0,Q6.wipe)(e),r}o(nN,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=nN});var cx=De((QK,fx)=>{"use strict";fx.exports=o(function t(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((r,n,i)=>{let a=i===0?"":",",c=n===void 0||typeof n=="symbol"?null:n;return r+a+t(c)},"")+"]":"{"+Object.keys(e).sort().reduce((r,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return r;let a=r.length===0?"":",";return r+a+t(n)+":"+t(e[n])},"")+"}"},"serialize")});var dx=De(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.sharedKey=lr.generateKeyPair=lr.generateKeyPairFromSeed=lr.scalarMultBase=lr.scalarMult=lr.SHARED_KEY_LENGTH=lr.SECRET_KEY_LENGTH=lr.PUBLIC_KEY_LENGTH=void 0;var iN=Oa(),oN=hi();lr.PUBLIC_KEY_LENGTH=32;lr.SECRET_KEY_LENGTH=32;lr.SHARED_KEY_LENGTH=32;function lo(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}o(lo,"gf");var ux=new Uint8Array(32);ux[0]=9;var sN=lo([56129,1]);function S1(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}o(S1,"car25519");function Mu(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let a=n&(t[i]^e[i]);t[i]^=a,e[i]^=a}}o(Mu,"sel25519");function aN(t,e){let r=lo(),n=lo();for(let i=0;i<16;i++)n[i]=e[i];S1(n),S1(n),S1(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let a=r[15]>>16&1;r[14]&=65535,Mu(n,r,1-a)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}o(aN,"pack25519");function fN(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(fN,"unpack25519");function ad(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(ad,"add");function fd(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(fd,"sub");function Wo(t,e,r){let n,i,a=0,c=0,u=0,m=0,v=0,x=0,S=0,O=0,R=0,D=0,P=0,J=0,B=0,W=0,Q=0,Y=0,oe=0,j=0,H=0,G=0,le=0,T=0,h=0,y=0,b=0,l=0,p=0,_=0,A=0,E=0,g=0,C=r[0],N=r[1],w=r[2],k=r[3],he=r[4],I=r[5],Z=r[6],se=r[7],q=r[8],F=r[9],ee=r[10],ne=r[11],ae=r[12],Ae=r[13],ge=r[14],re=r[15];n=e[0],a+=n*C,c+=n*N,u+=n*w,m+=n*k,v+=n*he,x+=n*I,S+=n*Z,O+=n*se,R+=n*q,D+=n*F,P+=n*ee,J+=n*ne,B+=n*ae,W+=n*Ae,Q+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*N,m+=n*w,v+=n*k,x+=n*he,S+=n*I,O+=n*Z,R+=n*se,D+=n*q,P+=n*F,J+=n*ee,B+=n*ne,W+=n*ae,Q+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,m+=n*N,v+=n*w,x+=n*k,S+=n*he,O+=n*I,R+=n*Z,D+=n*se,P+=n*q,J+=n*F,B+=n*ee,W+=n*ne,Q+=n*ae,Y+=n*Ae,oe+=n*ge,j+=n*re,n=e[3],m+=n*C,v+=n*N,x+=n*w,S+=n*k,O+=n*he,R+=n*I,D+=n*Z,P+=n*se,J+=n*q,B+=n*F,W+=n*ee,Q+=n*ne,Y+=n*ae,oe+=n*Ae,j+=n*ge,H+=n*re,n=e[4],v+=n*C,x+=n*N,S+=n*w,O+=n*k,R+=n*he,D+=n*I,P+=n*Z,J+=n*se,B+=n*q,W+=n*F,Q+=n*ee,Y+=n*ne,oe+=n*ae,j+=n*Ae,H+=n*ge,G+=n*re,n=e[5],x+=n*C,S+=n*N,O+=n*w,R+=n*k,D+=n*he,P+=n*I,J+=n*Z,B+=n*se,W+=n*q,Q+=n*F,Y+=n*ee,oe+=n*ne,j+=n*ae,H+=n*Ae,G+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*N,R+=n*w,D+=n*k,P+=n*he,J+=n*I,B+=n*Z,W+=n*se,Q+=n*q,Y+=n*F,oe+=n*ee,j+=n*ne,H+=n*ae,G+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*N,D+=n*w,P+=n*k,J+=n*he,B+=n*I,W+=n*Z,Q+=n*se,Y+=n*q,oe+=n*F,j+=n*ee,H+=n*ne,G+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,D+=n*N,P+=n*w,J+=n*k,B+=n*he,W+=n*I,Q+=n*Z,Y+=n*se,oe+=n*q,j+=n*F,H+=n*ee,G+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,y+=n*re,n=e[9],D+=n*C,P+=n*N,J+=n*w,B+=n*k,W+=n*he,Q+=n*I,Y+=n*Z,oe+=n*se,j+=n*q,H+=n*F,G+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,y+=n*ge,b+=n*re,n=e[10],P+=n*C,J+=n*N,B+=n*w,W+=n*k,Q+=n*he,Y+=n*I,oe+=n*Z,j+=n*se,H+=n*q,G+=n*F,le+=n*ee,T+=n*ne,h+=n*ae,y+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,B+=n*N,W+=n*w,Q+=n*k,Y+=n*he,oe+=n*I,j+=n*Z,H+=n*se,G+=n*q,le+=n*F,T+=n*ee,h+=n*ne,y+=n*ae,b+=n*Ae,l+=n*ge,p+=n*re,n=e[12],B+=n*C,W+=n*N,Q+=n*w,Y+=n*k,oe+=n*he,j+=n*I,H+=n*Z,G+=n*se,le+=n*q,T+=n*F,h+=n*ee,y+=n*ne,b+=n*ae,l+=n*Ae,p+=n*ge,_+=n*re,n=e[13],W+=n*C,Q+=n*N,Y+=n*w,oe+=n*k,j+=n*he,H+=n*I,G+=n*Z,le+=n*se,T+=n*q,h+=n*F,y+=n*ee,b+=n*ne,l+=n*ae,p+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Q+=n*C,Y+=n*N,oe+=n*w,j+=n*k,H+=n*he,G+=n*I,le+=n*Z,T+=n*se,h+=n*q,y+=n*F,b+=n*ee,l+=n*ne,p+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*N,j+=n*w,H+=n*k,G+=n*he,le+=n*I,T+=n*Z,h+=n*se,y+=n*q,b+=n*F,l+=n*ee,p+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*j,u+=38*H,m+=38*G,v+=38*le,x+=38*T,S+=38*h,O+=38*y,R+=38*b,D+=38*l,P+=38*p,J+=38*_,B+=38*A,W+=38*E,Q+=38*g,i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),i=1,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=c+i+65535,i=Math.floor(n/65536),c=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=m+i+65535,i=Math.floor(n/65536),m=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=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=D+i+65535,i=Math.floor(n/65536),D=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=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=W+i+65535,i=Math.floor(n/65536),W=n-i*65536,n=Q+i+65535,i=Math.floor(n/65536),Q=n-i*65536,n=Y+i+65535,i=Math.floor(n/65536),Y=n-i*65536,a+=i-1+37*(i-1),t[0]=a,t[1]=c,t[2]=u,t[3]=m,t[4]=v,t[5]=x,t[6]=S,t[7]=O,t[8]=R,t[9]=D,t[10]=P,t[11]=J,t[12]=B,t[13]=W,t[14]=Q,t[15]=Y}o(Wo,"mul");function Tu(t,e){Wo(t,e,e)}o(Tu,"square");function cN(t,e){let r=lo();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)Tu(r,r),n!==2&&n!==4&&Wo(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}o(cN,"inv25519");function M1(t,e){let r=new Uint8Array(32),n=new Float64Array(80),i=lo(),a=lo(),c=lo(),u=lo(),m=lo(),v=lo();for(let R=0;R<31;R++)r[R]=t[R];r[31]=t[31]&127|64,r[0]&=248,fN(n,e);for(let R=0;R<16;R++)a[R]=n[R];i[0]=u[0]=1;for(let R=254;R>=0;--R){let D=r[R>>>3]>>>(R&7)&1;Mu(i,a,D),Mu(c,u,D),ad(m,i,c),fd(i,i,c),ad(c,a,u),fd(a,a,u),Tu(u,m),Tu(v,i),Wo(i,c,i),Wo(c,a,m),ad(m,i,c),fd(i,i,c),Tu(a,i),fd(c,u,v),Wo(i,c,sN),ad(i,i,u),Wo(c,c,i),Wo(i,u,v),Wo(u,a,n),Tu(a,m),Mu(i,a,D),Mu(c,u,D)}for(let R=0;R<16;R++)n[R+16]=i[R],n[R+32]=c[R],n[R+48]=a[R],n[R+64]=u[R];let x=n.subarray(32),S=n.subarray(16);cN(x,x),Wo(S,S,x);let O=new Uint8Array(32);return aN(O,S),O}o(M1,"scalarMult");lr.scalarMult=M1;function lx(t){return M1(t,ux)}o(lx,"scalarMultBase");lr.scalarMultBase=lx;function hx(t){if(t.length!==lr.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${lr.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(t);return{publicKey:lx(e),secretKey:e}}o(hx,"generateKeyPairFromSeed");lr.generateKeyPairFromSeed=hx;function uN(t){let e=(0,iN.randomBytes)(32,t),r=hx(e);return(0,oN.wipe)(e),r}o(uN,"generateKeyPair");lr.generateKeyPair=uN;function lN(t,e,r=!1){if(t.length!==lr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==lr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=M1(t,e);if(r){let i=0;for(let a=0;a<n.length;a++)i|=n[a];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(lN,"sharedKey");lr.sharedKey=lN});var C1=De(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var Wr=Sa(),T1=hi(),hN=20;function dN(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],m=r[7]<<24|r[6]<<16|r[5]<<8|r[4],v=r[11]<<24|r[10]<<16|r[9]<<8|r[8],x=r[15]<<24|r[14]<<16|r[13]<<8|r[12],S=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],D=r[31]<<24|r[30]<<16|r[29]<<8|r[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],J=e[7]<<24|e[6]<<16|e[5]<<8|e[4],B=e[11]<<24|e[10]<<16|e[9]<<8|e[8],W=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Q=n,Y=i,oe=a,j=c,H=u,G=m,le=v,T=x,h=S,y=O,b=R,l=D,p=P,_=J,A=B,E=W,g=0;g<hN;g+=2)Q=Q+H|0,p^=Q,p=p>>>32-16|p<<16,h=h+p|0,H^=h,H=H>>>32-12|H<<12,Y=Y+G|0,_^=Y,_=_>>>32-16|_<<16,y=y+_|0,G^=y,G=G>>>32-12|G<<12,oe=oe+le|0,A^=oe,A=A>>>32-16|A<<16,b=b+A|0,le^=b,le=le>>>32-12|le<<12,j=j+T|0,E^=j,E=E>>>32-16|E<<16,l=l+E|0,T^=l,T=T>>>32-12|T<<12,oe=oe+le|0,A^=oe,A=A>>>32-8|A<<8,b=b+A|0,le^=b,le=le>>>32-7|le<<7,j=j+T|0,E^=j,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+G|0,_^=Y,_=_>>>32-8|_<<8,y=y+_|0,G^=y,G=G>>>32-7|G<<7,Q=Q+H|0,p^=Q,p=p>>>32-8|p<<8,h=h+p|0,H^=h,H=H>>>32-7|H<<7,Q=Q+G|0,E^=Q,E=E>>>32-16|E<<16,b=b+E|0,G^=b,G=G>>>32-12|G<<12,Y=Y+le|0,p^=Y,p=p>>>32-16|p<<16,l=l+p|0,le^=l,le=le>>>32-12|le<<12,oe=oe+T|0,_^=oe,_=_>>>32-16|_<<16,h=h+_|0,T^=h,T=T>>>32-12|T<<12,j=j+H|0,A^=j,A=A>>>32-16|A<<16,y=y+A|0,H^=y,H=H>>>32-12|H<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,j=j+H|0,A^=j,A=A>>>32-8|A<<8,y=y+A|0,H^=y,H=H>>>32-7|H<<7,Y=Y+le|0,p^=Y,p=p>>>32-8|p<<8,l=l+p|0,le^=l,le=le>>>32-7|le<<7,Q=Q+G|0,E^=Q,E=E>>>32-8|E<<8,b=b+E|0,G^=b,G=G>>>32-7|G<<7;Wr.writeUint32LE(Q+n|0,t,0),Wr.writeUint32LE(Y+i|0,t,4),Wr.writeUint32LE(oe+a|0,t,8),Wr.writeUint32LE(j+c|0,t,12),Wr.writeUint32LE(H+u|0,t,16),Wr.writeUint32LE(G+m|0,t,20),Wr.writeUint32LE(le+v|0,t,24),Wr.writeUint32LE(T+x|0,t,28),Wr.writeUint32LE(h+S|0,t,32),Wr.writeUint32LE(y+O|0,t,36),Wr.writeUint32LE(b+R|0,t,40),Wr.writeUint32LE(l+D|0,t,44),Wr.writeUint32LE(p+P|0,t,48),Wr.writeUint32LE(_+J|0,t,52),Wr.writeUint32LE(A+B|0,t,56),Wr.writeUint32LE(E+W|0,t,60)}o(dN,"core");function px(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,c;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),c=a.length-e.length,a.set(e,c)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,c=i}for(var u=new Uint8Array(64),m=0;m<r.length;m+=64){dN(u,a,t);for(var v=m;v<m+64&&v<r.length;v++)n[v]=r[v]^u[v-m];mN(a,0,c)}return T1.wipe(u),i===0&&T1.wipe(a),n}o(px,"streamXOR");cd.streamXOR=px;function pN(t,e,r,n){return n===void 0&&(n=0),T1.wipe(r),px(t,e,r,r,n)}o(pN,"stream");cd.stream=pN;function mN(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(mN,"incrementCounter")});var vx=De(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});var Ls=Sa(),mx=hi(),bN=C1(),gN=20;function bx(t,e,r,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=gx(t,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var c=bN.streamXOR(i,a,r,n);return mx.wipe(i),c}o(bx,"streamXOR");Cu.streamXOR=bx;function vN(t,e,r){return mx.wipe(r),bx(t,e,r,r)}o(vN,"stream");Cu.stream=vN;function gx(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,c=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],m=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],x=t[15]<<24|t[14]<<16|t[13]<<8|t[12],S=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],D=t[31]<<24|t[30]<<16|t[29]<<8|t[28],P=e[3]<<24|e[2]<<16|e[1]<<8|e[0],J=e[7]<<24|e[6]<<16|e[5]<<8|e[4],B=e[11]<<24|e[10]<<16|e[9]<<8|e[8],W=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Q=n,Y=i,oe=a,j=c,H=u,G=m,le=v,T=x,h=S,y=O,b=R,l=D,p=P,_=J,A=B,E=W,g=0;g<gN;g+=2)Q=Q+H|0,p^=Q,p=p>>>32-16|p<<16,h=h+p|0,H^=h,H=H>>>32-12|H<<12,Y=Y+G|0,_^=Y,_=_>>>32-16|_<<16,y=y+_|0,G^=y,G=G>>>32-12|G<<12,oe=oe+le|0,A^=oe,A=A>>>32-16|A<<16,b=b+A|0,le^=b,le=le>>>32-12|le<<12,j=j+T|0,E^=j,E=E>>>32-16|E<<16,l=l+E|0,T^=l,T=T>>>32-12|T<<12,oe=oe+le|0,A^=oe,A=A>>>32-8|A<<8,b=b+A|0,le^=b,le=le>>>32-7|le<<7,j=j+T|0,E^=j,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+G|0,_^=Y,_=_>>>32-8|_<<8,y=y+_|0,G^=y,G=G>>>32-7|G<<7,Q=Q+H|0,p^=Q,p=p>>>32-8|p<<8,h=h+p|0,H^=h,H=H>>>32-7|H<<7,Q=Q+G|0,E^=Q,E=E>>>32-16|E<<16,b=b+E|0,G^=b,G=G>>>32-12|G<<12,Y=Y+le|0,p^=Y,p=p>>>32-16|p<<16,l=l+p|0,le^=l,le=le>>>32-12|le<<12,oe=oe+T|0,_^=oe,_=_>>>32-16|_<<16,h=h+_|0,T^=h,T=T>>>32-12|T<<12,j=j+H|0,A^=j,A=A>>>32-16|A<<16,y=y+A|0,H^=y,H=H>>>32-12|H<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,j=j+H|0,A^=j,A=A>>>32-8|A<<8,y=y+A|0,H^=y,H=H>>>32-7|H<<7,Y=Y+le|0,p^=Y,p=p>>>32-8|p<<8,l=l+p|0,le^=l,le=le>>>32-7|le<<7,Q=Q+G|0,E^=Q,E=E>>>32-8|E<<8,b=b+E|0,G^=b,G=G>>>32-7|G<<7;return Ls.writeUint32LE(Q,r,0),Ls.writeUint32LE(Y,r,4),Ls.writeUint32LE(oe,r,8),Ls.writeUint32LE(j,r,12),Ls.writeUint32LE(p,r,16),Ls.writeUint32LE(_,r,20),Ls.writeUint32LE(A,r,24),Ls.writeUint32LE(E,r,28),r}o(gx,"hchacha");Cu.hchacha=gx});var k1=De(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});function yN(t,e,r){return~(t-1)&e|t-1&r}o(yN,"select");rc.select=yN;function xN(t,e){return(t|0)-(e|0)-1>>>31&1}o(xN,"lessOrEqual");rc.lessOrEqual=xN;function yx(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}o(yx,"compare");rc.compare=yx;function wN(t,e){return t.length===0||e.length===0?!1:yx(t,e)!==0}o(wN,"equal");rc.equal=wN});var wx=De(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var _N=k1(),ud=hi();Jo.DIGEST_LENGTH=16;var xx=function(){function t(e){this.digestLength=Jo.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 r=e[0]|e[1]<<8;this._r[0]=r&8191;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var a=e[6]|e[7]<<8;this._r[3]=(i>>>7|a<<9)&8191;var c=e[8]|e[9]<<8;this._r[4]=(a>>>4|c<<12)&255,this._r[5]=c>>>1&8190;var u=e[10]|e[11]<<8;this._r[6]=(c>>>14|u<<2)&8191;var m=e[12]|e[13]<<8;this._r[7]=(u>>>11|m<<5)&8065;var v=e[14]|e[15]<<8;this._r[8]=(m>>>8|v<<8)&8191,this._r[9]=v>>>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(t,"Poly1305"),t.prototype._blocks=function(e,r,n){for(var i=this._fin?0:2048,a=this._h[0],c=this._h[1],u=this._h[2],m=this._h[3],v=this._h[4],x=this._h[5],S=this._h[6],O=this._h[7],R=this._h[8],D=this._h[9],P=this._r[0],J=this._r[1],B=this._r[2],W=this._r[3],Q=this._r[4],Y=this._r[5],oe=this._r[6],j=this._r[7],H=this._r[8],G=this._r[9];n>=16;){var le=e[r+0]|e[r+1]<<8;a+=le&8191;var T=e[r+2]|e[r+3]<<8;c+=(le>>>13|T<<3)&8191;var h=e[r+4]|e[r+5]<<8;u+=(T>>>10|h<<6)&8191;var y=e[r+6]|e[r+7]<<8;m+=(h>>>7|y<<9)&8191;var b=e[r+8]|e[r+9]<<8;v+=(y>>>4|b<<12)&8191,x+=b>>>1&8191;var l=e[r+10]|e[r+11]<<8;S+=(b>>>14|l<<2)&8191;var p=e[r+12]|e[r+13]<<8;O+=(l>>>11|p<<5)&8191;var _=e[r+14]|e[r+15]<<8;R+=(p>>>8|_<<8)&8191,D+=_>>>5|i;var A=0,E=A;E+=a*P,E+=c*(5*G),E+=u*(5*H),E+=m*(5*j),E+=v*(5*oe),A=E>>>13,E&=8191,E+=x*(5*Y),E+=S*(5*Q),E+=O*(5*W),E+=R*(5*B),E+=D*(5*J),A+=E>>>13,E&=8191;var g=A;g+=a*J,g+=c*P,g+=u*(5*G),g+=m*(5*H),g+=v*(5*j),A=g>>>13,g&=8191,g+=x*(5*oe),g+=S*(5*Y),g+=O*(5*Q),g+=R*(5*W),g+=D*(5*B),A+=g>>>13,g&=8191;var C=A;C+=a*B,C+=c*J,C+=u*P,C+=m*(5*G),C+=v*(5*H),A=C>>>13,C&=8191,C+=x*(5*j),C+=S*(5*oe),C+=O*(5*Y),C+=R*(5*Q),C+=D*(5*W),A+=C>>>13,C&=8191;var N=A;N+=a*W,N+=c*B,N+=u*J,N+=m*P,N+=v*(5*G),A=N>>>13,N&=8191,N+=x*(5*H),N+=S*(5*j),N+=O*(5*oe),N+=R*(5*Y),N+=D*(5*Q),A+=N>>>13,N&=8191;var w=A;w+=a*Q,w+=c*W,w+=u*B,w+=m*J,w+=v*P,A=w>>>13,w&=8191,w+=x*(5*G),w+=S*(5*H),w+=O*(5*j),w+=R*(5*oe),w+=D*(5*Y),A+=w>>>13,w&=8191;var k=A;k+=a*Y,k+=c*Q,k+=u*W,k+=m*B,k+=v*J,A=k>>>13,k&=8191,k+=x*P,k+=S*(5*G),k+=O*(5*H),k+=R*(5*j),k+=D*(5*oe),A+=k>>>13,k&=8191;var he=A;he+=a*oe,he+=c*Y,he+=u*Q,he+=m*W,he+=v*B,A=he>>>13,he&=8191,he+=x*J,he+=S*P,he+=O*(5*G),he+=R*(5*H),he+=D*(5*j),A+=he>>>13,he&=8191;var I=A;I+=a*j,I+=c*oe,I+=u*Y,I+=m*Q,I+=v*W,A=I>>>13,I&=8191,I+=x*B,I+=S*J,I+=O*P,I+=R*(5*G),I+=D*(5*H),A+=I>>>13,I&=8191;var Z=A;Z+=a*H,Z+=c*j,Z+=u*oe,Z+=m*Y,Z+=v*Q,A=Z>>>13,Z&=8191,Z+=x*W,Z+=S*B,Z+=O*J,Z+=R*P,Z+=D*(5*G),A+=Z>>>13,Z&=8191;var se=A;se+=a*G,se+=c*H,se+=u*j,se+=m*oe,se+=v*Y,A=se>>>13,se&=8191,se+=x*Q,se+=S*W,se+=O*B,se+=R*J,se+=D*P,A+=se>>>13,se&=8191,A=(A<<2)+A|0,A=A+E|0,E=A&8191,A=A>>>13,g+=A,a=E,c=g,u=C,m=N,v=w,x=k,S=he,O=I,R=Z,D=se,r+=16,n-=16}this._h[0]=a,this._h[1]=c,this._h[2]=u,this._h[3]=m,this._h[4]=v,this._h[5]=x,this._h[6]=S,this._h[7]=O,this._h[8]=R,this._h[9]=D},t.prototype.finish=function(e,r){r===void 0&&(r=0);var n=new Uint16Array(10),i,a,c,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,a=(i^1)-1,u=0;u<10;u++)n[u]&=a;for(a=~a,u=0;u<10;u++)this._h[u]=this._h[u]&a|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,c=this._h[0]+this._pad[0],this._h[0]=c&65535,u=1;u<8;u++)c=(this._h[u]+this._pad[u]|0)+(c>>>16)|0,this._h[u]=c&65535;return e[r+0]=this._h[0]>>>0,e[r+1]=this._h[0]>>>8,e[r+2]=this._h[1]>>>0,e[r+3]=this._h[1]>>>8,e[r+4]=this._h[2]>>>0,e[r+5]=this._h[2]>>>8,e[r+6]=this._h[3]>>>0,e[r+7]=this._h[3]>>>8,e[r+8]=this._h[4]>>>0,e[r+9]=this._h[4]>>>8,e[r+10]=this._h[5]>>>0,e[r+11]=this._h[5]>>>8,e[r+12]=this._h[6]>>>0,e[r+13]=this._h[6]>>>8,e[r+14]=this._h[7]>>>0,e[r+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var r=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var a=0;a<i;a++)this._buffer[this._leftover+a]=e[r+a];if(n-=i,r+=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,r,i),r+=i,n-=i),n){for(var a=0;a<n;a++)this._buffer[this._leftover+a]=e[r+a];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return ud.wipe(this._buffer),ud.wipe(this._r),ud.wipe(this._h),ud.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();Jo.Poly1305=xx;function EN(t,e){var r=new xx(t);r.update(e);var n=r.digest();return r.clean(),n}o(EN,"oneTimeAuth");Jo.oneTimeAuth=EN;function AN(t,e){return t.length!==Jo.DIGEST_LENGTH||e.length!==Jo.DIGEST_LENGTH?!1:_N.equal(t,e)}o(AN,"equal");Jo.equal=AN});var Ax=De(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var ld=C1(),SN=wx(),ku=hi(),_x=Sa(),MN=k1();Yo.KEY_LENGTH=32;Yo.NONCE_LENGTH=12;Yo.TAG_LENGTH=16;var Ex=new Uint8Array(16),TN=function(){function t(e){if(this.nonceLength=Yo.NONCE_LENGTH,this.tagLength=Yo.TAG_LENGTH,e.length!==Yo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(t,"ChaCha20Poly1305"),t.prototype.seal=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);ld.stream(this._key,a,c,4);var u=r.length+this.tagLength,m;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");m=i}else m=new Uint8Array(u);return ld.streamXOR(this._key,a,r,m,4),this._authenticate(m.subarray(m.length-this.tagLength,m.length),c,m.subarray(0,m.length-this.tagLength),n),ku.wipe(a),m},t.prototype.open=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);ld.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,r.subarray(0,r.length-this.tagLength),n),!MN.equal(u,r.subarray(r.length-this.tagLength,r.length)))return null;var m=r.length-this.tagLength,v;if(i){if(i.length!==m)throw new Error("ChaCha20Poly1305: incorrect destination length");v=i}else v=new Uint8Array(m);return ld.streamXOR(this._key,a,r.subarray(0,r.length-this.tagLength),v,4),ku.wipe(a),v},t.prototype.clean=function(){return ku.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var a=new SN.Poly1305(r);i&&(a.update(i),i.length%16>0&&a.update(Ex.subarray(i.length%16))),a.update(n),n.length%16>0&&a.update(Ex.subarray(n.length%16));var c=new Uint8Array(8);i&&_x.writeUint64LE(i.length,c),a.update(c),_x.writeUint64LE(n.length,c),a.update(c);for(var u=a.digest(),m=0;m<u.length;m++)e[m]=u[m];a.clean(),ku.wipe(u),ku.wipe(c)},t}();Yo.ChaCha20Poly1305=TN});var Tx=De(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});var Sx=vx(),Mx=Ax(),Iu=hi();Xo.KEY_LENGTH=32;Xo.NONCE_LENGTH=24;Xo.TAG_LENGTH=16;var CN=function(){function t(e){if(this.nonceLength=Xo.NONCE_LENGTH,this.tagLength=Xo.TAG_LENGTH,e.length!==Xo.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(t,"XChaCha20Poly1305"),t.prototype.seal=function(e,r,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var a=Sx.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new Mx.ChaCha20Poly1305(a),m=u.seal(c,r,n,i);return Iu.wipe(a),Iu.wipe(c),u.clean(),m},t.prototype.open=function(e,r,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=Sx.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new Mx.ChaCha20Poly1305(a),m=u.open(c,r,n,i);return Iu.wipe(a),Iu.wipe(c),u.clean(),m},t.prototype.clean=function(){return Iu.wipe(this._key),this},t}();Xo.XChaCha20Poly1305=CN});var zi=De((NG,b4)=>{b4.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 Fu=De((PG,g4)=>{g4.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 x4=De($r=>{var v4=$r,kd=4294967292,Id=4294967293,tb=4294967294,y4=4294967295,Be=[0,1,3,7,15,31,63,127,255,511,1023],Fs=["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"],WP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),qn=[];WP.forEach(t=>{qn.push(t.charCodeAt(0))});$r.utf8={encode(t){let e=[];return t.forEach(r=>{if(r>=0&&r<=127)e.push(r);else if(r<=2047)e.push(192+(r>>6&Be[5])),e.push(128+(r&Be[6]));else if(r<55296||r>57343&&r<=65535)e.push(224+(r>>12&Be[4])),e.push(128+(r>>6&Be[6])),e.push(128+(r&Be[6]));else if(r>=65536&&r<=1114111){let n=r>>16&Be[5];e.push(240+(n>>2)),e.push(128+((n&Be[2])<<4)+(r>>12&Be[4])),e.push(128+(r>>6&Be[6])),e.push(128+(r&Be[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${r}`)}),Buffer.from(e)},decode(t,e){function r(D,P){if((P&192)!==128)return Id;let J=((D&Be[5])<<6)+(P&Be[6]);return J<128?kd:J}o(r,"bytes2");function n(D,P,J){if((J&192)!==128||(P&192)!==128)return Id;let B=((D&Be[4])<<12)+((P&Be[6])<<6)+(J&Be[6]);return B<2048?kd:B>=55296&&B<=57343?tb:B}o(n,"bytes3");function i(D,P,J,B){if((B&192)!==128||(J&192)!==128||(P&192)!==128)return Id;let W=(((D&Be[3])<<2)+(P>>4&Be[2])<<16)+((P&Be[4])<<12)+((J&Be[6])<<6)+(B&Be[6]);return W<65536?kd:W>1114111?tb:W}o(i,"bytes4");let a,c,u,m,v,x,S=t.length,O=e?3:0,R=[];for(;O<S;){c=t[O],a=y4;let D=!0;for(;D;){if(c>=0&&c<=127){a=c,x=1;break}if(u=O+1,u<S&&c>=194&&c<=223){a=r(c,t[u]),x=2;break}if(m=O+2,m<S&&c>=224&&c<=239){a=n(c,t[u],t[m]),x=3;break}if(v=O+3,v<S&&c>=240&&c<=244){a=i(c,t[u],t[m],t[v]),x=4;break}break}if(a>1114111){let P=`byte[${O}]`;throw a===y4?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${P}`):a===Id?new RangeError(`utf8.decode: illegal trailing byte found at: ${P}`):a===tb?new RangeError(`utf8.decode: code point out of range found at: ${P}`):a===kd?new RangeError(`utf8.decode: non-shortest form found at: ${P}`):new RangeError(`utf8.decode: unrecognized error found at: ${P}`)}R.push(a),O+=x}return R}};$r.utf16be={encode(t){let e=[],r,n,i;for(let a=0;a<t.length;a+=1)if(r=t[a],r>=0&&r<=55295||r>=57344&&r<=65535)e.push(r>>8&Be[8]),e.push(r&Be[8]);else if(r>=65536&&r<=1114111)i=r-65536,n=55296+(i>>10),i=56320+(i&Be[10]),e.push(n>>8&Be[8]),e.push(n&Be[8]),e.push(i>>8&Be[8]),e.push(i&Be[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${a}]: ${r}`);return Buffer.from(e)},decode(t,e){if(t.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${t.length}`);let r=[],n=t.length,i=e?2:0,a=0,c,u,m,v,x,S;for(;i<n;){for(;;){if(m=i+1,m<n){if(x=(t[i]<<8)+t[m],x<55296||x>57343){c=x,u=2;break}if(v=i+3,v<n&&(S=(t[i+2]<<8)+t[v],x<=56319&&S>=56320&&S<=57343)){c=65536+(x-55296<<10)+(S-56320),u=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}r[a++]=c,i+=u}return r}};$r.utf16le={encode(t){let e=[],r,n,i;for(let a=0;a<t.length;a+=1)if(r=t[a],r>=0&&r<=55295||r>=57344&&r<=65535)e.push(r&Be[8]),e.push(r>>8&Be[8]);else if(r>=65536&&r<=1114111)i=r-65536,n=55296+(i>>10),i=56320+(i&Be[10]),e.push(n&Be[8]),e.push(n>>8&Be[8]),e.push(i&Be[8]),e.push(i>>8&Be[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${a}]: ${r}`);return Buffer.from(e)},decode(t,e){if(t.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${t.length}`);let r=[],n=t.length,i=e?2:0,a=0,c,u,m,v,x,S;for(;i<n;){for(;;){if(m=i+1,m<n){if(x=(t[m]<<8)+t[i],x<55296||x>57343){c=x,u=2;break}if(v=i+3,v<n&&(S=(t[v]<<8)+t[i+2],x<=56319&&S>=56320&&S<=57343)){c=65536+(x-55296<<10)+(S-56320),u=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}r[a++]=c,i+=u}return r}};$r.utf32be={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${r/4}]: ${n}`);e[r++]=n>>24&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t,e){if(t.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${t.length}`);let r=[],n=e?4:0;for(;n<t.length;n+=4){let i=(t[n]<<24)+(t[n+1]<<16)+(t[n+2]<<8)+t[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);r.push(i)}return r}};$r.utf32le={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${n}`);e[r++]=n&Be[8],e[r++]=n>>8&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>24&Be[8]}),e},decode(t,e){if(t.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${t.length}`);let r=[],n=e?4:0;for(;n<t.length;n+=4){let i=(t[n+3]<<24)+(t[n+2]<<16)+(t[n+1]<<8)+t[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);r.push(i)}return r}};$r.uint7={encode(t){let e=Buffer.alloc(t.length);for(let r=0;r<t.length;r+=1){if(t[r]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${r}]: ${t[r]}`);e[r]=t[r]}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=1){if(t[r]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${r}]: ${t[r]}`);e[r]=t[r]}return e}};$r.uint8={encode(t){let e=Buffer.alloc(t.length);for(let r=0;r<t.length;r+=1){if(t[r]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${r}]: ${t[r]}`);e[r]=t[r]}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=1)e[r]=t[r];return e}};$r.uint16be={encode(t){let e=Buffer.alloc(t.length*2),r=0;return t.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${r/2}]: ${n}`);e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t){if(t.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=2)e.push((t[r]<<8)+t[r+1]);return e}};$r.uint16le={encode(t){let e=Buffer.alloc(t.length*2),r=0;return t.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${r/2}]: ${n}`);e[r++]=n&Be[8],e[r++]=n>>8&Be[8]}),e},decode(t){if(t.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=2)e.push((t[r+1]<<8)+t[r]);return e}};$r.uint32be={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{e[r++]=n>>24&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>8&Be[8],e[r++]=n&Be[8]}),e},decode(t){if(t.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=4)e.push((t[r]<<24)+(t[r+1]<<16)+(t[r+2]<<8)+t[r+3]);return e}};$r.uint32le={encode(t){let e=Buffer.alloc(t.length*4),r=0;return t.forEach(n=>{e[r++]=n&Be[8],e[r++]=n>>8&Be[8],e[r++]=n>>16&Be[8],e[r++]=n>>24&Be[8]}),e},decode(t){if(t.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${t.length}`);let e=[];for(let r=0;r<t.length;r+=4)e.push((t[r+3]<<24)+(t[r+2]<<16)+(t[r+1]<<8)+t[r]);return e}};$r.string={encode(t){return v4.utf16le.encode(t).toString("utf16le")},decode(t){return v4.utf16le.decode(Buffer.from(t,"utf16le"),0)}};$r.escaped={encode(t){let e=[];for(let r=0;r<t.length;r+=1){let n=t[r];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${Fs[n]}`;else if(n>=127&&n<=255)i+=`\`x${Fs[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Fs[n>>8&Be[8]]}${Fs[n&Be[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let c=n>>24&Be[8];c>0&&(i+=Fs[c]),i+=`${Fs[n>>16&Be[8]]+Fs[n>>8&Be[8]]+Fs[n&Be[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(c=>{e.push(c)})}}return Buffer.from(e)},decode(t){function e(S){return S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102}o(e,"isHex");function r(S,O,R){let D={char:null,nexti:S+2,error:!0};if(S+1<O&&e(R[S])&&e(R[S+1])){let P=String.fromCodePoint(R[S],R[S+1]);D.char=parseInt(P,16),Number.isNaN(D.char)||(D.error=!1)}return D}o(r,"getx");function n(S,O,R){let D={char:null,nexti:S+4,error:!0};if(S+3<O&&e(R[S])&&e(R[S+1])&&e(R[S+2])&&e(R[S+3])){let P=String.fromCodePoint(R[S],R[S+1],R[S+2],R[S+3]);D.char=parseInt(P,16),Number.isNaN(D.char)||(D.error=!1)}return D}o(n,"getu");function i(S,O,R){let D={char:null,nexti:S+4,error:!0},P="";for(;S<O&&e(R[S]);)P+=String.fromCodePoint(R[S]),S+=1;return D.char=parseInt(P,16),R[S]===125&&!Number.isNaN(D.char)&&(D.error=!1),D.nexti=S+1,D}o(i,"getU");let a=[],c=t.length,u,m,v,x=0;for(;x<c;){for(;;){if(v=!0,t[x]!==96){a.push(t[x]),x+=1,v=!1;break}if(u=x+1,u>=c)break;if(t[u]===96){a.push(96),x+=2,v=!1;break}if(t[u]===120){if(m=r(u+1,c,t),m.error)break;a.push(m.char),x=m.nexti,v=!1;break}if(t[u]===117){if(t[u+1]===123){if(m=i(u+2,c,t),m.error)break;a.push(m.char),x=m.nexti,v=!1;break}if(m=n(u+1,c,t),m.error)break;a.push(m.char),x=m.nexti,v=!1;break}break}if(v)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${x}]`)}return a}};var qu=13,yi=10;$r.lineEnds={crlf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case qu:r+1<t.length&&t[r+1]===yi?r+=2:r+=1,e.push(qu),e.push(yi);break;case yi:e.push(qu),e.push(yi),r+=1;break;default:e.push(t[r]),r+=1;break}return e.length>0&&e[e.length-1]!==yi&&(e.push(qu),e.push(yi)),e},lf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case qu:r+1<t.length&&t[r+1]===yi?r+=2:r+=1,e.push(yi);break;case yi:e.push(yi),r+=1;break;default:e.push(t[r]),r+=1;break}return e.length>0&&e[e.length-1]!==yi&&e.push(yi),e}};$r.base64={encode(t){if(t.length===0)return Buffer.alloc(0);let e,r,n,i=t.length%3;i=i>0?3-i:0;let a=(t.length+i)/3,c=Buffer.alloc(a*4);i>0&&(a-=1),e=0,r=0;for(let u=0;u<a;u+=1)n=t[e++]<<16,n+=t[e++]<<8,n+=t[e++],c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[n>>6&Be[6]],c[r++]=qn[n&Be[6]];if(i===0)return c;if(i===1)return n=t[e++]<<16,n+=t[e]<<8,c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[n>>6&Be[6]],c[r]=qn[64],c;if(i===2)return n=t[e]<<16,c[r++]=qn[n>>18&Be[6]],c[r++]=qn[n>>12&Be[6]],c[r++]=qn[64],c[r]=qn[64],c},decode(t){function e(x){let S=[],O=0;for(let R=0;R<x.length;R+=1){let D=x[R],P=!0;for(;P&&!(D===32||D===9||D===10||D===13);){if(D>=65&&D<=90){S.push(D-65);break}if(D>=97&&D<=122){S.push(D-71);break}if(D>=48&&D<=57){S.push(D+4);break}if(D===43){S.push(62);break}if(D===47){S.push(63);break}if(D===61){S.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${D}`)}}if(S.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${S.length}`);switch(O){case 0:break;case 1:if(S[S.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(S[S.length-1]!==64||S[S.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:Buffer.from(S)}}if(o(e,"validate"),t.length===0)return Buffer.alloc(0);let r=e(t),{tail:n}=r,i=r.buf,a,c,u,m=i.length/4,v=Buffer.alloc(m*3-n);n>0&&(m-=1),c=0,a=0;for(let x=0;x<m;x+=1)u=i[a++]<<18,u+=i[a++]<<12,u+=i[a++]<<6,u+=i[a++],v[c++]=u>>16&Be[8],v[c++]=u>>8&Be[8],v[c++]=u&Be[8];return n===1&&(u=i[a++]<<18,u+=i[a++]<<12,u+=i[a]<<6,v[c++]=u>>16&Be[8],v[c]=u>>8&Be[8]),n===2&&(u=i[a++]<<18,u+=i[a++]<<12,v[c]=u>>16&Be[8]),v},toString(t){if(t.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${t.length}`);let e="",r=0;function n(a,c,u,m){switch(r){case 76:e+=`\r
|
|
35
35
|
${a}${c}${u}${m}`,r=4;break;case 75:e+=`${a}\r
|
|
36
36
|
${c}${u}${m}`,r=3;break;case 74:e+=`${a+c}\r
|
|
37
37
|
${u}${m}`,r=2;break;case 73:e+=`${a+c+u}\r
|
|
38
|
-
${m}`,r=1;break;default:e+=a+c+u+m,r+=4;break}}o(n,"buildLine");function i(a){return a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a===43||a===47||a===61}o(i,"validate");for(let a=0;a<t.length;a+=4){for(let c=a;c<a+4;c+=1)if(!i(t[c]))throw new RangeError(`base64.toString: buf[${c}]: ${t[c]} : not valid base64 character code`);n(String.fromCharCode(t[a]),String.fromCharCode(t[a+1]),String.fromCharCode(t[a+2]),String.fromCharCode(t[a+3]))}return e}}});var
|
|
38
|
+
${m}`,r=1;break;default:e+=a+c+u+m,r+=4;break}}o(n,"buildLine");function i(a){return a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a===43||a===47||a===61}o(i,"validate");for(let a=0;a<t.length;a+=4){for(let c=a;c<a+4;c+=1)if(!i(t[c]))throw new RangeError(`base64.toString: buf[${c}]: ${t[c]} : not valid base64 character code`);n(String.fromCharCode(t[a]),String.fromCharCode(t[a+1]),String.fromCharCode(t[a+2]),String.fromCharCode(t[a+3]))}return e}}});var ob=De(zu=>{var w4=zu,zt=x4(),Hu="UTF8",nb="UTF16",po="UTF16BE",Qo="UTF16LE",ib="UTF32",mo="UTF32BE",es="UTF32LE",lc="UINT7",_4="ASCII",E4="BINARY",hc="UINT8",A4="UINT16",Dd="UINT16LE",dc="UINT16BE",S4="UINT32",Od="UINT32LE",pc="UINT32BE",Rd="ESCAPED",qs="STRING",JP=o(function(e){e.type=Hu;let r=e.data;e.bom=0,r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191&&(e.bom=3)},"bom8"),YP=o(function(e){let r=e.data;switch(e.bom=0,e.type){case nb:e.type=po,r.length>=2&&(r[0]===254&&r[1]===255?e.bom=2:r[0]===255&&r[1]===254&&(e.type=Qo,e.bom=2));break;case po:if(e.type=po,r.length>=2){if(r[0]===254&&r[1]===255)e.bom=2;else if(r[0]===255&&r[1]===254)throw new TypeError(`src type: "${po}" specified but BOM is for "${Qo}"`)}break;case Qo:if(e.type=Qo,r.length>=0){if(r[0]===254&&r[1]===255)throw new TypeError(`src type: "${Qo}" specified but BOM is for "${po}"`);r[0]===255&&r[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),XP=o(function(e){let r=e.data;switch(e.bom=0,e.type){case ib:e.type=mo,r.length>=4&&(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255&&(e.bom=4),r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0&&(e.type=es,e.bom=4));break;case mo:if(e.type=mo,r.length>=4&&(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255&&(e.bom=4),r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0))throw new TypeError(`src type: ${mo} specified but BOM is for ${es}"`);break;case es:if(e.type=es,r.length>=4){if(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255)throw new TypeError(`src type: "${es}" specified but BOM is for "${mo}"`);r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),ZP=o(function(e,r){function n(a){let c={type:"",base64:!1},m=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(a);return m&&(m[2]&&(c.type=m[2].toUpperCase()),m[1]&&(c.base64=!0)),c}if(o(n,"getType"),typeof e!="string"||e==="")throw new TypeError(`type: "${e}" not recognized`);let i=n(e.toUpperCase());if(i.base64){if(i.type===qs)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${qs}`);if(Buffer.isBuffer(r))i.data=zt.base64.decode(r);else if(typeof r=="string"){let a=Buffer.from(r,"ascii");i.data=zt.base64.decode(a)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof r}`)}else i.data=r;switch(i.type){case Hu:JP(i);break;case nb:case po:case Qo:YP(i);break;case ib:case mo:case es:XP(i);break;case A4:i.type=dc;break;case S4:i.type=pc;break;case _4:i.type=lc;break;case E4:i.type=hc;break;case lc:case hc:case Dd:case dc:case Od:case pc:case qs:case Rd:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===qs){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),QP=o(function(e,r){function n(a){let c,u,m={crlf:!1,lf:!1,base64:!1,type:""},v=!0;for(;v;){if(u=a,c=a.slice(0,5),c==="CRLF:"){m.crlf=!0,u=a.slice(5);break}if(c=a.slice(0,3),c==="LF:"){m.lf=!0,u=a.slice(3);break}break}return c=u.split(":"),c.length===1?m.type=c[0]:c.length===2&&c[1]==="BASE64"&&(m.base64=!0,m.type=c[0]),m}if(o(n,"getType"),!Array.isArray(r))throw new TypeError(`dst chars: not array: "${typeof r}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case Hu:case po:case Qo:case mo:case es:case lc:case hc:case Dd:case dc:case Od:case pc:case Rd:break;case qs:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${qs}`);break;case _4:i.type=lc;break;case E4:i.type=hc;break;case nb:i.type=po;break;case ib:i.type=mo;break;case A4:i.type=dc;break;case S4:i.type=pc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),rb=o(function(e,r){switch(e){case Hu:return zt.utf8.encode(r);case po:return zt.utf16be.encode(r);case Qo:return zt.utf16le.encode(r);case mo:return zt.utf32be.encode(r);case es:return zt.utf32le.encode(r);case lc:return zt.uint7.encode(r);case hc:return zt.uint8.encode(r);case dc:return zt.uint16be.encode(r);case Dd:return zt.uint16le.encode(r);case pc:return zt.uint32be.encode(r);case Od:return zt.uint32le.encode(r);case qs:return zt.string.encode(r);case Rd:return zt.escaped.encode(r);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),eL=o(function(e){switch(e.type){case Hu:return zt.utf8.decode(e.data,e.bom);case Qo:return zt.utf16le.decode(e.data,e.bom);case po:return zt.utf16be.decode(e.data,e.bom);case mo:return zt.utf32be.decode(e.data,e.bom);case es:return zt.utf32le.decode(e.data,e.bom);case lc:return zt.uint7.decode(e.data);case hc:return zt.uint8.decode(e.data);case dc:return zt.uint16be.decode(e.data);case Dd:return zt.uint16le.decode(e.data);case pc:return zt.uint32be.decode(e.data);case Od:return zt.uint32le.decode(e.data);case qs:return zt.string.decode(e.data);case Rd:return zt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");zu.decode=o(function(e,r){let n=ZP(e,r);return eL(n)},"exportsDecode");zu.encode=o(function(e,r){let n,i,a=QP(e,r);return a.crlf?(n=zt.lineEnds.crlf(r),i=rb(a.type,n)):a.lf?(n=zt.lineEnds.lf(r),i=rb(a.type,n)):i=rb(a.type,r),a.base64&&(i=zt.base64.encode(i)),i},"exportsEncode");zu.convert=o(function(e,r,n){return w4.encode(n,w4.decode(e,r))},"convert")});var sb=De((UG,M4)=>{M4.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
|
|
39
39
|
.apg-mono {
|
|
40
40
|
font-family: monospace;
|
|
41
41
|
}
|
|
@@ -249,13 +249,13 @@ table.apg-attrs a {
|
|
|
249
249
|
table.apg-attrs a:hover {
|
|
250
250
|
color: #8caae6 !important;
|
|
251
251
|
}
|
|
252
|
-
`},"emittcss")});var za=De(kr=>{var _n
|
|
252
|
+
`},"emittcss")});var za=De(kr=>{var _n=Fu(),ab=ob(),tL=sb(),hr=zi(),Hs="utilities.js: ",ts=kr,Ha=o(function(t,e,r){let n,i=e,a=!0;for(;a;){if(t<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=t;break}if(i>=t){i=t,n=t;break}if(typeof r!="number"){n=t;break}if(n=i+r,n>t){n=t;break}break}return{beg:i,end:n}},"getBounds");kr.htmlToPage=function(t,e){let r;if(typeof t!="string")throw new Error(`${Hs}htmlToPage: input HTML is not a string`);typeof e!="string"?r="htmlToPage":r=e;let n="";return n+=`<!DOCTYPE html>
|
|
253
253
|
`,n+=`<html lang="en">
|
|
254
254
|
`,n+=`<head>
|
|
255
255
|
`,n+=`<meta charset="utf-8">
|
|
256
256
|
`,n+=`<title>${r}</title>
|
|
257
257
|
`,n+=`<style>
|
|
258
|
-
`,n+=
|
|
258
|
+
`,n+=tL(),n+=`</style>
|
|
259
259
|
`,n+=`</head>
|
|
260
260
|
<body>
|
|
261
261
|
`,n+=`<p>${new Date}</p>
|
|
@@ -280,22 +280,22 @@ table.apg-attrs a:hover {
|
|
|
280
280
|
`,a+=`<tr><td>sub-string end</td><td>${t.subEnd}</td><td>sub-string end-of-string index</td></tr>
|
|
281
281
|
`,a+=`<tr><td>sub-string length</td><td>${t.subLength}</td><td>sub-string length</td></tr>
|
|
282
282
|
`,a+=`</table>
|
|
283
|
-
`,a};kr.charsToString=function(t,e,r){let n,i;if(typeof e=="number"){if(e>=t.length)return"";n=e<0?0:e}else n=0;if(typeof r=="number"){if(r<=0)return"";i=r>t.length-n?t.length:n+r}else i=t.length;return n<i?
|
|
283
|
+
`,a};kr.charsToString=function(t,e,r){let n,i;if(typeof e=="number"){if(e>=t.length)return"";n=e<0?0:e}else n=0;if(typeof r=="number"){if(r<=0)return"";i=r>t.length-n?t.length:n+r}else i=t.length;return n<i?ab.encode("UTF16LE",t.slice(n,i)).toString("utf16le"):""};kr.stringToChars=function(t){return ab.decode("STRING",t)};kr.opcodeToString=function(t){let e="unknown";switch(t){case hr.ALT:e="ALT";break;case hr.CAT:e="CAT";break;case hr.RNM:e="RNM";break;case hr.UDT:e="UDT";break;case hr.AND:e="AND";break;case hr.NOT:e="NOT";break;case hr.REP:e="REP";break;case hr.TRG:e="TRG";break;case hr.TBS:e="TBS";break;case hr.TLS:e="TLS";break;case hr.BKR:e="BKR";break;case hr.BKA:e="BKA";break;case hr.BKN:e="BKN";break;case hr.ABG:e="ABG";break;case hr.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};kr.stateToString=function(t){let e="unknown";switch(t){case hr.ACTIVE:e="ACTIVE";break;case hr.MATCH:e="MATCH";break;case hr.EMPTY:e="EMPTY";break;case hr.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};kr.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"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","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"];kr.charToHex=function(t){let e=t.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};kr.charsToDec=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${Hs}charsToDec: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg){n+=t[i.beg];for(let a=i.beg+1;a<i.end;a+=1)n+=`,${t[a]}`}return n};kr.charsToHex=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${Hs}charsToHex: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg){n+=`\\x${ts.charToHex(t[i.beg])}`;for(let a=i.beg+1;a<i.end;a+=1)n+=`,\\x${ts.charToHex(t[a])}`}return n};kr.charsToHtmlEntities=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${Hs}charsToHex: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg)for(let a=i.beg;a<i.end;a+=1)n+=`&#x${t[a].toString(16)};`;return n};function rL(t){return!(t>=55296&&t<=57343||t>1114111)}o(rL,"isUnicode");kr.charsToUnicode=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${Hs}charsToUnicode: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg)for(let a=i.beg;a<i.end;a+=1)rL(t[a])?n+=`&#${t[a]};`:n+=` U+${ts.charToHex(t[a])}`;return n};kr.charsToJsUnicode=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${Hs}charsToJsUnicode: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg){n+=`\\u${ts.charToHex(t[i.beg])}`;for(let a=i.beg+1;a<i.end;a+=1)n+=`,\\u${ts.charToHex(t[a])}`}return n};kr.charsToAscii=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${Hs}charsToAscii: input must be an array of integers`);let i=Ha(t.length,e,r);for(let a=i.beg;a<i.end;a+=1){let c=t[a];c>=32&&c<=126?n+=String.fromCharCode(c):n+=`\\x${ts.charToHex(c)}`}return n};kr.charsToAsciiHtml=function(t,e,r){if(!Array.isArray(t))throw new Error(`${Hs}charsToAsciiHtml: input must be an array of integers`);let n="",i,a=Ha(t.length,e,r);for(let c=a.beg;c<a.end;c+=1)i=t[c],i<32||i===127?n+=`<span class="${_n.CLASS_CTRLCHAR}">${ts.asciiChars[i]}</span>`:i>127?n+=`<span class="${_n.CLASS_CTRLCHAR}">U+${ts.charToHex(i)}</span>`:n+=ts.asciiChars[i];return n};kr.stringToAsciiHtml=function(t){let e=ab.decode("STRING",t);return this.charsToAsciiHtml(e)}});var C4=De((FG,T4)=>{T4.exports=o(function(){let e=zi(),r=za(),n="ast.js: ",i=this,a=null,c=null,u=null,m=0,v=[],x=[],S=[],O=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(P,J,B){S.length=0,O.length=0,v.length=0,m=0,a=P,c=J,u=B;let W,Q=[];for(W=0;W<a.length;W+=1)Q.push(a[W].lower);for(W=0;W<c.length;W+=1)Q.push(c[W].lower);for(m=a.length+c.length,W=0;W<m;W+=1)v[W]=!1,x[W]=null;for(let Y in i.callbacks){let oe=Y.toLowerCase();if(W=Q.indexOf(oe),W<0)throw new Error(`${n}init: node '${Y}' not a rule or udt name`);typeof i.callbacks[Y]=="function"&&(v[W]=!0,x[W]=i.callbacks[Y]),i.callbacks[Y]===!0&&(v[W]=!0)}},"init"),this.ruleDefined=o(function(P){return v[P]!==!1},"ruleDefined"),this.udtDefined=o(function(P){return v[a.length+P]!==!1},"udtDefined"),this.down=o(function(P,J){let B=O.length;return S.push(B),O.push({name:J,thisIndex:B,thatIndex:null,state:e.SEM_PRE,callbackIndex:P,phraseIndex:null,phraseLength:null,stack:S.length}),B},"down"),this.up=o(function(P,J,B,W){let Q=O.length,Y=S.pop();return O.push({name:J,thisIndex:Q,thatIndex:Y,state:e.SEM_POST,callbackIndex:P,phraseIndex:B,phraseLength:W,stack:S.length}),O[Y].thatIndex=Q,O[Y].phraseIndex=B,O[Y].phraseLength=W,Q},"up"),this.translate=o(function(P){let J,B,W;for(let Q=0;Q<O.length;Q+=1)W=O[Q],B=x[W.callbackIndex],W.state===e.SEM_PRE?B!==null&&(J=B(e.SEM_PRE,u,W.phraseIndex,W.phraseLength,P),J===e.SEM_SKIP&&(Q=W.thatIndex)):B!==null&&B(e.SEM_POST,u,W.phraseIndex,W.phraseLength,P)},"translate"),this.setLength=o(function(P){O.length=P,P>0?S.length=O[P-1].stack:S.length=0},"setLength"),this.getLength=o(function(){return O.length},"getLength");function R(D){let P="";for(let J=0;J<D;J+=1)P+=" ";return P}o(R,"indent"),this.toXml=o(function(P){let J=r.charsToDec,B="decimal integer character codes";if(typeof P=="string"&&P.length>=3){let Y=P.slice(0,3).toLowerCase();Y==="asc"?(J=r.charsToAscii,B="ASCII for printing characters, hex for non-printing"):Y==="hex"?(J=r.charsToHex,B="hexadecimal integer character codes"):Y==="uni"&&(J=r.charsToUnicode,B="Unicode UTF-32 integer character codes")}let W="",Q=0;return W+=`<?xml version="1.0" encoding="utf-8"?>
|
|
284
284
|
`,W+=`<root nodes="${O.length/2}" characters="${u.length}">
|
|
285
|
-
`,W+=`<!-- input string, ${
|
|
285
|
+
`,W+=`<!-- input string, ${B} -->
|
|
286
286
|
`,W+=R(Q+2),W+=J(u),W+=`
|
|
287
287
|
`,O.forEach(Y=>{Y.state===e.SEM_PRE?(Q+=1,W+=R(Q),W+=`<node name="${Y.name}" index="${Y.phraseIndex}" length="${Y.phraseLength}">
|
|
288
288
|
`,W+=R(Q+2),W+=J(u,Y.phraseIndex,Y.phraseLength),W+=`
|
|
289
289
|
`):(W+=R(Q),W+=`</node><!-- name="${Y.name}" -->
|
|
290
290
|
`,Q-=1)}),W+=`</root>
|
|
291
|
-
`,W},"toSml"),this.phrases=o(function(){let P={},J,L;for(J=0;J<O.length;J+=1)L=O[J],L.state===e.SEM_PRE&&(Array.isArray(P[L.name])||(P[L.name]=[]),P[L.name].push({index:L.phraseIndex,length:L.phraseLength}));return P},"phrases")},"exportsAst")});var sb=De((UG,T4)=>{T4.exports=o(function(){let e="circular-buffer.js: ",r=-1,n=0;this.init=o(function(a){if(typeof a!="number"||a<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(a),r=-1},"init"),this.increment=o(function(){return r+=1,(r+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return r+1},"items"),this.getListIndex=o(function(a){return r===-1||a<0||a>r||r-a>=n?-1:(a+n)%n},"getListIndex"),this.forEach=o(function(a){if(r!==-1){if(r<n){for(let c=0;c<=r;c+=1)a(c,c);return}for(let c=r-n+1;c<=r;c+=1){let u=(c+n)%n;a(u,c)}}},"forEach")},"exportsCircularBuffer")});var k4=De(($G,C4)=>{C4.exports=o(function(){let e=zi(),r=za(),n="parser.js: ",i=this,a;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let c=null,u=null,m,v,x,S,O=0,R=0,D=0,P=null,J=null,L=null,W=null,Q=null,Y=0,oe=1/0,j=1/0,H=o(function(ie,$,X){let me=`${n}evaluateRule(): `;if(ie>=L.length)throw new Error(`${me}rule index: ${ie} out of range`);if($>=x)throw new Error(`${me}phrase index: ${$} out of range`);let{length:ye}=c;c.push({type:e.RNM,index:ie}),a(ye,$,X),c.pop()},"evaluateRule"),G=o(function(ue,ie,$){let X=`${n}evaluateUdt(): `;if(ue>=W.length)throw new Error(`${X}udt index: ${ue} out of range`);if(ie>=x)throw new Error(`${X}phrase index: ${ie} out of range`);let{length:me}=c;c.push({type:e.UDT,empty:W[ue].empty,index:ue}),a(me,ie,$),c.pop()},"evaluateUdt"),le=o(function(){O=0,R=0,D=0,Y=0,S=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],L=null,W=null,u=null,m=0,v=0,x=0,P=null,J=null,Q=null,c=null},"clear"),T=o(function(){let ue=[],ie=o(function(){let X={};L.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),W.length>0&&W.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),ue.push(X)},"init"),$=o(function(){let X=ue[ue.length-1],me={};for(let ye in X)me[ye]=X[ye];return me},"copy");this.push=o(function(){ue.push($())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=ue.length-1),ye<1||ye>ue.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return ue.length=ye,ue[ue.length-1]},"pop"),this.length=o(function(){return ue.length},"length"),this.savePhrase=o(function(me,ye,we){ue[ue.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(X){return ue[ue.length-1][X]},ie()},"backRef"),h=o(function(){let ie=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=S[S.length-1],this.uFrame=new T,this.pFrame=new T,this.evaluateRule=H,this.evaluateUdt=G,this.refresh=o(function(){ie.state=e.ACTIVE,ie.phraseLength=0,ie.lookAround=S[S.length-1]},"refresh")},"systemData"),y=o(function(){return S[S.length-1]},"lookAroundValue"),b=o(function(){return S.length>1},"inLookAround"),l=o(function(){return S[S.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),p=o(function(){let ue=`${n}initializeAst(): `,ie=!0;for(;ie;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${ue}ast object not recognized`);break}i.ast!==null&&i.ast.init(L,W,u)},"initializeAst"),_=o(function(){let ue=`${n}initializeTrace(): `,ie=!0;for(;ie;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${ue}trace object not recognized`);break}i.trace!==null&&i.trace.init(L,W,u)},"initializeTrace"),A=o(function(){let ue=`${n}initializeStats(): `,ie=!0;for(;ie;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${ue}stats object not recognized`);break}i.stats!==null&&i.stats.init(L,W)},"initializeStats"),E=o(function(ue){let ie=`${n}initializeGrammar(): `;if(!ue)throw new Error(`${ie}grammar object undefined`);if(ue.grammarObject!=="grammarObject")throw new Error(`${ie}bad grammar object`);L=ue.rules,W=ue.udts},"initializeGrammar"),g=o(function(ue){let ie=`${n}initializeStartRule(): `,$=null;if(typeof ue=="number"){if(ue>=L.length)throw new Error(`${ie}start rule index too large: max: ${L.length}: index: ${ue}`);$=ue}else if(typeof ue=="string"){let X=ue.toLowerCase();for(let me=0;me<L.length;me+=1)if(X===L[me].lower){$=L[me].index;break}if($===null)throw new Error(`${ie}start rule name '${ue}' not recognized`)}else throw new Error(`${ie}type of start rule '${typeof ue}' not recognized`);return $},"initializeStartRule"),C=o(function(ie,$,X){let me=`${n}initializeInputChars(): `,ye=ie,we=$,ke=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=r.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 ke!="number")ke=ye.length-we;else if(ke=Math.floor(ke),ke<0||ke>ye.length-we)throw new Error(`${me}input length out of range: ${ke}`);u=ye,m=we,v=ke,x=m+v},"initializeInputChars"),N=o(function(){let ue=`${n}initializeCallbacks(): `,ie;for(P=[],J=[],ie=0;ie<L.length;ie+=1)P[ie]=null;for(ie=0;ie<W.length;ie+=1)J[ie]=null;let $,X=[];for(ie=0;ie<L.length;ie+=1)X.push(L[ie].lower);for(ie=0;ie<W.length;ie+=1)X.push(W[ie].lower);for(let me in i.callbacks){if(ie=X.indexOf(me.toLowerCase()),ie<0)throw new Error(`${ue}syntax callback '${me}' not a rule or udt name`);if($=i.callbacks[me],$||($=null),typeof $=="function"||$===null)ie<L.length?P[ie]=$:J[ie-L.length]=$;else throw new Error(`${ue}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(ie=0;ie<W.length;ie+=1)if(J[ie]===null)throw new Error(`${ue}all UDT callbacks must be defined. UDT callback[${W[ie].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(ue){if(typeof ue!="number")throw new Error(`parser: max tree depth must be integer > 0: ${ue}`);if(oe=Math.floor(ue),oe<=0)throw new Error(`parser: max tree depth must be integer > 0: ${ue}`)},this.setMaxNodeHits=function(ue){if(typeof ue!="number")throw new Error(`parser: max node hits must be integer > 0: ${ue}`);if(j=Math.floor(ue),j<=0)throw new Error(`parser: max node hits must be integer > 0: ${ue}`)};let w=o(function(ue,ie,$){let X,me=`${n}parse(): `;E(ue);let ye=g(ie);N(),_(),A(),p();let we=new h;switch($!=null&&(Q=$),c=[{type:e.RNM,index:ye}],a(0,m,we),c=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===v?X=!0:X=!1;break;default:throw new Error("unrecognized state")}return{success:X,state:we.state,length:v,matched:we.phraseLength,maxMatched:Y,maxTreeDepth:R,nodeHits:D,inputLength:u.length,subBegin:m,subEnd:x,subLength:v}},"privateParse");this.parseSubstring=o(function(ie,$,X,me,ye,we){return le(),C(X,me,ye),w(ie,$,we)},"parseSubstring"),this.parse=o(function(ie,$,X,me){return le(),C(X,0,X.length),w(ie,$,me)},"parse");let k=o(function(ue,ie,$){let X=c[ue];for(let me=0;me<X.children.length&&(a(X.children[me],ie,$),$.state===e.NOMATCH);me+=1);},"opALT"),he=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue],It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=ie,we=0;for(let Oe=0;Oe<ke.children.length;Oe+=1)if(a(ke.children[Oe],ye,$),$.state===e.NOMATCH){X=!1;break}else ye+=$.phraseLength,we+=$.phraseLength;X?($.state=we===0?e.EMPTY:e.MATCH,$.phraseLength=we):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCAT"),I=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=x||(a(ue+1,me,$),$.state===e.NOMATCH)||$.state===e.EMPTY||(we+=1,ye+=$.phraseLength,me+=$.phraseLength,we===ke.max)););$.state===e.EMPTY||we>=ke.min?($.state=ye===0?e.EMPTY:e.MATCH,$.phraseLength=ye):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREP"),Z=o(function(ue,ie,$,X){if(ie.phraseLength>$){let me=`${n}opRNM(${ue.name}): callback function error: `;throw me+=`sysData.phraseLength: ${ie.phraseLength}`,me+=` must be <= remaining chars: ${$}`,new Error(me)}switch(ie.state){case e.ACTIVE:if(X!==!0)throw new Error(`${n}opRNM(${ue.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:ie.phraseLength=0;break;case e.MATCH:ie.phraseLength===0&&(ie.state=e.EMPTY);break;case e.NOMATCH:ie.phraseLength=0;break;default:throw new Error(`${n}opRNM(${ue.name}): callback function return error. Unrecognized return state: ${ie.state}`)}},"validateRnmCallbackResult"),se=o(function(ue,ie,$){let X,me,ye,we,ke,It,Ue=c[ue],Oe=L[Ue.index],Bt=P[Oe.index],je=!b();if(je&&(me=i.ast&&i.ast.ruleDefined(Ue.index),me&&(X=i.ast.getLength(),i.ast.down(Ue.index,L[Ue.index].name)),we=$.uFrame.length(),ke=$.pFrame.length(),$.uFrame.push(),$.pFrame.push(),It=$.pFrame,$.pFrame=new T),Bt===null)ye=c,c=Oe.opcodes,a(0,ie,$),c=ye;else{let Je=x-ie;$.ruleIndex=Oe.index,Bt($,u,ie,Q),Z(Oe,$,Je,!0),$.state===e.ACTIVE&&(ye=c,c=Oe.opcodes,a(0,ie,$),c=ye,$.ruleIndex=Oe.index,Bt($,u,ie,Q),Z(Oe,$,Je,!1))}je&&(me&&($.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Ue.index,Oe.name,ie,$.phraseLength)),$.pFrame=It,$.state===e.NOMATCH?($.uFrame.pop(we),$.pFrame.pop(ke)):Oe.isBkr&&($.pFrame.savePhrase(Oe.lower,ie,$.phraseLength),$.uFrame.savePhrase(Oe.lower,ie,$.phraseLength)))},"opRNM"),q=o(function(ue,ie,$){if(ie.phraseLength>$){let X=`${n}opUDT(${ue.name}): callback function error: `;throw X+=`sysData.phraseLength: ${ie.phraseLength}`,X+=` must be <= remaining chars: ${$}`,new Error(X)}switch(ie.state){case e.ACTIVE:throw new Error(`${n}opUDT(${ue.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(ue.empty===!1)throw new Error(`${n}opUDT(${ue.name}): callback function return error. May not return EMPTY.`);ie.phraseLength=0;break;case e.MATCH:if(ie.phraseLength===0){if(ue.empty===!1)throw new Error(`${n}opUDT(${ue.name}): callback function return error. May not return EMPTY.`);ie.state=e.EMPTY}break;case e.NOMATCH:ie.phraseLength=0;break;default:throw new Error(`${n}opUDT(${ue.name}): callback function return error. Unrecognized return state: ${ie.state}`)}},"validateUdtCallbackResult"),F=o(function(ue,ie,$){let X,me,ye,we,ke,It,Ue=c[ue],Oe=W[Ue.index];$.UdtIndex=Oe.index;let Bt=!b();Bt&&(ye=i.ast&&i.ast.udtDefined(Ue.index),ye&&(me=L.length+Ue.index,X=i.ast.getLength(),i.ast.down(me,Oe.name)),we=$.uFrame.length(),ke=$.pFrame.length(),$.uFrame.push(),$.pFrame.push(),It=$.pFrame,$.pFrame=new T);let je=x-ie;J[Ue.index]($,u,ie,Q),q(Oe,$,je),Bt&&(ye&&($.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Oe.name,ie,$.phraseLength)),$.pFrame=It,$.state===e.NOMATCH?($.uFrame.pop(we),$.pFrame.pop(ke)):Oe.isBkr&&($.pFrame.savePhrase(Oe.lower,ie,$.phraseLength),$.uFrame.savePhrase(Oe.lower,ie,$.phraseLength)))},"opUDT"),ee=o(function(ue,ie,$){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:x,charsLength:v}),x=u.length,v=u.length-m,a(ue+1,ie,$);let X=S.pop();switch(x=X.charsEnd,v=X.charsLength,$.phraseLength=0,$.state){case e.EMPTY:$.state=e.EMPTY;break;case e.MATCH:$.state=e.EMPTY;break;case e.NOMATCH:$.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${$.state}`)}},"opAND"),ne=o(function(ue,ie,$){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:x,charsLength:v}),x=u.length,v=u.length-m,a(ue+1,ie,$);let X=S.pop();switch(x=X.charsEnd,v=X.charsLength,$.phraseLength=0,$.state){case e.EMPTY:case e.MATCH:$.state=e.NOMATCH;break;case e.NOMATCH:$.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${$.state}`)}},"opNOT"),ae=o(function(ue,ie,$){let X=c[ue];$.state=e.NOMATCH,ie<x&&X.min<=u[ie]&&u[ie]<=X.max&&($.state=e.MATCH,$.phraseLength=1)},"opTRG"),Ae=o(function(ue,ie,$){let X,me=c[ue],ye=me.string.length;if($.state=e.NOMATCH,ie+ye<=x){for(X=0;X<ye;X+=1)if(u[ie+X]!==me.string[X])return;$.state=e.MATCH,$.phraseLength=ye}},"opTBS"),ge=o(function(ue,ie,$){let X,me,ye=c[ue];$.state=e.NOMATCH;let we=ye.string.length;if(we===0){$.state=e.EMPTY;return}if(ie+we<=x){for(X=0;X<we;X+=1)if(me=u[ie+X],me>=65&&me<=90&&(me+=32),me!==ye.string[X])return;$.state=e.MATCH,$.phraseLength=we}},"opTLS"),re=o(function(ue,ie,$){$.state=e.NOMATCH,$.phraseLength=0,$.state=ie===0?e.EMPTY:e.NOMATCH},"opABG"),Se=o(function(ue,ie,$){$.state=e.NOMATCH,$.phraseLength=0,$.state=ie===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ce=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];$.state=e.NOMATCH,ke.index<L.length?we=L[ke.index].lower:we=W[ke.index-L.length].lower;let It=ke.bkrMode===e.BKR_MODE_PM?$.pFrame.getPhrase(we):$.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){$.state=e.EMPTY;return}if(ie+Bt<=x){if(Ue){for(X=0;X<Bt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}},"opBKR"),ve=o(function(ue,ie,$){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,$),S.pop(),$.phraseLength=0,$.state){case e.EMPTY:$.state=e.EMPTY;break;case e.MATCH:$.state=e.EMPTY;break;case e.NOMATCH:$.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${$.state}`)}},"opBKA"),V=o(function(ue,ie,$){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,$),S.pop(),$.phraseLength=0,$.state){case e.EMPTY:case e.MATCH:$.state=e.NOMATCH;break;case e.NOMATCH:$.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${$.state}`)}},"opBKN"),pe=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue],It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=ie,we=0;for(let Oe=ke.children.length-1;Oe>=0;Oe-=1)if(a(ke.children[Oe],ye,$),ye-=$.phraseLength,we+=$.phraseLength,$.state===e.NOMATCH){X=!1;break}X?($.state=we===0?e.EMPTY:e.MATCH,$.phraseLength=we):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCATBehind"),Ce=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(a(ue+1,me,$),$.state===e.NOMATCH)||$.state===e.EMPTY||(we+=1,ye+=$.phraseLength,me-=$.phraseLength,we===ke.max)););$.state===e.EMPTY||we>=ke.min?($.state=ye===0?e.EMPTY:e.MATCH,$.phraseLength=ye):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREPBehind"),He=o(function(ue,ie,$){let X=c[ue];if($.state=e.NOMATCH,$.phraseLength=0,ie>0){let me=u[ie-1];X.min<=me&&me<=X.max&&($.state=e.MATCH,$.phraseLength=1)}},"opTRGBehind"),Re=o(function(ue,ie,$){let X,me=c[ue];$.state=e.NOMATCH;let ye=me.string.length,we=ie-ye;if(we>=0){for(X=0;X<ye;X+=1)if(u[we+X]!==me.string[X])return;$.state=e.MATCH,$.phraseLength=ye}},"opTBSBehind"),Ve=o(function(ue,ie,$){let X,me=c[ue];$.state=e.NOMATCH;let ye=me.string.length;if(ye===0){$.state=e.EMPTY;return}let we=ie-ye;if(we>=0){for(let ke=0;ke<ye;ke+=1)if(X=u[we+ke],X>=65&&X<=90&&(X+=32),X!==me.string[ke])return;$.state=e.MATCH,$.phraseLength=ye}},"opTLSBehind"),pr=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];$.state=e.NOMATCH,$.phraseLength=0,ke.index<L.length?we=L[ke.index].lower:we=W[ke.index-L.length].lower;let It=ke.bkrMode===e.BKR_MODE_PM?$.pFrame.getPhrase(we):$.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){$.state=e.EMPTY,$.phraseLength=0;return}let je=ie-Bt;if(je>=0){if(Ue){for(X=0;X<Bt;X+=1)if(me=u[je+X],ye=u[Oe+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[je+X],ye=u[Oe+X],me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}},"opBKRBehind");a=o(function(ie,$,X){let me=!0,ye=c[ie];if(D+=1,D>j)throw new Error(`parser: maximum number of node hits exceeded: ${j}`);if(O+=1,O>R&&(R=O,R>oe))throw new Error(`parser: maximum parse tree depth exceeded: ${oe}`);if(X.refresh(),i.trace!==null){let we=y();i.trace.down(ye,X.state,$,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(ie,$,X);break;case e.CAT:pe(ie,$,X);break;case e.REP:Ce(ie,$,X);break;case e.RNM:se(ie,$,X);break;case e.UDT:F(ie,$,X);break;case e.AND:ee(ie,$,X);break;case e.NOT:ne(ie,$,X);break;case e.TRG:He(ie,$,X);break;case e.TBS:Re(ie,$,X);break;case e.TLS:Ve(ie,$,X);break;case e.BKR:pr(ie,$,X);break;case e.BKA:ve(ie,$,X);break;case e.BKN:V(ie,$,X);break;case e.ABG:re(ie,$,X);break;case e.AEN:Se(ie,$,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(ie,$,X);break;case e.CAT:he(ie,$,X);break;case e.REP:I(ie,$,X);break;case e.RNM:se(ie,$,X);break;case e.UDT:F(ie,$,X);break;case e.AND:ee(ie,$,X);break;case e.NOT:ne(ie,$,X);break;case e.TRG:ae(ie,$,X);break;case e.TBS:Ae(ie,$,X);break;case e.TLS:ge(ie,$,X);break;case e.BKR:ce(ie,$,X);break;case e.BKA:ve(ie,$,X);break;case e.BKN:V(ie,$,X);break;case e.ABG:re(ie,$,X);break;case e.AEN:Se(ie,$,X);break;default:me=!1;break}if(!b()&&$+X.phraseLength>Y&&(Y=$+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=y();i.trace.up(ye,X.state,$,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var D4=De((FG,I4)=>{I4.exports=o(function(){let e=zi(),r=za(),n=$u(),i="stats.js: ",a=[],c=[],u=[],m,v=[],x=[];this.statsObject="statsObject";let S="stats",O=o(function(j,H){return j.lower<H.lower?-1:j.lower>H.lower?1:0},"sortAlpha"),R=o(function(j,H){return j.total<H.total?1:j.total>H.total?-1:O(j,H)},"sortHits"),D=o(function(j,H){return j.index<H.index?-1:j.index>H.index?1:0},"sortIndex"),P=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),J=o(function(){u.length=0,m=new P,u[e.ALT]=new P,u[e.CAT]=new P,u[e.REP]=new P,u[e.RNM]=new P,u[e.TRG]=new P,u[e.TBS]=new P,u[e.TLS]=new P,u[e.UDT]=new P,u[e.AND]=new P,u[e.NOT]=new P,u[e.BKR]=new P,u[e.BKA]=new P,u[e.BKN]=new P,u[e.ABG]=new P,u[e.AEN]=new P,v.length=0;for(let j=0;j<a.length;j+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:a[j].name,lower:a[j].lower,index:a[j].index});if(c.length>0){x.length=0;for(let j=0;j<c.length;j+=1)x.push({empty:0,match:0,nomatch:0,total:0,name:c[j].name,lower:c[j].lower,index:c[j].index})}},"clear"),L=o(function(j,H){switch(j.total+=1,H){case e.EMPTY:j.empty+=1;break;case e.MATCH:j.match+=1;break;case e.NOMATCH:j.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${H}`)}},"incStat"),W=o(function(j,H){let G="";return G+="<tr>",G+=`<td class="${n.CLASS_ACTIVE}">${j}</td>`,G+=`<td class="${n.CLASS_EMPTY}">${H.empty}</td>`,G+=`<td class="${n.CLASS_MATCH}">${H.match}</td>`,G+=`<td class="${n.CLASS_NOMATCH}">${H.nomatch}</td>`,G+=`<td class="${n.CLASS_ACTIVE}">${H.total}</td>`,G+=`</tr>
|
|
291
|
+
`,W},"toSml"),this.phrases=o(function(){let P={},J,B;for(J=0;J<O.length;J+=1)B=O[J],B.state===e.SEM_PRE&&(Array.isArray(P[B.name])||(P[B.name]=[]),P[B.name].push({index:B.phraseIndex,length:B.phraseLength}));return P},"phrases")},"exportsAst")});var fb=De((qG,k4)=>{k4.exports=o(function(){let e="circular-buffer.js: ",r=-1,n=0;this.init=o(function(a){if(typeof a!="number"||a<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(a),r=-1},"init"),this.increment=o(function(){return r+=1,(r+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return r+1},"items"),this.getListIndex=o(function(a){return r===-1||a<0||a>r||r-a>=n?-1:(a+n)%n},"getListIndex"),this.forEach=o(function(a){if(r!==-1){if(r<n){for(let c=0;c<=r;c+=1)a(c,c);return}for(let c=r-n+1;c<=r;c+=1){let u=(c+n)%n;a(u,c)}}},"forEach")},"exportsCircularBuffer")});var D4=De((HG,I4)=>{I4.exports=o(function(){let e=zi(),r=za(),n="parser.js: ",i=this,a;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let c=null,u=null,m,v,x,S,O=0,R=0,D=0,P=null,J=null,B=null,W=null,Q=null,Y=0,oe=1/0,j=1/0,H=o(function(ie,$,X){let me=`${n}evaluateRule(): `;if(ie>=B.length)throw new Error(`${me}rule index: ${ie} out of range`);if($>=x)throw new Error(`${me}phrase index: ${$} out of range`);let{length:ye}=c;c.push({type:e.RNM,index:ie}),a(ye,$,X),c.pop()},"evaluateRule"),G=o(function(ue,ie,$){let X=`${n}evaluateUdt(): `;if(ue>=W.length)throw new Error(`${X}udt index: ${ue} out of range`);if(ie>=x)throw new Error(`${X}phrase index: ${ie} out of range`);let{length:me}=c;c.push({type:e.UDT,empty:W[ue].empty,index:ue}),a(me,ie,$),c.pop()},"evaluateUdt"),le=o(function(){O=0,R=0,D=0,Y=0,S=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],B=null,W=null,u=null,m=0,v=0,x=0,P=null,J=null,Q=null,c=null},"clear"),T=o(function(){let ue=[],ie=o(function(){let X={};B.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),W.length>0&&W.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),ue.push(X)},"init"),$=o(function(){let X=ue[ue.length-1],me={};for(let ye in X)me[ye]=X[ye];return me},"copy");this.push=o(function(){ue.push($())},"push"),this.pop=o(function(me){let ye=me;if(ye||(ye=ue.length-1),ye<1||ye>ue.length)throw new Error(`${n}backRef.pop(): bad length: ${ye}`);return ue.length=ye,ue[ue.length-1]},"pop"),this.length=o(function(){return ue.length},"length"),this.savePhrase=o(function(me,ye,we){ue[ue.length-1][me]={phraseIndex:ye,phraseLength:we}},"savePhrase"),this.getPhrase=function(X){return ue[ue.length-1][X]},ie()},"backRef"),h=o(function(){let ie=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=S[S.length-1],this.uFrame=new T,this.pFrame=new T,this.evaluateRule=H,this.evaluateUdt=G,this.refresh=o(function(){ie.state=e.ACTIVE,ie.phraseLength=0,ie.lookAround=S[S.length-1]},"refresh")},"systemData"),y=o(function(){return S[S.length-1]},"lookAroundValue"),b=o(function(){return S.length>1},"inLookAround"),l=o(function(){return S[S.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),p=o(function(){let ue=`${n}initializeAst(): `,ie=!0;for(;ie;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${ue}ast object not recognized`);break}i.ast!==null&&i.ast.init(B,W,u)},"initializeAst"),_=o(function(){let ue=`${n}initializeTrace(): `,ie=!0;for(;ie;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${ue}trace object not recognized`);break}i.trace!==null&&i.trace.init(B,W,u)},"initializeTrace"),A=o(function(){let ue=`${n}initializeStats(): `,ie=!0;for(;ie;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${ue}stats object not recognized`);break}i.stats!==null&&i.stats.init(B,W)},"initializeStats"),E=o(function(ue){let ie=`${n}initializeGrammar(): `;if(!ue)throw new Error(`${ie}grammar object undefined`);if(ue.grammarObject!=="grammarObject")throw new Error(`${ie}bad grammar object`);B=ue.rules,W=ue.udts},"initializeGrammar"),g=o(function(ue){let ie=`${n}initializeStartRule(): `,$=null;if(typeof ue=="number"){if(ue>=B.length)throw new Error(`${ie}start rule index too large: max: ${B.length}: index: ${ue}`);$=ue}else if(typeof ue=="string"){let X=ue.toLowerCase();for(let me=0;me<B.length;me+=1)if(X===B[me].lower){$=B[me].index;break}if($===null)throw new Error(`${ie}start rule name '${ue}' not recognized`)}else throw new Error(`${ie}type of start rule '${typeof ue}' not recognized`);return $},"initializeStartRule"),C=o(function(ie,$,X){let me=`${n}initializeInputChars(): `,ye=ie,we=$,ke=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=r.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 ke!="number")ke=ye.length-we;else if(ke=Math.floor(ke),ke<0||ke>ye.length-we)throw new Error(`${me}input length out of range: ${ke}`);u=ye,m=we,v=ke,x=m+v},"initializeInputChars"),N=o(function(){let ue=`${n}initializeCallbacks(): `,ie;for(P=[],J=[],ie=0;ie<B.length;ie+=1)P[ie]=null;for(ie=0;ie<W.length;ie+=1)J[ie]=null;let $,X=[];for(ie=0;ie<B.length;ie+=1)X.push(B[ie].lower);for(ie=0;ie<W.length;ie+=1)X.push(W[ie].lower);for(let me in i.callbacks){if(ie=X.indexOf(me.toLowerCase()),ie<0)throw new Error(`${ue}syntax callback '${me}' not a rule or udt name`);if($=i.callbacks[me],$||($=null),typeof $=="function"||$===null)ie<B.length?P[ie]=$:J[ie-B.length]=$;else throw new Error(`${ue}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(ie=0;ie<W.length;ie+=1)if(J[ie]===null)throw new Error(`${ue}all UDT callbacks must be defined. UDT callback[${W[ie].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(ue){if(typeof ue!="number")throw new Error(`parser: max tree depth must be integer > 0: ${ue}`);if(oe=Math.floor(ue),oe<=0)throw new Error(`parser: max tree depth must be integer > 0: ${ue}`)},this.setMaxNodeHits=function(ue){if(typeof ue!="number")throw new Error(`parser: max node hits must be integer > 0: ${ue}`);if(j=Math.floor(ue),j<=0)throw new Error(`parser: max node hits must be integer > 0: ${ue}`)};let w=o(function(ue,ie,$){let X,me=`${n}parse(): `;E(ue);let ye=g(ie);N(),_(),A(),p();let we=new h;switch($!=null&&(Q=$),c=[{type:e.RNM,index:ye}],a(0,m,we),c=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===v?X=!0:X=!1;break;default:throw new Error("unrecognized state")}return{success:X,state:we.state,length:v,matched:we.phraseLength,maxMatched:Y,maxTreeDepth:R,nodeHits:D,inputLength:u.length,subBegin:m,subEnd:x,subLength:v}},"privateParse");this.parseSubstring=o(function(ie,$,X,me,ye,we){return le(),C(X,me,ye),w(ie,$,we)},"parseSubstring"),this.parse=o(function(ie,$,X,me){return le(),C(X,0,X.length),w(ie,$,me)},"parse");let k=o(function(ue,ie,$){let X=c[ue];for(let me=0;me<X.children.length&&(a(X.children[me],ie,$),$.state===e.NOMATCH);me+=1);},"opALT"),he=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue],It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=ie,we=0;for(let Oe=0;Oe<ke.children.length;Oe+=1)if(a(ke.children[Oe],ye,$),$.state===e.NOMATCH){X=!1;break}else ye+=$.phraseLength,we+=$.phraseLength;X?($.state=we===0?e.EMPTY:e.MATCH,$.phraseLength=we):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCAT"),I=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=x||(a(ue+1,me,$),$.state===e.NOMATCH)||$.state===e.EMPTY||(we+=1,ye+=$.phraseLength,me+=$.phraseLength,we===ke.max)););$.state===e.EMPTY||we>=ke.min?($.state=ye===0?e.EMPTY:e.MATCH,$.phraseLength=ye):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREP"),Z=o(function(ue,ie,$,X){if(ie.phraseLength>$){let me=`${n}opRNM(${ue.name}): callback function error: `;throw me+=`sysData.phraseLength: ${ie.phraseLength}`,me+=` must be <= remaining chars: ${$}`,new Error(me)}switch(ie.state){case e.ACTIVE:if(X!==!0)throw new Error(`${n}opRNM(${ue.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:ie.phraseLength=0;break;case e.MATCH:ie.phraseLength===0&&(ie.state=e.EMPTY);break;case e.NOMATCH:ie.phraseLength=0;break;default:throw new Error(`${n}opRNM(${ue.name}): callback function return error. Unrecognized return state: ${ie.state}`)}},"validateRnmCallbackResult"),se=o(function(ue,ie,$){let X,me,ye,we,ke,It,Ue=c[ue],Oe=B[Ue.index],Bt=P[Oe.index],je=!b();if(je&&(me=i.ast&&i.ast.ruleDefined(Ue.index),me&&(X=i.ast.getLength(),i.ast.down(Ue.index,B[Ue.index].name)),we=$.uFrame.length(),ke=$.pFrame.length(),$.uFrame.push(),$.pFrame.push(),It=$.pFrame,$.pFrame=new T),Bt===null)ye=c,c=Oe.opcodes,a(0,ie,$),c=ye;else{let Je=x-ie;$.ruleIndex=Oe.index,Bt($,u,ie,Q),Z(Oe,$,Je,!0),$.state===e.ACTIVE&&(ye=c,c=Oe.opcodes,a(0,ie,$),c=ye,$.ruleIndex=Oe.index,Bt($,u,ie,Q),Z(Oe,$,Je,!1))}je&&(me&&($.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Ue.index,Oe.name,ie,$.phraseLength)),$.pFrame=It,$.state===e.NOMATCH?($.uFrame.pop(we),$.pFrame.pop(ke)):Oe.isBkr&&($.pFrame.savePhrase(Oe.lower,ie,$.phraseLength),$.uFrame.savePhrase(Oe.lower,ie,$.phraseLength)))},"opRNM"),q=o(function(ue,ie,$){if(ie.phraseLength>$){let X=`${n}opUDT(${ue.name}): callback function error: `;throw X+=`sysData.phraseLength: ${ie.phraseLength}`,X+=` must be <= remaining chars: ${$}`,new Error(X)}switch(ie.state){case e.ACTIVE:throw new Error(`${n}opUDT(${ue.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(ue.empty===!1)throw new Error(`${n}opUDT(${ue.name}): callback function return error. May not return EMPTY.`);ie.phraseLength=0;break;case e.MATCH:if(ie.phraseLength===0){if(ue.empty===!1)throw new Error(`${n}opUDT(${ue.name}): callback function return error. May not return EMPTY.`);ie.state=e.EMPTY}break;case e.NOMATCH:ie.phraseLength=0;break;default:throw new Error(`${n}opUDT(${ue.name}): callback function return error. Unrecognized return state: ${ie.state}`)}},"validateUdtCallbackResult"),F=o(function(ue,ie,$){let X,me,ye,we,ke,It,Ue=c[ue],Oe=W[Ue.index];$.UdtIndex=Oe.index;let Bt=!b();Bt&&(ye=i.ast&&i.ast.udtDefined(Ue.index),ye&&(me=B.length+Ue.index,X=i.ast.getLength(),i.ast.down(me,Oe.name)),we=$.uFrame.length(),ke=$.pFrame.length(),$.uFrame.push(),$.pFrame.push(),It=$.pFrame,$.pFrame=new T);let je=x-ie;J[Ue.index]($,u,ie,Q),q(Oe,$,je),Bt&&(ye&&($.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Oe.name,ie,$.phraseLength)),$.pFrame=It,$.state===e.NOMATCH?($.uFrame.pop(we),$.pFrame.pop(ke)):Oe.isBkr&&($.pFrame.savePhrase(Oe.lower,ie,$.phraseLength),$.uFrame.savePhrase(Oe.lower,ie,$.phraseLength)))},"opUDT"),ee=o(function(ue,ie,$){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:x,charsLength:v}),x=u.length,v=u.length-m,a(ue+1,ie,$);let X=S.pop();switch(x=X.charsEnd,v=X.charsLength,$.phraseLength=0,$.state){case e.EMPTY:$.state=e.EMPTY;break;case e.MATCH:$.state=e.EMPTY;break;case e.NOMATCH:$.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${$.state}`)}},"opAND"),ne=o(function(ue,ie,$){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:x,charsLength:v}),x=u.length,v=u.length-m,a(ue+1,ie,$);let X=S.pop();switch(x=X.charsEnd,v=X.charsLength,$.phraseLength=0,$.state){case e.EMPTY:case e.MATCH:$.state=e.NOMATCH;break;case e.NOMATCH:$.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${$.state}`)}},"opNOT"),ae=o(function(ue,ie,$){let X=c[ue];$.state=e.NOMATCH,ie<x&&X.min<=u[ie]&&u[ie]<=X.max&&($.state=e.MATCH,$.phraseLength=1)},"opTRG"),Ae=o(function(ue,ie,$){let X,me=c[ue],ye=me.string.length;if($.state=e.NOMATCH,ie+ye<=x){for(X=0;X<ye;X+=1)if(u[ie+X]!==me.string[X])return;$.state=e.MATCH,$.phraseLength=ye}},"opTBS"),ge=o(function(ue,ie,$){let X,me,ye=c[ue];$.state=e.NOMATCH;let we=ye.string.length;if(we===0){$.state=e.EMPTY;return}if(ie+we<=x){for(X=0;X<we;X+=1)if(me=u[ie+X],me>=65&&me<=90&&(me+=32),me!==ye.string[X])return;$.state=e.MATCH,$.phraseLength=we}},"opTLS"),re=o(function(ue,ie,$){$.state=e.NOMATCH,$.phraseLength=0,$.state=ie===0?e.EMPTY:e.NOMATCH},"opABG"),Se=o(function(ue,ie,$){$.state=e.NOMATCH,$.phraseLength=0,$.state=ie===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ce=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];$.state=e.NOMATCH,ke.index<B.length?we=B[ke.index].lower:we=W[ke.index-B.length].lower;let It=ke.bkrMode===e.BKR_MODE_PM?$.pFrame.getPhrase(we):$.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){$.state=e.EMPTY;return}if(ie+Bt<=x){if(Ue){for(X=0;X<Bt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}},"opBKR"),ve=o(function(ue,ie,$){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,$),S.pop(),$.phraseLength=0,$.state){case e.EMPTY:$.state=e.EMPTY;break;case e.MATCH:$.state=e.EMPTY;break;case e.NOMATCH:$.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${$.state}`)}},"opBKA"),V=o(function(ue,ie,$){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,$),S.pop(),$.phraseLength=0,$.state){case e.EMPTY:case e.MATCH:$.state=e.NOMATCH;break;case e.NOMATCH:$.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${$.state}`)}},"opBKN"),pe=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue],It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(me=i.ast.getLength()),X=!0,ye=ie,we=0;for(let Oe=ke.children.length-1;Oe>=0;Oe-=1)if(a(ke.children[Oe],ye,$),ye-=$.phraseLength,we+=$.phraseLength,$.state===e.NOMATCH){X=!1;break}X?($.state=we===0?e.EMPTY:e.MATCH,$.phraseLength=we):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCATBehind"),Ce=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=$.uFrame.length(),Ue=$.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(a(ue+1,me,$),$.state===e.NOMATCH)||$.state===e.EMPTY||(we+=1,ye+=$.phraseLength,me-=$.phraseLength,we===ke.max)););$.state===e.EMPTY||we>=ke.min?($.state=ye===0?e.EMPTY:e.MATCH,$.phraseLength=ye):($.state=e.NOMATCH,$.phraseLength=0,$.uFrame.pop(It),$.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREPBehind"),He=o(function(ue,ie,$){let X=c[ue];if($.state=e.NOMATCH,$.phraseLength=0,ie>0){let me=u[ie-1];X.min<=me&&me<=X.max&&($.state=e.MATCH,$.phraseLength=1)}},"opTRGBehind"),Re=o(function(ue,ie,$){let X,me=c[ue];$.state=e.NOMATCH;let ye=me.string.length,we=ie-ye;if(we>=0){for(X=0;X<ye;X+=1)if(u[we+X]!==me.string[X])return;$.state=e.MATCH,$.phraseLength=ye}},"opTBSBehind"),Ve=o(function(ue,ie,$){let X,me=c[ue];$.state=e.NOMATCH;let ye=me.string.length;if(ye===0){$.state=e.EMPTY;return}let we=ie-ye;if(we>=0){for(let ke=0;ke<ye;ke+=1)if(X=u[we+ke],X>=65&&X<=90&&(X+=32),X!==me.string[ke])return;$.state=e.MATCH,$.phraseLength=ye}},"opTLSBehind"),pr=o(function(ue,ie,$){let X,me,ye,we,ke=c[ue];$.state=e.NOMATCH,$.phraseLength=0,ke.index<B.length?we=B[ke.index].lower:we=W[ke.index-B.length].lower;let It=ke.bkrMode===e.BKR_MODE_PM?$.pFrame.getPhrase(we):$.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){$.state=e.EMPTY,$.phraseLength=0;return}let je=ie-Bt;if(je>=0){if(Ue){for(X=0;X<Bt;X+=1)if(me=u[je+X],ye=u[Oe+X],me>=65&&me<=90&&(me+=32),ye>=65&&ye<=90&&(ye+=32),me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[je+X],ye=u[Oe+X],me!==ye)return;$.state=e.MATCH,$.phraseLength=Bt}},"opBKRBehind");a=o(function(ie,$,X){let me=!0,ye=c[ie];if(D+=1,D>j)throw new Error(`parser: maximum number of node hits exceeded: ${j}`);if(O+=1,O>R&&(R=O,R>oe))throw new Error(`parser: maximum parse tree depth exceeded: ${oe}`);if(X.refresh(),i.trace!==null){let we=y();i.trace.down(ye,X.state,$,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(ie,$,X);break;case e.CAT:pe(ie,$,X);break;case e.REP:Ce(ie,$,X);break;case e.RNM:se(ie,$,X);break;case e.UDT:F(ie,$,X);break;case e.AND:ee(ie,$,X);break;case e.NOT:ne(ie,$,X);break;case e.TRG:He(ie,$,X);break;case e.TBS:Re(ie,$,X);break;case e.TLS:Ve(ie,$,X);break;case e.BKR:pr(ie,$,X);break;case e.BKA:ve(ie,$,X);break;case e.BKN:V(ie,$,X);break;case e.ABG:re(ie,$,X);break;case e.AEN:Se(ie,$,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(ie,$,X);break;case e.CAT:he(ie,$,X);break;case e.REP:I(ie,$,X);break;case e.RNM:se(ie,$,X);break;case e.UDT:F(ie,$,X);break;case e.AND:ee(ie,$,X);break;case e.NOT:ne(ie,$,X);break;case e.TRG:ae(ie,$,X);break;case e.TBS:Ae(ie,$,X);break;case e.TLS:ge(ie,$,X);break;case e.BKR:ce(ie,$,X);break;case e.BKA:ve(ie,$,X);break;case e.BKN:V(ie,$,X);break;case e.ABG:re(ie,$,X);break;case e.AEN:Se(ie,$,X);break;default:me=!1;break}if(!b()&&$+X.phraseLength>Y&&(Y=$+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=y();i.trace.up(ye,X.state,$,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var R4=De((zG,O4)=>{O4.exports=o(function(){let e=zi(),r=za(),n=Fu(),i="stats.js: ",a=[],c=[],u=[],m,v=[],x=[];this.statsObject="statsObject";let S="stats",O=o(function(j,H){return j.lower<H.lower?-1:j.lower>H.lower?1:0},"sortAlpha"),R=o(function(j,H){return j.total<H.total?1:j.total>H.total?-1:O(j,H)},"sortHits"),D=o(function(j,H){return j.index<H.index?-1:j.index>H.index?1:0},"sortIndex"),P=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),J=o(function(){u.length=0,m=new P,u[e.ALT]=new P,u[e.CAT]=new P,u[e.REP]=new P,u[e.RNM]=new P,u[e.TRG]=new P,u[e.TBS]=new P,u[e.TLS]=new P,u[e.UDT]=new P,u[e.AND]=new P,u[e.NOT]=new P,u[e.BKR]=new P,u[e.BKA]=new P,u[e.BKN]=new P,u[e.ABG]=new P,u[e.AEN]=new P,v.length=0;for(let j=0;j<a.length;j+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:a[j].name,lower:a[j].lower,index:a[j].index});if(c.length>0){x.length=0;for(let j=0;j<c.length;j+=1)x.push({empty:0,match:0,nomatch:0,total:0,name:c[j].name,lower:c[j].lower,index:c[j].index})}},"clear"),B=o(function(j,H){switch(j.total+=1,H){case e.EMPTY:j.empty+=1;break;case e.MATCH:j.match+=1;break;case e.NOMATCH:j.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${H}`)}},"incStat"),W=o(function(j,H){let G="";return G+="<tr>",G+=`<td class="${n.CLASS_ACTIVE}">${j}</td>`,G+=`<td class="${n.CLASS_EMPTY}">${H.empty}</td>`,G+=`<td class="${n.CLASS_MATCH}">${H.match}</td>`,G+=`<td class="${n.CLASS_NOMATCH}">${H.nomatch}</td>`,G+=`<td class="${n.CLASS_ACTIVE}">${H.total}</td>`,G+=`</tr>
|
|
292
292
|
`,G},"displayRow"),Q=o(function(){let j="";return j+=W("ALT",u[e.ALT]),j+=W("CAT",u[e.CAT]),j+=W("REP",u[e.REP]),j+=W("RNM",u[e.RNM]),j+=W("TRG",u[e.TRG]),j+=W("TBS",u[e.TBS]),j+=W("TLS",u[e.TLS]),j+=W("UDT",u[e.UDT]),j+=W("AND",u[e.AND]),j+=W("NOT",u[e.NOT]),j+=W("BKR",u[e.BKR]),j+=W("BKA",u[e.BKA]),j+=W("BKN",u[e.BKN]),j+=W("ABG",u[e.ABG]),j+=W("AEN",u[e.AEN]),j+=W("totals",m),j},"displayOpsOnly"),Y=o(function(){let j="";j+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
293
293
|
`,j+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
|
|
294
294
|
`;for(let H=0;H<a.length;H+=1)v[H].total>0&&(j+="<tr>",j+=`<td class="${n.CLASS_ACTIVE}">${v[H].name}</td>`,j+=`<td class="${n.CLASS_EMPTY}">${v[H].empty}</td>`,j+=`<td class="${n.CLASS_MATCH}">${v[H].match}</td>`,j+=`<td class="${n.CLASS_NOMATCH}">${v[H].nomatch}</td>`,j+=`<td class="${n.CLASS_ACTIVE}">${v[H].total}</td>`,j+=`</tr>
|
|
295
295
|
`);if(c.length>0){j+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
296
296
|
`,j+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
|
|
297
297
|
`;for(let H=0;H<c.length;H+=1)x[H].total>0&&(j+="<tr>",j+=`<td class="${n.CLASS_ACTIVE}">${x[H].name}</td>`,j+=`<td class="${n.CLASS_EMPTY}">${x[H].empty}</td>`,j+=`<td class="${n.CLASS_MATCH}">${x[H].match}</td>`,j+=`<td class="${n.CLASS_NOMATCH}">${x[H].nomatch}</td>`,j+=`<td class="${n.CLASS_ACTIVE}">${x[H].total}</td>`,j+=`</tr>
|
|
298
|
-
`)}return j},"displayRules");this.validate=o(function(j){let H=!1;return typeof j=="string"&&S===j&&(H=!0),H},"validate"),this.init=o(function(j,H){a=j,c=H,J()},"init"),this.collect=o(function(j,H){
|
|
298
|
+
`)}return j},"displayRules");this.validate=o(function(j){let H=!1;return typeof j=="string"&&S===j&&(H=!0),H},"validate"),this.init=o(function(j,H){a=j,c=H,J()},"init"),this.collect=o(function(j,H){B(m,H.state,H.phraseLength),B(u[j.type],H.state,H.phraseLength),j.type===e.RNM&&B(v[j.index],H.state,H.phraseLength),j.type===e.UDT&&B(x[j.index],H.state,H.phraseLength)},"collect"),this.toHtml=o(function(j,H){let G="";G+=`<table class="${n.CLASS_STATS}">
|
|
299
299
|
`,typeof H=="string"&&(G+=`<caption>${H}</caption>
|
|
300
300
|
`),G+=`<tr><th class="${n.CLASS_ACTIVE}">ops</th>
|
|
301
301
|
`,G+=`<th class="${n.CLASS_EMPTY}">EMPTY</th>
|
|
@@ -303,7 +303,7 @@ table.apg-attrs a:hover {
|
|
|
303
303
|
`,G+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
|
|
304
304
|
`,G+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
|
|
305
305
|
`;let le=!0;for(;le;){if(j===void 0){G+=Q();break}if(j===null){G+=Q();break}if(j==="ops"){G+=Q();break}if(j==="index"){v.sort(D),x.length>0&&x.sort(D),G+=Q(),G+=Y();break}if(j==="hits"){v.sort(R),x.length>0&&x.sort(D),G+=Q(),G+=Y();break}if(j==="alpha"){v.sort(O),x.length>0&&x.sort(O),G+=Q(),G+=Y();break}break}return G+=`</table>
|
|
306
|
-
`,G},"toHtml"),this.toHtmlPage=o(function(j,H,G){return r.htmlToPage(this.toHtml(j,H),G)},"toHtmlPage")},"statsFunc")});var
|
|
306
|
+
`,G},"toHtml"),this.toHtmlPage=o(function(j,H,G){return r.htmlToPage(this.toHtml(j,H),G)},"toHtmlPage")},"statsFunc")});var P4=De((KG,N4)=>{N4.exports=o(function(){let e=za(),r=Fu(),n=new(fb()),i=zi(),a="trace.js: ",c=this,u=16,m=10,v=8,x=32,S=80,O=5,R=[],D=5e3,P=-1,J=0,B=0,W=[],Q=null,Y=null,oe=null,j=[],H=[],G=`<span class="${r.CLASS_LINEEND}">•</span>`,le=`<span class="${r.CLASS_LINEEND}">…</span>`,T=`<span class="${r.CLASS_EMPTY}">𝜺</span>`,h=o(function(){let q=o(function(ee){j[i.ALT]=ee,j[i.CAT]=ee,j[i.REP]=ee,j[i.TLS]=ee,j[i.TBS]=ee,j[i.TRG]=ee,j[i.AND]=ee,j[i.NOT]=ee,j[i.BKR]=ee,j[i.BKA]=ee,j[i.BKN]=ee,j[i.ABG]=ee,j[i.AEN]=ee},"setOperators"),F=0;for(let ee in c.filter.operators)F+=1;if(F===0){q(!1);return}for(let ee in c.filter.operators){let ne=ee.toUpperCase();if(ne==="<ALL>"){q(!0);return}if(ne==="<NONE>"){q(!1);return}}q(!1);for(let ee in c.filter.operators){let ne=ee.toUpperCase();if(ne==="ALT")j[i.ALT]=c.filter.operators[ee]===!0;else if(ne==="CAT")j[i.CAT]=c.filter.operators[ee]===!0;else if(ne==="REP")j[i.REP]=c.filter.operators[ee]===!0;else if(ne==="AND")j[i.AND]=c.filter.operators[ee]===!0;else if(ne==="NOT")j[i.NOT]=c.filter.operators[ee]===!0;else if(ne==="TLS")j[i.TLS]=c.filter.operators[ee]===!0;else if(ne==="TBS")j[i.TBS]=c.filter.operators[ee]===!0;else if(ne==="TRG")j[i.TRG]=c.filter.operators[ee]===!0;else if(ne==="BKR")j[i.BKR]=c.filter.operators[ee]===!0;else if(ne==="BKA")j[i.BKA]=c.filter.operators[ee]===!0;else if(ne==="BKN")j[i.BKN]=c.filter.operators[ee]===!0;else if(ne==="ABG")j[i.ABG]=c.filter.operators[ee]===!0;else if(ne==="AEN")j[i.AEN]=c.filter.operators[ee]===!0;else throw new Error(`${a}initOpratorFilter: '${ee}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),y=o(function(){let q=o(function(ae){j[i.RNM]=ae,j[i.UDT]=ae;let Ae=Y.length+oe.length;H.length=0;for(let ge=0;ge<Ae;ge+=1)H.push(ae)},"setRules"),F,ee,ne=[];for(ee=0;ee<Y.length;ee+=1)ne.push(Y[ee].lower);for(ee=0;ee<oe.length;ee+=1)ne.push(oe[ee].lower);H.length=0,F=0;for(let ae in c.filter.rules)F+=1;if(F===0){q(!0);return}for(let ae in c.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){q(!0);return}if(Ae==="<none>"){q(!1);return}}q(!1),j[i.RNM]=!0,j[i.UDT]=!0;for(let ae in c.filter.rules){let Ae=ae.toLowerCase();if(ee=ne.indexOf(Ae),ee<0)throw new Error(`${a}initRuleFilter: '${ae}' not a valid rule or udt name`);H[ee]=c.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(q,F){if(P=-1,typeof q=="number"&&q>0)D=Math.ceil(q);else{D=0;return}typeof F=="number"&&(P=Math.floor(F),P<0&&(P=-1))},this.getMaxRecords=function(){return D},this.getLastRecord=function(){return P},this.init=function(q,F,ee){R.length=0,W.length=0,J=0,B=0,Q=ee,Y=q,oe=F,h(),y(),n.init(D)};let b=o(function(q){let F=!1;return q.type===i.RNM?j[q.type]&&H[q.index]?F=!0:F=!1:q.type===i.UDT?j[q.type]&&H[Y.length+q.index]?F=!0:F=!1:F=j[q.type],F},"filterOps"),l=o(function(q){return P===-1||q<=P},"filterRecords");this.down=function(q,F,ee,ne,ae,Ae){l(J)&&b(q)&&(W.push(J),R[n.increment()]={dirUp:!1,depth:B,thisLine:J,thatLine:void 0,opcode:q,state:F,phraseIndex:ee,phraseLength:ne,lookAnchor:ae,lookAround:Ae},J+=1,B+=1)},this.up=function(q,F,ee,ne,ae,Ae){if(l(J)&&b(q)){let ge=J,re=W.pop(),Se=n.getListIndex(re);Se!==-1&&(R[Se].thatLine=ge),B-=1,R[n.increment()]={dirUp:!0,depth:B,thisLine:ge,thatLine:re,opcode:q,state:F,phraseIndex:ee,phraseLength:ne,lookAnchor:ae,lookAround:Ae},J+=1}};let p=o(function(){function q($,X){let me,ye,we;if(X)switch($.op={id:X.type,name:e.opcodeToString(X.type)},$.opData=void 0,X.type){case i.RNM:$.opData=Y[X.index].name;break;case i.UDT:$.opData=oe[X.index].name;break;case i.BKR:X.index<Y.length?me=Y[X.index].name:me=oe[X.index-Y.length].name,ye=X.bkrCase===i.BKR_MODE_CI?"%i":"%s",we=X.bkrMode===i.BKR_MODE_UM?"%u":"%p",$.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:$.opData=[];for(let ke=0;ke<X.string.length;ke+=1)$.opData.push(X.string[ke]);break;case i.TBS:$.opData=[];for(let ke=0;ke<X.string.length;ke+=1)$.opData.push(X.string[ke]);break;case i.TRG:$.opData=[X.min,X.max];break;case i.REP:$.opData=[X.min,X.max];break;default:throw new Error("unrecognized opcode")}else $.op={id:void 0,name:void 0},$.opData=void 0}o(q,"nodeOpcode");function F($,X,me){return $===i.MATCH?{index:X,length:me}:$===i.NOMATCH?{index:X,length:0}:$===i.EMPTY?{index:X,length:0}:null}o(F,"nodePhrase");let ee=-1;function ne($,X,me){let ye={id:ee++,branch:-1,parent:$,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=F(),q(ye,void 0)),ye}o(ne,"nodeDown");function ae($,X){X&&($.up=!0,$.state={id:X.state,name:e.stateToString(X.state)},$.phrase=F(X.state,X.phraseIndex,X.phraseLength),$.down||q($,X.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,re=1;function Se($){if(ge+=1,$.branch=re,ge>B&&(B=ge),$.children.length===0)Ae+=1;else for(let X=0;X<$.children.length;X+=1)X>0&&(re+=1),$.children[X].leftMost=!1,$.children[X].rightMost=!1,$.leftMost&&($.children[X].leftMost=X===0),$.rightMost&&($.children[X].rightMost=X===$.children.length-1),Se($.children[X]);ge-=1}o(Se,"walk");function ce($,X){let me,ye={};if(ye.id=$.id,ye.branch=$.branch,ye.leftMost=$.leftMost,ye.rightMost=$.rightMost,me=$.state.name?$.state.name:"ACTIVE",ye.state={id:$.state.id,name:me},me=$.op.name?$.op.name:"?",ye.op={id:$.op.id,name:me},typeof $.opData=="string")ye.opData=$.opData;else if(Array.isArray($.opData)){ye.opData=[];for(let we=0;we<$.opData.length;we+=1)ye.opData[we]=$.opData[we]}else ye.opData=void 0;$.phrase?ye.phrase={index:$.phrase.index,length:$.phrase.length}:ye.phrase=null,ye.depth=$.depth,ye.children=[];for(let we=0;we<$.children.length;we+=1){let ke=we!==$.children.length-1;ye.children[we]=ce($.children[we],X,ke)}return ye}o(ce,"display");let ve=[],V,pe,Ce,He,Re=!0,Ve=ne(null,null,-1);for(ve.push(Ve),pe=Ve,n.forEach($=>{if(He=R[$],Re&&(Re=!1,He.depth>0)){let X=He.dirUp?He.depth+1:He.depth;for(let me=0;me<X;me+=1)Ce=pe,pe=ne(pe,null,me),ve.push(pe),Ce.children.push(pe)}He.dirUp?(pe=ve.pop(),ae(pe,He),pe=ve[ve.length-1]):(Ce=pe,pe=ne(pe,He,He.depth),ve.push(pe),Ce.children.push(pe))});ve.length>1;)pe=ve.pop(),ae(pe,null);if(Ve.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?");V=Ve.children[0];let pr=V;for(;V&&!V.down&&!V.up;)pr=V,V=V.children[0];V=pr,V.leftMost=!0,V.rightMost=!0,Se(V),V.branch=0;let ue={};ue.string=[];for(let $=0;$<Q.length;$+=1)ue.string[$]=Q[$];ue.rules=[];for(let $=0;$<Y.length;$+=1)ue.rules[$]=Y[$].name;ue.udts=[];for(let $=0;$<oe.length;$+=1)ue.udts[$]=oe[$].name;ue.id={},ue.id.ALT={id:i.ALT,name:"ALT"},ue.id.CAT={id:i.CAT,name:"CAT"},ue.id.REP={id:i.REP,name:"REP"},ue.id.RNM={id:i.RNM,name:"RNM"},ue.id.TLS={id:i.TLS,name:"TLS"},ue.id.TBS={id:i.TBS,name:"TBS"},ue.id.TRG={id:i.TRG,name:"TRG"},ue.id.UDT={id:i.UDT,name:"UDT"},ue.id.AND={id:i.AND,name:"AND"},ue.id.NOT={id:i.NOT,name:"NOT"},ue.id.BKR={id:i.BKR,name:"BKR"},ue.id.BKA={id:i.BKA,name:"BKA"},ue.id.BKN={id:i.BKN,name:"BKN"},ue.id.ABG={id:i.ABG,name:"ABG"},ue.id.AEN={id:i.AEN,name:"AEN"},ue.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},ue.id.MATCH={id:i.MATCH,name:"MATCH"},ue.id.EMPTY={id:i.EMPTY,name:"EMPTY"},ue.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},ue.treeDepth=B,ue.leafNodes=Ae;let ie;return V.down?V.up?ie="none":ie="right":V.up?ie="left":ie="both",ue.branchesIncomplete=ie,ue.tree=ce(V,V.depth,!1),ue},"toTreeObj");this.toTree=function(q){let F=p();return q?JSON.stringify(F):F},this.toHtmlPage=function(q,F,ee){return e.htmlToPage(this.toHtml(q,F),ee)};let _=o(function(q,F){let ee;switch(q){case u:ee="hexadecimal";break;case m:ee="decimal";break;case v:ee="ASCII";break;case x:ee="UNICODE";break;default:throw new Error(`${a}htmlHeader: unrecognized mode: ${q}`)}let ne="";return ne+=`<p>display mode: ${ee}</p>
|
|
307
307
|
`,ne+=`<table class="${r.CLASS_TRACE}">
|
|
308
308
|
`,typeof F=="string"&&(ne+=`<caption>${F}</caption>`),ne},"htmlHeader"),A=o(function(){let q="";return q+=`</table>
|
|
309
309
|
`,q+=`<p class="${r.CLASS_MONOSPACE}">legend:<br>
|
|
@@ -352,7 +352,7 @@ table.apg-attrs a:hover {
|
|
|
352
352
|
`,n.forEach(Se=>{let ce=R[Se];switch(ee=ce.thisLine,ne=ce.thatLine!==void 0?ce.thatLine:"--",ae=!1,Ae=!1,ge=!1,ce.lookAround===i.LOOKAROUND_AHEAD&&(ae=!0,ge=!0,re=ce.lookAnchor),(ce.opcode.type===i.AND||ce.opcode.type===i.NOT)&&(ae=!0,ge=!0,re=ce.phraseIndex),ce.lookAround===i.LOOKAROUND_BEHIND&&(Ae=!0,ge=!0,re=ce.lookAnchor),(ce.opcode.type===i.BKA||ce.opcode.type===i.BKN)&&(Ae=!0,ge=!0,re=ce.phraseIndex),F+="<tr>",F+=`<td>${ee}</td><td>${ne}</td>`,F+=`<td>${ce.phraseIndex}</td>`,F+=`<td>${ce.phraseLength}</td>`,F+=`<td>${ce.depth}</td>`,F+="<td>",ce.state){case i.ACTIVE:F+=`<span class="${r.CLASS_ACTIVE}">↓ </span>`;break;case i.MATCH:F+=`<span class="${r.CLASS_MATCH}">↑M</span>`;break;case i.NOMATCH:F+=`<span class="${r.CLASS_NOMATCH}">↑N</span>`;break;case i.EMPTY:F+=`<span class="${r.CLASS_EMPTY}">↑E</span>`;break;default:F+=`<span class="${r.CLASS_ACTIVE}">--</span>`;break}if(F+="</td>",F+="<td>",F+=c.indent(ce.depth),ae?F+=`<span class="${r.CLASS_LOOKAHEAD}">`:Ae&&(F+=`<span class="${r.CLASS_LOOKBEHIND}">`),F+=e.opcodeToString(ce.opcode.type),ce.opcode.type===i.RNM&&(F+=`(${Y[ce.opcode.index].name}) `),ce.opcode.type===i.BKR){let ve=ce.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",V=ce.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";F+=`(\\${ve}${V}${Y[ce.opcode.index].name}) `}ce.opcode.type===i.UDT&&(F+=`(${oe[ce.opcode.index].name}) `),ce.opcode.type===i.TRG&&(F+=`(${E(q,ce.opcode)}) `),ce.opcode.type===i.TBS&&(F+=`(${C(q,ce.opcode)}) `),ce.opcode.type===i.TLS&&(F+=`(${N(q,ce.opcode)}) `),ce.opcode.type===i.REP&&(F+=`(${g(q,ce.opcode)}) `),ge&&(F+="</span>"),F+="</td>",F+="<td>",Ae?F+=k(q,Q,ce.state,ce.phraseIndex,ce.phraseLength,re):ae?F+=I(q,Q,ce.state,ce.phraseIndex,ce.phraseLength):F+=Z(q,Q,ce.state,ce.phraseIndex,ce.phraseLength),F+=`</td></tr>
|
|
353
353
|
`}),F+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",F+=`<th>operator</th><th>phrase</th></tr>
|
|
354
354
|
`,F+=`</table>
|
|
355
|
-
`,F},"htmlTable");this.toHtml=function(q,F){let ee=v;if(typeof q=="string"&&q.length>=3){let ae=q.toLowerCase().slice(0,3);ae==="hex"?ee=u:ae==="dec"?ee=m:ae==="uni"&&(ee=x)}let ne="";return ne+=_(ee,F),ne+=se(ee),ne+=A(),ne}},"exportTrace")});var Ka=De((
|
|
355
|
+
`,F},"htmlTable");this.toHtml=function(q,F){let ee=v;if(typeof q=="string"&&q.length>=3){let ae=q.toLowerCase().slice(0,3);ae==="hex"?ee=u:ae==="dec"?ee=m:ae==="uni"&&(ee=x)}let ne="";return ne+=_(ee,F),ne+=se(ee),ne+=A(),ne}},"exportTrace")});var Ka=De((jG,L4)=>{L4.exports={ast:C4(),circular:fb(),ids:zi(),parser:D4(),stats:R4(),trace:P4(),utils:za(),emitcss:sb(),style:Fu()}});var U4=De((GG,B4)=>{B4.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 r="";return r+=`file = *line [last-line]
|
|
356
356
|
`,r+=`line = line-text end
|
|
357
357
|
`,r+=`line-text = *(valid/invalid)
|
|
358
358
|
`,r+=`last-line = 1*(valid/invalid)
|
|
@@ -362,7 +362,7 @@ table.apg-attrs a:hover {
|
|
|
362
362
|
`,r+=`CRLF = %d13.10
|
|
363
363
|
`,r+=`LF = %d10
|
|
364
364
|
`,r+=`CR = %d13
|
|
365
|
-
`,r},"toString")},"grammar")});var U4=De(B4=>{var Jr=zi(),QP=za();function eL(t,e,r,n,i){return t===Jr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:r,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),Jr.SEM_OK}o(eL,"semLine");function tL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.textLength=n),Jr.SEM_OK}o(tL,"semLineText");function rL(t,e,r,n,i){return t===Jr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:r,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:r+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:r,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),Jr.SEM_OK}o(rL,"semLastLine");function nL(t,e,r,n,i){return t===Jr.SEM_PRE&&i.errors.push({line:i.lineNo,char:r,msg:`invalid character found '\\x${QP.charToHex(e[r])}'`}),Jr.SEM_OK}o(nL,"semInvalid");function iL(t,e,r,n,i){return t===Jr.SEM_POST&&(i.lineNo+=1),Jr.SEM_OK}o(iL,"semEnd");function oL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:r,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),Jr.SEM_OK}o(oL,"semLF");function sL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:r,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),Jr.SEM_OK}o(sL,"semCR");function aL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CRLF"),Jr.SEM_OK}o(aL,"semCRLF");var ts=[];ts.line=eL;ts["line-text"]=tL;ts["last-line"]=rL;ts.invalid=nL;ts.end=iL;ts.lf=oL;ts.cr=sL;ts.crlf=aL;B4.callbacks=ts});var F4=De((jG,$4)=>{$4.exports=o(function(e,r,n,i){let a="scanner.js: ",c=Ka(),u=new(L4()),{callbacks:m}=U4(),v=[],x=new c.parser;if(x.ast=new c.ast,x.ast.callbacks=m,i){if(i.traceObject!=="traceObject")throw new TypeError(`${a}trace argument is not a trace object`);x.trace=i}if(x.parse(u,"file",e).success!==!0){r.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:v,lineNo:0,errors:r,strict:!!n};return x.ast.translate(O),v},"exfn")});var H4=De((GG,q4)=>{q4.exports=o(function(){let e="syntax-callbacks.js: ",r=Ka(),n=r.ids,i,a=o(function(N,w,k,he){switch(N.state){case n.ACTIVE:he.altStack=[],he.repCount=0;break;case n.EMPTY:he.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:he.ruleCount===0&&he.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"),c=o(function(C,N,w,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,w,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,w,k.charsLength),char:w,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),m=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),v=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),x=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),S=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),O=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),D=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),P=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),J=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let he=r.utils.charsToString(N,w,C.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${he}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),L=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let he=r.utils.charsToString(N,w,C.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`UDT operator found(${he}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),W=o(function(C,N,w){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),Q=o(function(C,N,w,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"),Y=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),oe=o(function(C,N,w,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"),j=o(function(C,N,w){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),H=o(function(C,N,w,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"),G=o(function(C,N,w,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"),le=o(function(C,N,w){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),T=o(function(C,N,w,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,w,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"),y=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:w,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"),b=o(function(C,N,w,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,w,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:w,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),p=o(function(C,N,w,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"),_=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),A=o(function(C,N,w,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 he=N[w]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Line end '${he}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),E=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),g=o(function(C,N,w,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=x,this.callbacks.basicelementerr=_,this.callbacks.clsclose=G,this.callbacks.clsopen=j,this.callbacks.clsstring=H,this.callbacks.definedaserror=v,this.callbacks.file=a,this.callbacks.groupclose=b,this.callbacks.groupopen=y,this.callbacks.lineenderror=E,this.callbacks.lineend=A,this.callbacks.notop=S,this.callbacks.optionclose=p,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=le,this.callbacks.prosvalstring=T,this.callbacks.repetition=g,this.callbacks.rule=c,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=m,this.callbacks.stringtab=Y,this.callbacks.tlsclose=oe,this.callbacks.tlsopen=W,this.callbacks.tlsstring=Q,this.callbacks.udtop=L,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=J,this.callbacks.abgop=D,this.callbacks.aenop=P},"exfn")});var K4=De((VG,z4)=>{z4.exports=o(function(){let e=Ka(),r=e.ids,n=o(function(){this.names=[],this.add=o(function(ce){let ve=-1;return this.get(ce)===-1&&(ve={name:ce,lower:ce.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ce){let ve=-1,V=ce.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===V){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Se,ce,ve){let V=0;for(let pe=ce;pe<ce+ve;pe+=1)V=10*V+Se[pe]-48;return V},"decnum"),a=o(function(Se,ce,ve){let V=0;for(let pe=ce;pe<ce+ve;pe+=1)V=2*V+Se[pe]-48;return V},"binnum"),c=o(function(Se,ce,ve){let V=0;for(let pe=ce;pe<ce+ve;pe+=1){let Ce=Se[pe];if(Ce>=48&&Ce<=57)Ce-=48;else if(Ce>=65&&Ce<=70)Ce-=55;else if(Ce>=97&&Ce<=102)Ce-=87;else throw new Error("hexnum out of range");V=16*V+Ce}return V},"hexnum");function u(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_PRE)V.ruleNames=new n,V.udtNames=new n,V.rules=[],V.udts=[],V.rulesLineMap=[],V.opcodes=[],V.altStack=[],V.topStack=null,V.topRule=null;else if(re===r.SEM_POST){let Ce;V.rules.forEach(He=>{He.isBkr=!1,He.opcodes.forEach(Re=>{Re.type===r.RNM&&(Ce=V.ruleNames.get(Re.index.name),Ce===-1?(V.errors.push({line:V.findLine(V.lines,Re.index.phraseIndex,V.charsLength),char:Re.index.phraseIndex,msg:`Rule name '${Re.index.name}' used but not defined.`}),Re.index=-1):Re.index=Ce.index)})}),V.udts.forEach(He=>{He.isBkr=!1}),V.rules.forEach(He=>{He.opcodes.forEach(Re=>{Re.type===r.BKR&&(He.hasBkr=!0,Ce=V.ruleNames.get(Re.index.name),Ce!==-1?(V.rules[Ce.index].isBkr=!0,Re.index=Ce.index):(Ce=V.udtNames.get(Re.index.name),Ce!==-1?(V.udts[Ce.index].isBkr=!0,Re.index=V.rules.length+Ce.index):(V.errors.push({line:V.findLine(V.lines,Re.index.phraseIndex,V.charsLength),char:Re.index.phraseIndex,msg:`Back reference name '${Re.index.name}' refers to undefined rule or unamed UDT.`}),Re.index=-1)))})})}return pe}o(u,"semFile");function m(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&(V.altStack.length=0,V.topStack=null,V.rulesLineMap.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce})),pe}o(m,"semRule");function v(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_PRE)V.ruleName="",V.definedas="";else if(re===r.SEM_POST){let Ce;V.definedas==="="?(Ce=V.ruleNames.add(V.ruleName),Ce===-1?(V.definedas=null,V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`Rule name '${V.ruleName}' previously defined.`})):(V.topRule={name:Ce.name,lower:Ce.lower,opcodes:[],index:Ce.index},V.rules.push(V.topRule),V.opcodes=V.topRule.opcodes)):(Ce=V.ruleNames.get(V.ruleName),Ce===-1?(V.definedas=null,V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`Rule name '${V.ruleName}' for incremental alternate not previously defined.`})):(V.topRule=V.rules[Ce.index],V.opcodes=V.topRule.opcodes))}return pe}o(v,"semRuleLookup");function x(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_PRE)for(;;){if(V.definedas===null){pe=r.SEM_SKIP;break}if(V.topStack===null){if(V.definedas==="="){V.topStack={alt:{type:r.ALT,children:[]},cat:null},V.altStack.push(V.topStack),V.opcodes.push(V.topStack.alt);break}V.topStack={alt:V.opcodes[0],cat:null},V.altStack.push(V.topStack);break}V.topStack={alt:{type:r.ALT,children:[]},cat:null},V.altStack.push(V.topStack),V.opcodes.push(V.topStack.alt);break}else re===r.SEM_POST&&(V.altStack.pop(),V.altStack.length>0?V.topStack=V.altStack[V.altStack.length-1]:V.topStack=null);return pe}o(x,"semAlternation");function S(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.topStack.alt.children.push(V.opcodes.length),V.topStack.cat={type:r.CAT,children:[]},V.opcodes.push(V.topStack.cat)):re===r.SEM_POST&&(V.topStack.cat=null),pe}o(S,"semConcatenation");function O(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&V.topStack.cat.children.push(V.opcodes.length),pe}o(O,"semRepetition");function R(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.REP,min:0,max:1,char:ce}),pe}o(R,"semOptionOpen");function D(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&(V.ruleName=e.utils.charsToString(Se,ce,ve)),pe}o(D,"semRuleName");function P(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.definedas="="),pe}o(P,"semDefined");function J(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.definedas="=/"),pe}o(J,"semIncAlt");function L(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.min=0,V.max=1/0,V.topRep={type:r.REP,min:0,max:1/0},V.opcodes.push(V.topRep)):re===r.SEM_POST&&(V.min>V.max&&V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`repetition min cannot be greater than max: min: ${V.min}: max: ${V.max}`}),V.topRep.min=V.min,V.topRep.max=V.max),pe}o(L,"semRepOp");function W(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=i(Se,ce,ve)),pe}o(W,"semRepMin");function Q(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=i(Se,ce,ve)),pe}o(Q,"semRepMax");function Y(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=i(Se,ce,ve),V.min=V.max),pe}o(Y,"semRepMinMax");function oe(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.AND}),pe}o(oe,"semAndOp");function j(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.NOT}),pe}o(j,"semNotOp");function H(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.RNM,index:{phraseIndex:ce,name:e.utils.charsToString(Se,ce,ve)}}),pe}o(H,"semRnmOp");function G(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.ABG}),pe}o(G,"semAbgOp");function le(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.AEN}),pe}o(le,"semAenOp");function T(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.BKA}),pe}o(T,"semBkaOp");function h(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.BKN}),pe}o(h,"semBknOp");function y(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.ci=!0,V.cs=!1,V.um=!0,V.pm=!1):re===r.SEM_POST&&V.opcodes.push({type:r.BKR,bkrCase:V.cs===!0?r.BKR_MODE_CS:r.BKR_MODE_CI,bkrMode:V.pm===!0?r.BKR_MODE_PM:r.BKR_MODE_UM,index:{phraseIndex:V.bkrname.phraseIndex,name:e.utils.charsToString(Se,V.bkrname.phraseIndex,V.bkrname.phraseLength)}}),pe}o(y,"semBkrOp");function b(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.ci=!0),pe}o(b,"semBkrCi");function l(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.cs=!0),pe}o(l,"semBkrCs");function p(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.um=!0),pe}o(p,"semBkrUm");function _(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.pm=!0),pe}o(_,"semBkrPm");function A(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.bkrname={phraseIndex:ce,phraseLength:ve}),pe}o(A,"semBkrName");function E(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=V.udtNames.add(Ce);if(He===-1){if(He=V.udtNames.get(Ce),He===-1)throw new Error("semUdtEmpty: name look up error")}else V.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!0});V.opcodes.push({type:r.UDT,empty:!0,index:He.index})}return pe}o(E,"semUdtEmpty");function g(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=V.udtNames.add(Ce);if(He===-1){if(He=V.udtNames.get(Ce),He===-1)throw new Error("semUdtNonEmpty: name look up error")}else V.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!1});V.opcodes.push({type:r.UDT,empty:!1,index:He.index,syntax:null,semantic:null})}return pe}o(g,"semUdtNonEmpty");function C(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&(V.tlscase=!0),pe}o(C,"semTlsOp");function N(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&ve>0&&(Se[ce+1]===83||Se[ce+1]===115)&&(V.tlscase=!1),pe}o(N,"semTlsCase");function w(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_POST)if(V.tlscase){let Ce=Se.slice(ce,ce+ve);for(let He=0;He<Ce.length;He+=1)Ce[He]>=65&&Ce[He]<=90&&(Ce[He]+=32);V.opcodes.push({type:r.TLS,string:Ce})}else V.opcodes.push({type:r.TBS,string:Se.slice(ce,ce+ve)});return pe}o(w,"semTlsString");function k(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(ve<=2?V.opcodes.push({type:r.TLS,string:[]}):V.opcodes.push({type:r.TBS,string:Se.slice(ce+1,ce+ve-1)})),pe}o(k,"semClsOp");function he(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?V.tbsstr=[]:re===r.SEM_POST&&V.opcodes.push({type:r.TBS,string:V.tbsstr}),pe}o(he,"semTbsOp");function I(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.min=0,V.max=0):re===r.SEM_POST&&(V.min>V.max&&V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${V.min}: max: ${V.max}`}),V.opcodes.push({type:r.TRG,min:V.min,max:V.max})),pe}o(I,"semTrgOp");function Z(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=i(Se,ce,ve)),pe}o(Z,"semDmin");function se(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=i(Se,ce,ve)),pe}o(se,"semDmax");function q(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=a(Se,ce,ve)),pe}o(q,"semBmin");function F(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=a(Se,ce,ve)),pe}o(F,"semBmax");function ee(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=c(Se,ce,ve)),pe}o(ee,"semXmin");function ne(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=c(Se,ce,ve)),pe}o(ne,"semXmax");function ae(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.tbsstr.push(i(Se,ce,ve)),pe}o(ae,"semDstring");function Ae(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.tbsstr.push(a(Se,ce,ve)),pe}o(Ae,"semBstring");function ge(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.tbsstr.push(c(Se,ce,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=G,this.callbacks.aenop=le,this.callbacks.alternation=x,this.callbacks.andop=oe,this.callbacks.bmax=F,this.callbacks.bmin=q,this.callbacks.bkaop=T,this.callbacks.bknop=h,this.callbacks.bkrop=y,this.callbacks["bkr-name"]=A,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=b,this.callbacks.cs=l,this.callbacks.um=p,this.callbacks.pm=_,this.callbacks.concatenation=S,this.callbacks.defined=P,this.callbacks.dmax=se,this.callbacks.dmin=Z,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=J,this.callbacks.notop=j,this.callbacks.optionopen=R,this.callbacks["rep-max"]=Q,this.callbacks["rep-min"]=W,this.callbacks["rep-min-max"]=Y,this.callbacks.repetition=O,this.callbacks.repop=L,this.callbacks.rnmop=H,this.callbacks.rule=m,this.callbacks.rulelookup=v,this.callbacks.rulename=D,this.callbacks.tbsop=he,this.callbacks.tlscase=N,this.callbacks.tlsstring=w,this.callbacks.tlsop=C,this.callbacks.trgop=I,this.callbacks["udt-empty"]=E,this.callbacks["udt-non-empty"]=g,this.callbacks.xmax=ne,this.callbacks.xmin=ee,this.callbacks.xstring=ge},"exfn")});var G4=De((WG,j4)=>{j4.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 r="";return r+=`;
|
|
365
|
+
`,r},"toString")},"grammar")});var F4=De($4=>{var Jr=zi(),nL=za();function iL(t,e,r,n,i){return t===Jr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:r,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),Jr.SEM_OK}o(iL,"semLine");function oL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.textLength=n),Jr.SEM_OK}o(oL,"semLineText");function sL(t,e,r,n,i){return t===Jr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:r,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:r+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:r,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),Jr.SEM_OK}o(sL,"semLastLine");function aL(t,e,r,n,i){return t===Jr.SEM_PRE&&i.errors.push({line:i.lineNo,char:r,msg:`invalid character found '\\x${nL.charToHex(e[r])}'`}),Jr.SEM_OK}o(aL,"semInvalid");function fL(t,e,r,n,i){return t===Jr.SEM_POST&&(i.lineNo+=1),Jr.SEM_OK}o(fL,"semEnd");function cL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:r,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),Jr.SEM_OK}o(cL,"semLF");function uL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:r,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),Jr.SEM_OK}o(uL,"semCR");function lL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CRLF"),Jr.SEM_OK}o(lL,"semCRLF");var rs=[];rs.line=iL;rs["line-text"]=oL;rs["last-line"]=sL;rs.invalid=aL;rs.end=fL;rs.lf=cL;rs.cr=uL;rs.crlf=lL;$4.callbacks=rs});var H4=De((WG,q4)=>{q4.exports=o(function(e,r,n,i){let a="scanner.js: ",c=Ka(),u=new(U4()),{callbacks:m}=F4(),v=[],x=new c.parser;if(x.ast=new c.ast,x.ast.callbacks=m,i){if(i.traceObject!=="traceObject")throw new TypeError(`${a}trace argument is not a trace object`);x.trace=i}if(x.parse(u,"file",e).success!==!0){r.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let O={lines:v,lineNo:0,errors:r,strict:!!n};return x.ast.translate(O),v},"exfn")});var K4=De((JG,z4)=>{z4.exports=o(function(){let e="syntax-callbacks.js: ",r=Ka(),n=r.ids,i,a=o(function(N,w,k,he){switch(N.state){case n.ACTIVE:he.altStack=[],he.repCount=0;break;case n.EMPTY:he.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:he.ruleCount===0&&he.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"),c=o(function(C,N,w,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,w,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,w,k.charsLength),char:w,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),m=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),v=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),x=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),S=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),O=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),R=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),D=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),P=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),J=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let he=r.utils.charsToString(N,w,C.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Back reference operator(${he}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),B=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(k.strict){let he=r.utils.charsToString(N,w,C.phraseLength);k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`UDT operator found(${he}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),W=o(function(C,N,w){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),Q=o(function(C,N,w,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"),Y=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:k.stringTabChar=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),oe=o(function(C,N,w,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"),j=o(function(C,N,w){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),H=o(function(C,N,w,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"),G=o(function(C,N,w,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"),le=o(function(C,N,w){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=w;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),T=o(function(C,N,w,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,w,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"),y=o(function(C,N,w,k){switch(C.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:w,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"),b=o(function(C,N,w,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,w,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:w,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},k.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),p=o(function(C,N,w,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"),_=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),A=o(function(C,N,w,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 he=N[w]===13?"CR":"LF";k.errors.push({line:k.findLine(k.lines,w,k.charsLength),char:w,msg:`Line end '${he}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),E=o(function(C,N,w,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,w,k.charsLength),char:w,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),g=o(function(C,N,w,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=x,this.callbacks.basicelementerr=_,this.callbacks.clsclose=G,this.callbacks.clsopen=j,this.callbacks.clsstring=H,this.callbacks.definedaserror=v,this.callbacks.file=a,this.callbacks.groupclose=b,this.callbacks.groupopen=y,this.callbacks.lineenderror=E,this.callbacks.lineend=A,this.callbacks.notop=S,this.callbacks.optionclose=p,this.callbacks.optionopen=l,this.callbacks.prosvalclose=h,this.callbacks.prosvalopen=le,this.callbacks.prosvalstring=T,this.callbacks.repetition=g,this.callbacks.rule=c,this.callbacks.ruleerror=u,this.callbacks.rulenameerror=m,this.callbacks.stringtab=Y,this.callbacks.tlsclose=oe,this.callbacks.tlsopen=W,this.callbacks.tlsstring=Q,this.callbacks.udtop=B,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=J,this.callbacks.abgop=D,this.callbacks.aenop=P},"exfn")});var G4=De((YG,j4)=>{j4.exports=o(function(){let e=Ka(),r=e.ids,n=o(function(){this.names=[],this.add=o(function(ce){let ve=-1;return this.get(ce)===-1&&(ve={name:ce,lower:ce.toLowerCase(),index:this.names.length},this.names.push(ve)),ve},"add"),this.get=o(function(ce){let ve=-1,V=ce.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===V){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Se,ce,ve){let V=0;for(let pe=ce;pe<ce+ve;pe+=1)V=10*V+Se[pe]-48;return V},"decnum"),a=o(function(Se,ce,ve){let V=0;for(let pe=ce;pe<ce+ve;pe+=1)V=2*V+Se[pe]-48;return V},"binnum"),c=o(function(Se,ce,ve){let V=0;for(let pe=ce;pe<ce+ve;pe+=1){let Ce=Se[pe];if(Ce>=48&&Ce<=57)Ce-=48;else if(Ce>=65&&Ce<=70)Ce-=55;else if(Ce>=97&&Ce<=102)Ce-=87;else throw new Error("hexnum out of range");V=16*V+Ce}return V},"hexnum");function u(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_PRE)V.ruleNames=new n,V.udtNames=new n,V.rules=[],V.udts=[],V.rulesLineMap=[],V.opcodes=[],V.altStack=[],V.topStack=null,V.topRule=null;else if(re===r.SEM_POST){let Ce;V.rules.forEach(He=>{He.isBkr=!1,He.opcodes.forEach(Re=>{Re.type===r.RNM&&(Ce=V.ruleNames.get(Re.index.name),Ce===-1?(V.errors.push({line:V.findLine(V.lines,Re.index.phraseIndex,V.charsLength),char:Re.index.phraseIndex,msg:`Rule name '${Re.index.name}' used but not defined.`}),Re.index=-1):Re.index=Ce.index)})}),V.udts.forEach(He=>{He.isBkr=!1}),V.rules.forEach(He=>{He.opcodes.forEach(Re=>{Re.type===r.BKR&&(He.hasBkr=!0,Ce=V.ruleNames.get(Re.index.name),Ce!==-1?(V.rules[Ce.index].isBkr=!0,Re.index=Ce.index):(Ce=V.udtNames.get(Re.index.name),Ce!==-1?(V.udts[Ce.index].isBkr=!0,Re.index=V.rules.length+Ce.index):(V.errors.push({line:V.findLine(V.lines,Re.index.phraseIndex,V.charsLength),char:Re.index.phraseIndex,msg:`Back reference name '${Re.index.name}' refers to undefined rule or unamed UDT.`}),Re.index=-1)))})})}return pe}o(u,"semFile");function m(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&(V.altStack.length=0,V.topStack=null,V.rulesLineMap.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce})),pe}o(m,"semRule");function v(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_PRE)V.ruleName="",V.definedas="";else if(re===r.SEM_POST){let Ce;V.definedas==="="?(Ce=V.ruleNames.add(V.ruleName),Ce===-1?(V.definedas=null,V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`Rule name '${V.ruleName}' previously defined.`})):(V.topRule={name:Ce.name,lower:Ce.lower,opcodes:[],index:Ce.index},V.rules.push(V.topRule),V.opcodes=V.topRule.opcodes)):(Ce=V.ruleNames.get(V.ruleName),Ce===-1?(V.definedas=null,V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`Rule name '${V.ruleName}' for incremental alternate not previously defined.`})):(V.topRule=V.rules[Ce.index],V.opcodes=V.topRule.opcodes))}return pe}o(v,"semRuleLookup");function x(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_PRE)for(;;){if(V.definedas===null){pe=r.SEM_SKIP;break}if(V.topStack===null){if(V.definedas==="="){V.topStack={alt:{type:r.ALT,children:[]},cat:null},V.altStack.push(V.topStack),V.opcodes.push(V.topStack.alt);break}V.topStack={alt:V.opcodes[0],cat:null},V.altStack.push(V.topStack);break}V.topStack={alt:{type:r.ALT,children:[]},cat:null},V.altStack.push(V.topStack),V.opcodes.push(V.topStack.alt);break}else re===r.SEM_POST&&(V.altStack.pop(),V.altStack.length>0?V.topStack=V.altStack[V.altStack.length-1]:V.topStack=null);return pe}o(x,"semAlternation");function S(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.topStack.alt.children.push(V.opcodes.length),V.topStack.cat={type:r.CAT,children:[]},V.opcodes.push(V.topStack.cat)):re===r.SEM_POST&&(V.topStack.cat=null),pe}o(S,"semConcatenation");function O(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&V.topStack.cat.children.push(V.opcodes.length),pe}o(O,"semRepetition");function R(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.REP,min:0,max:1,char:ce}),pe}o(R,"semOptionOpen");function D(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&(V.ruleName=e.utils.charsToString(Se,ce,ve)),pe}o(D,"semRuleName");function P(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.definedas="="),pe}o(P,"semDefined");function J(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.definedas="=/"),pe}o(J,"semIncAlt");function B(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.min=0,V.max=1/0,V.topRep={type:r.REP,min:0,max:1/0},V.opcodes.push(V.topRep)):re===r.SEM_POST&&(V.min>V.max&&V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`repetition min cannot be greater than max: min: ${V.min}: max: ${V.max}`}),V.topRep.min=V.min,V.topRep.max=V.max),pe}o(B,"semRepOp");function W(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=i(Se,ce,ve)),pe}o(W,"semRepMin");function Q(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=i(Se,ce,ve)),pe}o(Q,"semRepMax");function Y(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=i(Se,ce,ve),V.min=V.max),pe}o(Y,"semRepMinMax");function oe(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.AND}),pe}o(oe,"semAndOp");function j(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.NOT}),pe}o(j,"semNotOp");function H(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.RNM,index:{phraseIndex:ce,name:e.utils.charsToString(Se,ce,ve)}}),pe}o(H,"semRnmOp");function G(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.ABG}),pe}o(G,"semAbgOp");function le(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.AEN}),pe}o(le,"semAenOp");function T(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.BKA}),pe}o(T,"semBkaOp");function h(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.opcodes.push({type:r.BKN}),pe}o(h,"semBknOp");function y(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.ci=!0,V.cs=!1,V.um=!0,V.pm=!1):re===r.SEM_POST&&V.opcodes.push({type:r.BKR,bkrCase:V.cs===!0?r.BKR_MODE_CS:r.BKR_MODE_CI,bkrMode:V.pm===!0?r.BKR_MODE_PM:r.BKR_MODE_UM,index:{phraseIndex:V.bkrname.phraseIndex,name:e.utils.charsToString(Se,V.bkrname.phraseIndex,V.bkrname.phraseLength)}}),pe}o(y,"semBkrOp");function b(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.ci=!0),pe}o(b,"semBkrCi");function l(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.cs=!0),pe}o(l,"semBkrCs");function p(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.um=!0),pe}o(p,"semBkrUm");function _(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.pm=!0),pe}o(_,"semBkrPm");function A(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.bkrname={phraseIndex:ce,phraseLength:ve}),pe}o(A,"semBkrName");function E(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=V.udtNames.add(Ce);if(He===-1){if(He=V.udtNames.get(Ce),He===-1)throw new Error("semUdtEmpty: name look up error")}else V.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!0});V.opcodes.push({type:r.UDT,empty:!0,index:He.index})}return pe}o(E,"semUdtEmpty");function g(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=V.udtNames.add(Ce);if(He===-1){if(He=V.udtNames.get(Ce),He===-1)throw new Error("semUdtNonEmpty: name look up error")}else V.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!1});V.opcodes.push({type:r.UDT,empty:!1,index:He.index,syntax:null,semantic:null})}return pe}o(g,"semUdtNonEmpty");function C(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE&&(V.tlscase=!0),pe}o(C,"semTlsOp");function N(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&ve>0&&(Se[ce+1]===83||Se[ce+1]===115)&&(V.tlscase=!1),pe}o(N,"semTlsCase");function w(re,Se,ce,ve,V){let pe=r.SEM_OK;if(re===r.SEM_POST)if(V.tlscase){let Ce=Se.slice(ce,ce+ve);for(let He=0;He<Ce.length;He+=1)Ce[He]>=65&&Ce[He]<=90&&(Ce[He]+=32);V.opcodes.push({type:r.TLS,string:Ce})}else V.opcodes.push({type:r.TBS,string:Se.slice(ce,ce+ve)});return pe}o(w,"semTlsString");function k(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(ve<=2?V.opcodes.push({type:r.TLS,string:[]}):V.opcodes.push({type:r.TBS,string:Se.slice(ce+1,ce+ve-1)})),pe}o(k,"semClsOp");function he(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?V.tbsstr=[]:re===r.SEM_POST&&V.opcodes.push({type:r.TBS,string:V.tbsstr}),pe}o(he,"semTbsOp");function I(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_PRE?(V.min=0,V.max=0):re===r.SEM_POST&&(V.min>V.max&&V.errors.push({line:V.findLine(V.lines,ce,V.charsLength),char:ce,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${V.min}: max: ${V.max}`}),V.opcodes.push({type:r.TRG,min:V.min,max:V.max})),pe}o(I,"semTrgOp");function Z(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=i(Se,ce,ve)),pe}o(Z,"semDmin");function se(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=i(Se,ce,ve)),pe}o(se,"semDmax");function q(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=a(Se,ce,ve)),pe}o(q,"semBmin");function F(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=a(Se,ce,ve)),pe}o(F,"semBmax");function ee(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.min=c(Se,ce,ve)),pe}o(ee,"semXmin");function ne(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&(V.max=c(Se,ce,ve)),pe}o(ne,"semXmax");function ae(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.tbsstr.push(i(Se,ce,ve)),pe}o(ae,"semDstring");function Ae(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.tbsstr.push(a(Se,ce,ve)),pe}o(Ae,"semBstring");function ge(re,Se,ce,ve,V){let pe=r.SEM_OK;return re===r.SEM_POST&&V.tbsstr.push(c(Se,ce,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=G,this.callbacks.aenop=le,this.callbacks.alternation=x,this.callbacks.andop=oe,this.callbacks.bmax=F,this.callbacks.bmin=q,this.callbacks.bkaop=T,this.callbacks.bknop=h,this.callbacks.bkrop=y,this.callbacks["bkr-name"]=A,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=b,this.callbacks.cs=l,this.callbacks.um=p,this.callbacks.pm=_,this.callbacks.concatenation=S,this.callbacks.defined=P,this.callbacks.dmax=se,this.callbacks.dmin=Z,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=J,this.callbacks.notop=j,this.callbacks.optionopen=R,this.callbacks["rep-max"]=Q,this.callbacks["rep-min"]=W,this.callbacks["rep-min-max"]=Y,this.callbacks.repetition=O,this.callbacks.repop=B,this.callbacks.rnmop=H,this.callbacks.rule=m,this.callbacks.rulelookup=v,this.callbacks.rulename=D,this.callbacks.tbsop=he,this.callbacks.tlscase=N,this.callbacks.tlsstring=w,this.callbacks.tlsop=C,this.callbacks.trgop=I,this.callbacks["udt-empty"]=E,this.callbacks["udt-non-empty"]=g,this.callbacks.xmax=ne,this.callbacks.xmin=ee,this.callbacks.xstring=ge},"exfn")});var W4=De((XG,V4)=>{V4.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 r="";return r+=`;
|
|
366
366
|
`,r+=`; ABNF for JavaScript APG 2.0 SABNF
|
|
367
367
|
`,r+=`; RFC 5234 with some restrictions and additions.
|
|
368
368
|
`,r+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
|
|
@@ -533,85 +533,85 @@ table.apg-attrs a:hover {
|
|
|
533
533
|
`,r+=` / %d10
|
|
534
534
|
`,r+=` / %d13
|
|
535
535
|
`,r+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
|
|
536
|
-
`,r},"toString")},"grammar")});var
|
|
537
|
-
`,
|
|
538
|
-
`,
|
|
539
|
-
`,
|
|
540
|
-
`,
|
|
541
|
-
`,
|
|
542
|
-
`,
|
|
543
|
-
`,
|
|
544
|
-
`,
|
|
545
|
-
`,
|
|
546
|
-
`,
|
|
547
|
-
`,
|
|
548
|
-
`,
|
|
549
|
-
`,
|
|
550
|
-
`,
|
|
551
|
-
`,
|
|
552
|
-
`,
|
|
553
|
-
`,
|
|
554
|
-
`,
|
|
555
|
-
`,
|
|
556
|
-
`,
|
|
557
|
-
`,
|
|
558
|
-
`,
|
|
559
|
-
`,
|
|
560
|
-
`,
|
|
561
|
-
`,
|
|
562
|
-
`,
|
|
563
|
-
`,
|
|
564
|
-
`,
|
|
565
|
-
`,
|
|
566
|
-
`,
|
|
567
|
-
`,
|
|
536
|
+
`,r},"toString")},"grammar")});var Y4=De((ZG,J4)=>{J4.exports=o(function(){let e="parser: ",r=Ka(),n=r.ids,i=new(K4()),a=new(G4()),c=new(W4()),u=new r.parser;u.ast=new r.ast,u.callbacks=i.callbacks,u.ast.callbacks=a.callbacks;let m=o(function(O,R,D){if(R<0||R>=D)return-1;for(let P=0;P<O.length;P+=1)if(R>=O[P].beginChar&&R<O[P].beginChar+O[P].length)return P;return-1},"findLine"),v=o(function(O,R){let D=-1;if(R<O.length){for(let P=R;P<O.length;P+=1)if(O[P]!==null){D=O[P];break}}return D},"translateIndex"),x=o(function(O){O.forEach(R=>{let D=[],P=[],J=0;R.opcodes.forEach(B=>{B.type===n.ALT&&B.children.length===1||B.type===n.CAT&&B.children.length===1||B.type===n.REP&&B.min===1&&B.max===1?P.push(null):(P.push(J),D.push(B),J+=1)}),P.push(J),D.forEach(B=>{if(B.type===n.ALT||B.type===n.CAT)for(let W=0;W<B.children.length;W+=1)B.children[W]=v(P,B.children[W])}),R.opcodes=D})},"reduceOpcodes");this.syntax=o(function(O,R,D,P,J){if(J){if(J.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);u.trace=J}let B={};B.errors=D,B.strict=!!P,B.lines=R,B.findLine=m,B.charsLength=O.length,B.ruleCount=0,u.parse(c,"file",O,B).success||D.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(O,R,D){let P={};return P.errors=D,P.lines=R,P.findLine=m,P.charsLength=O.length,u.ast.translate(P),D.length?null:(x(P.rules),{rules:P.rules,udts:P.udts,lineMap:P.rulesLineMap})},"semantic"),this.generateSource=o(function(O,R,D,P,J){let B="",W,Q,Y,oe=0,j=1/0,H=0,G=[],le=[],T=0,h=0,y=0,b=0,l=0,p=0,_=0,A=0,E=0,g=0,C=0,N=0,w=0,k=0,he=0;D.forEach(se=>{G.push(se.lower),oe+=se.opcodes.length,se.opcodes.forEach(q=>{switch(q.type){case n.ALT:T+=1;break;case n.CAT:h+=1;break;case n.RNM:y+=1;break;case n.UDT:b+=1;break;case n.REP:l+=1;break;case n.AND:p+=1;break;case n.NOT:_+=1;break;case n.BKA:N+=1;break;case n.BKN:w+=1;break;case n.BKR:C+=1;break;case n.ABG:k+=1;break;case n.AEN:he+=1;break;case n.TLS:for(A+=1,W=0;W<q.string.length;W+=1)q.string[W]<j&&(j=q.string[W]),q.string[W]>H&&(H=q.string[W]);break;case n.TBS:for(E+=1,W=0;W<q.string.length;W+=1)q.string[W]<j&&(j=q.string[W]),q.string[W]>H&&(H=q.string[W]);break;case n.TRG:g+=1,q.min<j&&(j=q.min),q.max>H&&(H=q.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),G.sort(),P.length>0&&(P.forEach(se=>{le.push(se.lower)}),le.sort());let I="module.exports";J&&typeof J=="string"&&(I=`let ${J}`),B+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
|
|
537
|
+
`,B+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
|
|
538
|
+
`,B+=`//
|
|
539
|
+
`,B+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
|
|
540
|
+
`,B+=`${I} = function grammar(){
|
|
541
|
+
`,B+=" // ```\n",B+=` // SUMMARY
|
|
542
|
+
`,B+=` // rules = ${D.length}
|
|
543
|
+
`,B+=` // udts = ${P.length}
|
|
544
|
+
`,B+=` // opcodes = ${oe}
|
|
545
|
+
`,B+=` // --- ABNF original opcodes
|
|
546
|
+
`,B+=` // ALT = ${T}
|
|
547
|
+
`,B+=` // CAT = ${h}
|
|
548
|
+
`,B+=` // REP = ${l}
|
|
549
|
+
`,B+=` // RNM = ${y}
|
|
550
|
+
`,B+=` // TLS = ${A}
|
|
551
|
+
`,B+=` // TBS = ${E}
|
|
552
|
+
`,B+=` // TRG = ${g}
|
|
553
|
+
`,B+=` // --- SABNF superset opcodes
|
|
554
|
+
`,B+=` // UDT = ${b}
|
|
555
|
+
`,B+=` // AND = ${p}
|
|
556
|
+
`,B+=` // NOT = ${_}
|
|
557
|
+
`,B+=` // BKA = ${N}
|
|
558
|
+
`,B+=` // BKN = ${w}
|
|
559
|
+
`,B+=` // BKR = ${C}
|
|
560
|
+
`,B+=` // ABG = ${k}
|
|
561
|
+
`,B+=` // AEN = ${he}
|
|
562
|
+
`,B+=" // characters = [",A+E+g===0?B+=" none defined ]":B+=`${j} - ${H}]`,b>0&&(B+=" + user defined"),B+=`
|
|
563
|
+
`,B+=" // ```\n",B+=` /* OBJECT IDENTIFIER (for internal parser use) */
|
|
564
|
+
`,B+=` this.grammarObject = 'grammarObject';
|
|
565
|
+
`,B+=`
|
|
566
|
+
`,B+=` /* RULES */
|
|
567
|
+
`,B+=` this.rules = [];
|
|
568
568
|
`,D.forEach((se,q)=>{let F=" this.rules[";F+=q,F+="] = {name: '",F+=se.name,F+="', lower: '",F+=se.lower,F+="', index: ",F+=se.index,F+=", isBkr: ",F+=se.isBkr,F+=`};
|
|
569
|
-
`,
|
|
570
|
-
`,
|
|
571
|
-
`,
|
|
569
|
+
`,B+=F}),B+=`
|
|
570
|
+
`,B+=` /* UDTS */
|
|
571
|
+
`,B+=` this.udts = [];
|
|
572
572
|
`,P.length>0&&P.forEach((se,q)=>{let F=" this.udts[";F+=q,F+="] = {name: '",F+=se.name,F+="', lower: '",F+=se.lower,F+="', index: ",F+=se.index,F+=", empty: ",F+=se.empty,F+=", isBkr: ",F+=se.isBkr,F+=`};
|
|
573
|
-
`,
|
|
574
|
-
`,
|
|
575
|
-
`,D.forEach((se,q)=>{q>0&&(
|
|
576
|
-
`),
|
|
577
|
-
`,
|
|
578
|
-
`,se.opcodes.forEach((F,ee)=>{let ne;switch(F.type){case n.ALT:
|
|
579
|
-
`;break;case n.CAT:
|
|
580
|
-
`;break;case n.RNM:
|
|
581
|
-
`;break;case n.BKR:F.index>=D.length?(Q=P[F.index-D.length].name,Y=P[F.index-D.length].lower):(Q=D[F.index].name,Y=D[F.index].lower),ne="%i",F.bkrCase===n.BKR_MODE_CS&&(ne="%s"),F.bkrMode===n.BKR_MODE_UM?ne+="%u":ne+="%p",Q=ne+Q,
|
|
582
|
-
`;break;case n.UDT:
|
|
583
|
-
`;break;case n.REP:
|
|
584
|
-
`;break;case n.AND:
|
|
585
|
-
`;break;case n.NOT:
|
|
586
|
-
`;break;case n.ABG:
|
|
587
|
-
`;break;case n.AEN:
|
|
588
|
-
`;break;case n.BKA:
|
|
589
|
-
`;break;case n.BKN:
|
|
590
|
-
`;break;case n.TLS:
|
|
591
|
-
`;break;case n.TBS:
|
|
592
|
-
`;break;case n.TRG:
|
|
593
|
-
`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),
|
|
594
|
-
`,
|
|
595
|
-
`,
|
|
596
|
-
`;let Z;return R.forEach(se=>{let q=se.beginChar+se.length;Z="",
|
|
597
|
-
`}),
|
|
598
|
-
`,
|
|
599
|
-
`,
|
|
600
|
-
`,
|
|
573
|
+
`,B+=F}),B+=`
|
|
574
|
+
`,B+=` /* OPCODES */
|
|
575
|
+
`,D.forEach((se,q)=>{q>0&&(B+=`
|
|
576
|
+
`),B+=` /* ${se.name} */
|
|
577
|
+
`,B+=` this.rules[${q}].opcodes = [];
|
|
578
|
+
`,se.opcodes.forEach((F,ee)=>{let ne;switch(F.type){case n.ALT:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, children: [${F.children.toString()}]};// ALT
|
|
579
|
+
`;break;case n.CAT:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, children: [${F.children.toString()}]};// CAT
|
|
580
|
+
`;break;case n.RNM:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, index: ${F.index}};// RNM(${D[F.index].name})
|
|
581
|
+
`;break;case n.BKR:F.index>=D.length?(Q=P[F.index-D.length].name,Y=P[F.index-D.length].lower):(Q=D[F.index].name,Y=D[F.index].lower),ne="%i",F.bkrCase===n.BKR_MODE_CS&&(ne="%s"),F.bkrMode===n.BKR_MODE_UM?ne+="%u":ne+="%p",Q=ne+Q,B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, index: ${F.index}, lower: '${Y}', bkrCase: ${F.bkrCase}, bkrMode: ${F.bkrMode}};// BKR(\\${Q})
|
|
582
|
+
`;break;case n.UDT:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, empty: ${F.empty}, index: ${F.index}};// UDT(${P[F.index].name})
|
|
583
|
+
`;break;case n.REP:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, min: ${F.min}, max: ${F.max}};// REP
|
|
584
|
+
`;break;case n.AND:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}};// AND
|
|
585
|
+
`;break;case n.NOT:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}};// NOT
|
|
586
|
+
`;break;case n.ABG:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}};// ABG(%^)
|
|
587
|
+
`;break;case n.AEN:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}};// AEN(%$)
|
|
588
|
+
`;break;case n.BKA:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}};// BKA
|
|
589
|
+
`;break;case n.BKN:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}};// BKN
|
|
590
|
+
`;break;case n.TLS:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, string: [${F.string.toString()}]};// TLS
|
|
591
|
+
`;break;case n.TBS:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, string: [${F.string.toString()}]};// TBS
|
|
592
|
+
`;break;case n.TRG:B+=` this.rules[${q}].opcodes[${ee}] = {type: ${F.type}, min: ${F.min}, max: ${F.max}};// TRG
|
|
593
|
+
`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),B+=`
|
|
594
|
+
`,B+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",B+=` this.toString = function toString(){
|
|
595
|
+
`,B+=` let str = "";
|
|
596
|
+
`;let Z;return R.forEach(se=>{let q=se.beginChar+se.length;Z="",B+=' str += "';for(let F=se.beginChar;F<q;F+=1){switch(O[F]){case 9:Z=" ";break;case 10:Z="\\n";break;case 13:Z="\\r";break;case 34:Z='\\"';break;case 92:Z="\\\\";break;default:Z=String.fromCharCode(O[F]);break}B+=Z}B+=`";
|
|
597
|
+
`}),B+=` return str;
|
|
598
|
+
`,B+=` }
|
|
599
|
+
`,B+=`}
|
|
600
|
+
`,B},"generateSource"),this.generateObject=o(function(O,R,D){let P={},J=[],B=[],W=O.slice(0);return P.grammarObject="grammarObject",R.forEach(Q=>{J.push(Q.lower)}),J.sort(),D.length>0&&(D.forEach(Q=>{B.push(Q.lower)}),B.sort()),P.callbacks=[],J.forEach(Q=>{P.callbacks[Q]=!1}),D.length>0&&B.forEach(Q=>{P.callbacks[Q]=!1}),P.rules=R,P.udts=D,P.toString=o(function(){return W},"toStringFunc"),P},"generateObject")},"exportParser")});var Z4=De((QG,X4)=>{X4.exports=o(function(){let e=zi(),r="rule-attributes.js",n=null;function i(T){return T.left||T.nested||T.right||T.cyclic?!1:T.empty}o(i,"isEmptyOnly");function a(T){return!!(T.left||T.nested||T.right||T.cyclic)}o(a,"isRecursive");function c(T,h){let y=0,b=0,l=0;for(y=0;y<h;y+=1)if(T[y].nested)return!0;for(y=0;y<h;y+=1)if(T[y].right&&!T[y].leaf){for(b=y+1;b<h;b+=1)if(!i(T[b]))return!0}for(y=h-1;y>=0;y-=1)if(T[y].left&&!T[y].leaf){for(b=y-1;b>=0;b-=1)if(!i(T[b]))return!0}for(y=0;y<h;y+=1)if(!T[y].empty&&!a(T[y])){for(b=y+1;b<h;b+=1)if(a(T[b])){for(l=b+1;l<h;l+=1)if(!T[l].empty&&!a(T[l]))return!0}}return!1}o(c,"isCatNested");function u(T,h){for(let y=0;y<h;y+=1)if(!T[y].cyclic)return!1;return!0}o(u,"isCatCyclic");function m(T,h){for(let y=0;y<h;y+=1){if(T[y].left)return!0;if(!T[y].empty)return!1}return!1}o(m,"isCatLeft");function v(T,h){for(let y=h-1;y>=0;y-=1){if(T[y].right)return!0;if(!T[y].empty)return!1}return!1}o(v,"isCatRight");function x(T,h){for(let y=0;y<h;y+=1)if(!T[y].empty)return!1;return!0}o(x,"isCatEmpty");function S(T,h){for(let y=0;y<h;y+=1)if(!T[y].finite)return!1;return!0}o(S,"isCatFinite");function O(T,h,y,b){let l=0,p=h[y],_=p.children.length,A=[];for(l=0;l<_;l+=1)A.push(T.attrGen());for(l=0;l<_;l+=1)P(T,h,p.children[l],A[l]);b.left=m(A,_),b.right=v(A,_),b.nested=c(A,_),b.empty=x(A,_),b.finite=S(A,_),b.cyclic=u(A,_)}o(O,"cat");function R(T,h,y,b){let l=0,p=h[y],_=p.children.length,A=[];for(l=0;l<_;l+=1)A.push(T.attrGen());for(l=0;l<_;l+=1)P(T,h,p.children[l],A[l]);for(b.left=!1,b.right=!1,b.nested=!1,b.empty=!1,b.finite=!1,b.cyclic=!1,l=0;l<_;l+=1)A[l].left&&(b.left=!0),A[l].nested&&(b.nested=!0),A[l].right&&(b.right=!0),A[l].empty&&(b.empty=!0),A[l].finite&&(b.finite=!0),A[l].cyclic&&(b.cyclic=!0)}o(R,"alt");function D(T,h,y,b){let l=h[y];l.index>=T.ruleCount?(b.empty=T.udts[l.index-T.ruleCount].empty,b.finite=!0):(J(T,l.index,b),b.left=!1,b.nested=!1,b.right=!1,b.cyclic=!1)}o(D,"bkr");function P(T,h,y,b){T.attrInit(b);let l=h[y];switch(l.type){case e.ALT:R(T,h,y,b);break;case e.CAT:O(T,h,y,b);break;case e.REP:P(T,h,y+1,b),l.min===0&&(b.empty=!0,b.finite=!0);break;case e.RNM:J(T,h[y].index,b);break;case e.BKR:D(T,h,y,b);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:P(T,h,y+1,b),b.empty=!0;break;case e.TLS:b.empty=!h[y].string.length,b.finite=!0,b.cyclic=!1;break;case e.TBS:case e.TRG:b.empty=!1,b.finite=!0,b.cyclic=!1;break;case e.UDT:b.empty=l.empty,b.finite=!0,b.cyclic=!1;break;case e.ABG:case e.AEN:b.empty=!0,b.finite=!0,b.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${l}`)}}o(P,"opEval");function J(T,h,y){let b=T.attrsWorking[h];b.isComplete?T.attrCopy(y,b):b.isOpen?h===T.startRule?h===T.startRule&&(y.left=!0,y.right=!0,y.cyclic=!0,y.leaf=!0):y.finite=!0:(b.isOpen=!0,P(T,b.rule.opcodes,0,y),b.left=y.left,b.right=y.right,b.nested=y.nested,b.empty=y.empty,b.finite=y.finite,b.cyclic=y.cyclic,b.leaf=!1,b.isOpen=!1,b.isComplete=!0)}o(J,"ruleAttrsEval");let B=o(T=>{n=T;let h=0,y=0,b=n.attrGen();for(h=0;h<n.ruleCount;h+=1){for(y=0;y<n.ruleCount;y+=1)n.attrInit(n.attrsWorking[y]);n.startRule=h,J(n,h,b),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 p=n.attrGen(l.rule);n.attrCopy(p,l),n.attrsErrors.push(p),n.attrsErrorCount+=1}},"ruleAttributes"),W=o(T=>T?"t":"f","truth"),Q=o(T=>T?"e":"f","tError"),Y=o(T=>T?"t":"e","fError"),oe=o((T,h,y,b)=>{let l=`${T}:${h}:`;return l+=`${Q(y.left)} `,l+=`${W(y.nested)} `,l+=`${W(y.right)} `,l+=`${Q(y.cyclic)} `,l+=`${Y(y.finite)} `,l+=`${W(y.empty)}:`,l+=`${n.typeToString(b.recursiveType)}:`,l+=b.recursiveType===e.ATTR_MR?b.groupNumber:"-",l+=`:${y.rule.name}
|
|
601
601
|
`,l},"showAttr"),j=o(()=>{let T=`LEGEND - t=true, f=false, e=error
|
|
602
602
|
`;return T+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
|
|
603
603
|
`,T},"showLegend"),H=o(()=>{let T=null,h=null,y="";if(y+=`RULE ATTRIBUTES WITH ERRORS
|
|
604
604
|
`,y+=j(),n.attrsErrorCount)for(let b=0;b<n.attrsErrorCount;b+=1)T=n.attrsErrors[b],h=n.ruleDeps[T.rule.index],y+=oe(b,T.rule.index,T,h);else y+=`<none>
|
|
605
|
-
`;return y},"showAttributeErrors"),G=o(T=>{let h=0,y=0,b=null,l=null,p="",{ruleIndexes:_}=n;for(T===97?_=n.ruleAlphaIndexes:T===116&&(_=n.ruleTypeIndexes),h=0;h<n.ruleCount;h+=1)y=_[h],b=n.attrs[y],l=n.ruleDeps[y],p+=oe(h,y,b,l);return p},"show");return{ruleAttributes:
|
|
605
|
+
`;return y},"showAttributeErrors"),G=o(T=>{let h=0,y=0,b=null,l=null,p="",{ruleIndexes:_}=n;for(T===97?_=n.ruleAlphaIndexes:T===116&&(_=n.ruleTypeIndexes),h=0;h<n.ruleCount;h+=1)y=_[h],b=n.attrs[y],l=n.ruleDeps[y],p+=oe(h,y,b,l);return p},"show");return{ruleAttributes:B,showAttributes:o((T="index")=>{if(!n.attributesComplete)throw new Error(`${r}:showAttributes: attributes not available`);let h="",y=`RULE ATTRIBUTES
|
|
606
606
|
`;return T.charCodeAt(0)===97?(h+=`alphabetical by rule name
|
|
607
607
|
`,h+=y,h+=j(),h+=G(97)):T.charCodeAt(0)===116?(h+=`ordered by rule type
|
|
608
608
|
`,h+=y,h+=j(),h+=G(116)):(h+=`ordered by rule index
|
|
609
|
-
`,h+=y,h+=j(),h+=G()),h},"showAttributes"),showAttributeErrors:H}},"exportRuleAttributes")()});var
|
|
609
|
+
`,h+=y,h+=j(),h+=G()),h},"showAttributes"),showAttributeErrors:H}},"exportRuleAttributes")()});var e5=De((eV,Q4)=>{Q4.exports=(()=>{let t=zi(),e=null,r=o((c,u,m,v)=>{let x=0,S=0,O=u[m];v[m]=!0;let R=O.rule.opcodes;for(x=0;x<R.length;x+=1){let D=R[x];if(D.type===t.RNM)for(O.refersTo[D.index]=!0,v[D.index]||r(c,u,D.index,v),S=0;S<c;S+=1)u[D.index].refersTo[S]&&(O.refersTo[S]=!0);else D.type===t.UDT?O.refersToUdt[D.index]=!0:D.type===t.BKR&&(D.index<c?(O.refersTo[D.index]=!0,v[D.index]||r(c,u,D.index,v)):O.refersToUdt[c-D.index]=!0)}},"scan"),n=o(c=>{e=c;let u=0,m=0,v=0,x=null,S=null,O=!1;e.dependenciesComplete=!1;let R=e.falseArray(e.ruleCount);for(u=0;u<e.ruleCount;u+=1)e.falsifyArray(R),r(e.ruleCount,e.ruleDeps,u,R);for(u=0;u<e.ruleCount;u+=1)for(m=0;m<e.ruleCount;m+=1)u!==m&&e.ruleDeps[m].refersTo[u]&&(e.ruleDeps[u].referencedBy[m]=!0);for(u=0;u<e.ruleCount;u+=1)e.ruleDeps[u].recursiveType=t.ATTR_N,e.ruleDeps[u].refersTo[u]&&(e.ruleDeps[u].recursiveType=t.ATTR_R);for(v=-1,u=0;u<e.ruleCount;u+=1)if(x=e.ruleDeps[u],x.recursiveType===t.ATTR_R)for(O=!0,m=0;m<e.ruleCount;m+=1)u!==m&&(S=e.ruleDeps[m],S.recursiveType===t.ATTR_R&&x.refersTo[m]&&S.refersTo[u]&&(O&&(v+=1,x.recursiveType=t.ATTR_MR,x.groupNumber=v,O=!1),S.recursiveType=t.ATTR_MR,S.groupNumber=v));e.isMutuallyRecursive=v>-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((c=null)=>{let u=0,m=0,v=0,x=0,S=e.ruleCount-1,O=e.udtCount-1,R=100,D="",P="",J="=> ",B="<= ",W=!1,Q=null,{ruleIndexes:Y}=e,{udtIndexes:oe}=e;for(c===97?(Y=e.ruleAlphaIndexes,oe=e.udtAlphaIndexes):c===116&&(Y=e.ruleTypeIndexes,oe=e.udtAlphaIndexes),u=0;u<e.ruleCount;u+=1){for(Q=e.ruleDeps[Y[u]],P=`${Y[u]}:${e.typeToString(Q.recursiveType)}:`,e.isMutuallyRecursive&&(P+=Q.groupNumber>-1?Q.groupNumber:"-",P+=":"),P+=" ",D+=`${P+e.rules[Y[u]].name}
|
|
610
610
|
`,W=!0,v=0,x=D.length,D+=P,m=0;m<e.ruleCount;m+=1)Q.refersTo[Y[m]]&&(W?(D+=J,W=!1,D+=e.ruleDeps[Y[m]].rule.name):D+=`, ${e.ruleDeps[Y[m]].rule.name}`,v+=1),D.length-x>R&&m!==S&&(D+=`
|
|
611
611
|
${P}${J}`,x=D.length);if(e.udtCount)for(m=0;m<e.udtCount;m+=1)Q.refersToUdt[oe[m]]&&(W?(D+=J,W=!1,D+=e.udts[oe[m]].name):D+=`, ${e.udts[oe[m]].name}`,v+=1),D.length-x>R&&m!==O&&(D+=`
|
|
612
612
|
${P}${J}`,x=D.length);for(v===0&&(D+=`=> <none>
|
|
613
613
|
`),W===!1&&(D+=`
|
|
614
|
-
`),W=!0,v=0,x=D.length,D+=P,m=0;m<e.ruleCount;m+=1)Q.referencedBy[Y[m]]&&(W?(D+=
|
|
614
|
+
`),W=!0,v=0,x=D.length,D+=P,m=0;m<e.ruleCount;m+=1)Q.referencedBy[Y[m]]&&(W?(D+=B,W=!1,D+=e.ruleDeps[Y[m]].rule.name):D+=`, ${e.ruleDeps[Y[m]].rule.name}`,v+=1),D.length-x>R&&m!==S&&(D+=`
|
|
615
615
|
${P}${J}`,x=D.length);v===0&&(D+=`<= <none>
|
|
616
616
|
`),W===!1&&(D+=`
|
|
617
617
|
`),D+=`
|
|
@@ -621,20 +621,20 @@ ${P}${J}`,x=D.length);v===0&&(D+=`<= <none>
|
|
|
621
621
|
`,e.dependenciesComplete&&(c.charCodeAt(0)===97?(u+=`alphabetical by rule name
|
|
622
622
|
`,u+=i(97)):c.charCodeAt(0)===116?(u+=`ordered by rule type
|
|
623
623
|
`,u+=i(116)):(u+=`ordered by rule index
|
|
624
|
-
`,u+=i(null))),u},"showRuleDependencies")}})()});var
|
|
625
|
-
`,
|
|
626
|
-
`;if(P)for(
|
|
624
|
+
`,u+=i(null))),u},"showRuleDependencies")}})()});var r5=De((tV,t5)=>{t5.exports=o(function(){let e=zi(),{ruleAttributes:r,showAttributes:n,showAttributeErrors:i}=Z4(),{ruleDependencies:a,showRuleDependencies:c}=e5();class u{constructor(x,S){this.rules=x,this.udts=S,this.ruleCount=x.length,this.udtCount=S.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(x[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(x){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:x}}attrInit(x){x.left=!1,x.nested=!1,x.right=!1,x.empty=!1,x.finite=!1,x.cyclic=!1,x.leaf=!1,x.isOpen=!1,x.isComplete=!1}attrCopy(x,S){x.left=S.left,x.nested=S.nested,x.right=S.right,x.empty=S.empty,x.finite=S.finite,x.cyclic=S.cyclic,x.leaf=S.leaf,x.isOpen=S.isOpen,x.isComplete=S.isComplete,x.rule=S.rule}rdGen(x,S,O){return{rule:x,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(S),refersToUdt:this.falseArray(O),referencedBy:this.falseArray(S)}}typeToString(x){switch(x){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(x){let S=[];if(x>0)for(let O=0;O<x;O+=1)S.push(!1);return S}falsifyArray(x){for(let S=0;S<x.length;S+=1)x[S]=!1}indexArray(x){let S=[];if(x>0)for(let O=0;O<x;O+=1)S.push(O);return S}compRulesAlpha(x,S){return this.rules[x].lower<this.rules[S].lower?-1:this.rules[x].lower>this.rules[S].lower?1:0}compUdtsAlpha(x,S){return this.udts[x].lower<this.udts[S].lower?-1:this.udts[x].lower>this.udts[S].lower?1:0}compRulesType(x,S){return this.ruleDeps[x].recursiveType<this.ruleDeps[S].recursiveType?-1:this.ruleDeps[x].recursiveType>this.ruleDeps[S].recursiveType?1:0}compRulesGroup(x,S){if(this.ruleDeps[x].recursiveType===e.ATTR_MR&&this.ruleDeps[S].recursiveType===e.ATTR_MR){if(this.ruleDeps[x].groupNumber<this.ruleDeps[S].groupNumber)return-1;if(this.ruleDeps[x].groupNumber>this.ruleDeps[S].groupNumber)return 1}return 0}}return o(u,"State"),{attributes:o(function(x=[],S=[],O=[],R=[]){let D=new u(x,S);return a(D),r(D),D.attrsErrorCount&&R.push({line:0,char:0,msg:`${D.attrsErrorCount} attribute errors`}),D.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:c}},"exportAttributes")()});var i5=De((rV,n5)=>{n5.exports=o(function(){let e="show-rules.js";return o(function(i=[],a=[],c="index"){let u="showRules",m=[],v=[],x=[],S=[],O=i,R=a,D=i.length,P=a.length,J="RULE/UDT NAMES",B;function W(Y,oe){return O[Y].lower<O[oe].lower?-1:O[Y].lower>O[oe].lower?1:0}o(W,"compRulesAlpha");function Q(Y,oe){return R[Y].lower<R[oe].lower?-1:R[Y].lower>R[oe].lower?1:0}if(o(Q,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${u}: rules arg must be array with length > 0`);if(!Array.isArray(a))throw new Error(`${e}:${u}: udts arg must be array`);for(B=0;B<D;B+=1)x.push(B);if(m=x.slice(0),m.sort(W),P){for(B=0;B<P;B+=1)S.push(B);v=S.slice(0),v.sort(Q)}if(c.charCodeAt(0)===97){for(J+=` - alphabetical by rule/UDT name
|
|
625
|
+
`,B=0;B<D;B+=1)J+=`${B}: ${m[B]}: ${O[m[B]].name}
|
|
626
|
+
`;if(P)for(B=0;B<P;B+=1)J+=`${B}: ${v[B]}: ${R[v[B]].name}
|
|
627
627
|
`}else{for(J+=` - ordered by rule/UDT index
|
|
628
|
-
`,
|
|
629
|
-
`;if(P)for(
|
|
630
|
-
`}return J},"showRules")},"exfn")()});var
|
|
628
|
+
`,B=0;B<D;B+=1)J+=`${B}: ${O[B].name}
|
|
629
|
+
`;if(P)for(B=0;B<P;B+=1)J+=`${B}: ${R[B].name}
|
|
630
|
+
`}return J},"showRules")},"exfn")()});var s5=De((nV,o5)=>{o5.exports=o(function(e){let r="api.js: ",n=this,i=Ka(),a=ob(),c=H4(),u=new(Y4()),{attributes:m,showAttributes:v,showAttributeErrors:x,showRuleDependencies:S}=r5(),O=i5(),R=o(function(T,h,y){let _=`<span class="${i.style.CLASS_CTRLCHAR}">`,A="</span>",E=`<span class="${i.style.CLASS_NOMATCH}">`,g="</span>",C,N="",w=!0;for(;w&&!(!Array.isArray(T)||T.length===0);){if(typeof h!="number")throw new Error("abnfToHtml: beg must be type number");if(h>=T.length)break;typeof y!="number"||h+y>=T.length?C=T.length:C=h+y;let k=0;for(let he=h;he<C;he+=1){let I=T[he];if(I>=32&&I<=126)switch(k===1?(N+=A,k=0):k===2&&(N+=g,k=0),I){case 32:N+=" ";break;case 60:N+="<";break;case 62:N+=">";break;case 38:N+="&";break;case 34:N+=""";break;case 39:N+="'";break;case 92:N+="\";break;default:N+=String.fromCharCode(I);break}else I===9||I===10||I===13?(k===0?(N+=_,k=1):k===2&&(N+=g+_,k=1),I===9&&(N+="TAB"),I===10&&(N+="LF"),I===13&&(N+="CR")):(k===0?(N+=E,k=2):k===1&&(N+=A+E,k=2),N+=`\\x${i.utils.charToHex(I)}`)}k===2&&(N+=g),k===1&&(N+=A);break}return N},"abnfToHtml"),D=o(function(T,h,y){let b="";for(let l=h;l<h+y;l+=1){let p=T[l];if(p>=32&&p<=126)b+=String.fromCharCode(p);else switch(p){case 9:b+="\\t";break;case 10:b+="\\n";break;case 13:b+="\\r";break;default:b+="\\unknown";break}}return b},"abnfToAscii"),P=o(function(T){let h="Annotated Input Grammar";return T.forEach(y=>{h+=`
|
|
631
631
|
`,h+=`line no: ${y.lineNo}`,h+=` : char index: ${y.beginChar}`,h+=` : length: ${y.length}`,h+=` : abnf: ${D(n.chars,y.beginChar,y.length)}`}),h+=`
|
|
632
632
|
`,h},"linesToAscii"),J=o(function(T){let h="";return h+=`<table class="${i.style.CLASS_GRAMMAR}">
|
|
633
633
|
`,h+=`<caption>Annotated Input Grammar</caption>
|
|
634
634
|
`,h+="<tr>",h+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",h+=`</tr>
|
|
635
635
|
`,T.forEach(b=>{h+="<tr>",h+=`<td>${b.lineNo}`,h+=`</td><td>${b.beginChar}`,h+=`</td><td>${b.length}`,h+=`</td><td>${R(n.chars,b.beginChar,b.length)}`,h+="</td>",h+=`</tr>
|
|
636
636
|
`}),h+=`</table>
|
|
637
|
-
`,h},"linesToHtml"),
|
|
637
|
+
`,h},"linesToHtml"),B=o(function(T,h,y,b){let[l]=i,p="",_=`<span class="${l.CLASS_NOMATCH}">»</span>`;return p+=`<p><table class="${l.CLASS_GRAMMAR}">
|
|
638
638
|
`,b&&typeof b=="string"&&(p+=`<caption>${b}</caption>
|
|
639
639
|
`),p+=`<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>
|
|
640
640
|
`,T.forEach(A=>{let E,g,C,N,w,k="",he="";h.length===0?(w=_,g=0):(E=h[A.line],C=E.beginChar,A.char>C&&(k=R(y,C,A.char-C)),C=A.char,N=E.beginChar+E.length,C<N&&(he=R(y,C,N-C)),w=k+_+he,g=A.char-E.beginChar,p+="<tr>",p+=`<td>${A.line}</td><td>${E.beginChar}</td><td>${g}</td><td>${w}</td>`,p+=`</tr>
|
|
@@ -642,14 +642,14 @@ ${P}${J}`,x=D.length);v===0&&(D+=`<= <none>
|
|
|
642
642
|
`)}),p+=`</table></p>
|
|
643
643
|
`,p},"errorsToHtml"),W=o(function(T,h,y){let b,l,p,_;return b="",T.forEach(A=>{l=h[A.line],b+=`${l.lineNo}: `,b+=`${l.beginChar}: `,b+=`${A.char-l.beginChar}: `,p=l.beginChar,_=A.char-l.beginChar,b+=D(y,p,_),b+=" >> ",p=A.char,_=l.beginChar+l.length-A.char,b+=D(y,p,_),b+=`
|
|
644
644
|
`,b+=`${l.lineNo}: `,b+=`${l.beginChar}: `,b+=`${A.char-l.beginChar}: `,b+="error: ",b+=A.msg,b+=`
|
|
645
|
-
`}),b},"errorsToAscii"),Q=!1,Y=!1,oe=!1,j=!1,H=0,G;if(this.errors=[],Buffer.isBuffer(e))this.chars=a.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=a.decode("STRING",e);else throw new Error(`${r}input source is not a string, byte Buffer or character array`);this.sabnf=a.encode("STRING",this.chars),this.scan=o(function(T,h){this.lines=c(this.chars,this.errors,T,h),Q=!0},"scan"),this.parse=o(function(T,h){if(!Q)throw new Error(`${r}grammar not scanned`);u.syntax(this.chars,this.lines,this.errors,T,h),Y=!0},"parse"),this.translate=o(function(){if(!Y)throw new Error(`${r}grammar not scanned and parsed`);let T=u.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=T.rules,this.udts=T.udts,G=T.lineMap,oe=!0)},"translate"),this.attributes=o(function(){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return H=m(this.rules,this.udts,G,this.errors),j=!0,H},"attrs"),this.generate=o(function(T){if(this.lines=c(this.chars,this.errors,T),this.errors.length||(u.syntax(this.chars,this.lines,this.errors,T),this.errors.length))return;let h=u.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=h.rules,this.udts=h.udts,G=h.lineMap,H=m(this.rules,this.udts,G,this.errors),j=!0)},"generate"),this.displayRules=o(function(T="index"){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return O(this.rules,this.udts,T)},"displayRules"),this.displayRuleDependencies=o(function(T="index"){if(!j)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return S(T)},"displayRuleDependencies"),this.displayAttributes=o(function(T="index"){if(!j)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return H&&x(T),v(T)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!j)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return x()},"displayAttributeErrors"),this.toSource=o(function(T){if(!j)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${r}can't generate parser source - attributes have ${H} errors`);return u.generateSource(this.chars,this.lines,this.rules,this.udts,T)},"toSource"),this.toObject=o(function(){if(!j)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${r}can't generate parser source - attributes have ${H} errors`);return u.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return W(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(T){return L(this.errors,this.lines,this.chars,T)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return P(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return J(this.lines)},"linesToHtmlFunc")},"api")});var gb=De((b5,bb)=>{(function(t,e){"use strict";function r(b,l){if(!b)throw new Error(l||"Assertion failed")}o(r,"assert");function n(b,l){b.super_=l;var p=o(function(){},"TempCtor");p.prototype=l.prototype,b.prototype=new p,b.prototype.constructor=b}o(n,"inherits");function i(b,l,p){if(i.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((l==="le"||l==="be")&&(p=l,l=10),this._init(b||0,l||10,p||"be"))}o(i,"BN"),typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=qm().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,p){return l.cmp(p)>0?l:p},"max"),i.min=o(function(l,p){return l.cmp(p)<0?l:p},"min"),i.prototype._init=o(function(l,p,_){if(typeof l=="number")return this._initNumber(l,p,_);if(typeof l=="object")return this._initArray(l,p,_);p==="hex"&&(p=16),r(p===(p|0)&&p>=2&&p<=36),l=l.toString().replace(/\s+/g,"");var A=0;l[0]==="-"&&(A++,this.negative=1),A<l.length&&(p===16?this._parseHex(l,A,_):(this._parseBase(l,p,A),_==="le"&&this._initArray(this.toArray(),p,_)))},"init"),i.prototype._initNumber=o(function(l,p,_){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):(r(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),p,_)},"_initNumber"),i.prototype._initArray=o(function(l,p,_){if(r(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 A=0;A<this.length;A++)this.words[A]=0;var E,g,C=0;if(_==="be")for(A=l.length-1,E=0;A>=0;A-=3)g=l[A]|l[A-1]<<8|l[A-2]<<16,this.words[E]|=g<<C&67108863,this.words[E+1]=g>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);else if(_==="le")for(A=0,E=0;A<l.length;A+=3)g=l[A]|l[A+1]<<8|l[A+2]<<16,this.words[E]|=g<<C&67108863,this.words[E+1]=g>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);return this._strip()},"_initArray");function c(b,l){var p=b.charCodeAt(l);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;r(!1,"Invalid character in "+b)}o(c,"parseHex4Bits");function u(b,l,p){var _=c(b,p);return p-1>=l&&(_|=c(b,p-1)<<4),_}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,p,_){this.length=Math.ceil((l.length-p)/6),this.words=new Array(this.length);for(var A=0;A<this.length;A++)this.words[A]=0;var E=0,g=0,C;if(_==="be")for(A=l.length-1;A>=p;A-=2)C=u(l,p,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8;else{var N=l.length-p;for(A=N%2===0?p+1:p;A<l.length;A+=2)C=u(l,p,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8}this._strip()},"_parseHex");function m(b,l,p,_){for(var A=0,E=0,g=Math.min(b.length,p),C=l;C<g;C++){var N=b.charCodeAt(C)-48;A*=_,N>=49?E=N-49+10:N>=17?E=N-17+10:E=N,r(N>=0&&E<_,"Invalid character"),A+=E}return A}o(m,"parseBase"),i.prototype._parseBase=o(function(l,p,_){this.words=[0],this.length=1;for(var A=0,E=1;E<=67108863;E*=p)A++;A--,E=E/p|0;for(var g=l.length-_,C=g%A,N=Math.min(g,g-C)+_,w=0,k=_;k<N;k+=A)w=m(l,k,k+A,p),this.imuln(E),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(C!==0){var he=1;for(w=m(l,k,l.length,p),k=0;k<C;k++)he*=p;this.imuln(he),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this._strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var p=0;p<this.length;p++)l.words[p]=this.words[p];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy");function v(b,l){b.words=l.words,b.length=l.length,b.negative=l.negative,b.red=l.red}if(o(v,"move"),i.prototype._move=o(function(l){v(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")]=x}catch{i.prototype.inspect=x}else i.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(x,"inspect");var S=["","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,p){l=l||10,p=p|0||1;var _;if(l===16||l==="hex"){_="";for(var A=0,E=0,g=0;g<this.length;g++){var C=this.words[g],N=((C<<A|E)&16777215).toString(16);E=C>>>24-A&16777215,A+=2,A>=26&&(A-=26,g--),E!==0||g!==this.length-1?_=S[6-N.length]+N+_:_=N+_}for(E!==0&&(_=E.toString(16)+_);_.length%p!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(l===(l|0)&&l>=2&&l<=36){var w=O[l],k=R[l];_="";var he=this.clone();for(he.negative=0;!he.isZero();){var I=he.modrn(k).toString(l);he=he.idivn(k),he.isZero()?_=I+_:_=S[w-I.length]+I+_}for(this.isZero()&&(_="0"+_);_.length%p!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}r(!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&&r(!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"),a&&(i.prototype.toBuffer=o(function(l,p){return this.toArrayLike(a,l,p)},"toBuffer")),i.prototype.toArray=o(function(l,p){return this.toArrayLike(Array,l,p)},"toArray");var D=o(function(l,p){return l.allocUnsafe?l.allocUnsafe(p):new l(p)},"allocate");i.prototype.toArrayLike=o(function(l,p,_){this._strip();var A=this.byteLength(),E=_||Math.max(1,A);r(A<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0");var g=D(l,E),C=p==="le"?"LE":"BE";return this["_toArrayLike"+C](g,A),g},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,p){for(var _=0,A=0,E=0,g=0;E<this.length;E++){var C=this.words[E]<<g|A;l[_++]=C&255,_<l.length&&(l[_++]=C>>8&255),_<l.length&&(l[_++]=C>>16&255),g===6?(_<l.length&&(l[_++]=C>>24&255),A=0,g=0):(A=C>>>24,g+=2)}if(_<l.length)for(l[_++]=A;_<l.length;)l[_++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,p){for(var _=l.length-1,A=0,E=0,g=0;E<this.length;E++){var C=this.words[E]<<g|A;l[_--]=C&255,_>=0&&(l[_--]=C>>8&255),_>=0&&(l[_--]=C>>16&255),g===6?(_>=0&&(l[_--]=C>>24&255),A=0,g=0):(A=C>>>24,g+=2)}if(_>=0)for(l[_--]=A;_>=0;)l[_--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var p=l,_=0;return p>=4096&&(_+=13,p>>>=13),p>=64&&(_+=7,p>>>=7),p>=8&&(_+=4,p>>>=4),p>=2&&(_+=2,p>>>=2),_+p},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var p=l,_=0;return(p&8191)===0&&(_+=13,p>>>=13),(p&127)===0&&(_+=7,p>>>=7),(p&15)===0&&(_+=4,p>>>=4),(p&3)===0&&(_+=2,p>>>=2),(p&1)===0&&_++,_},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],p=this._countBits(l);return(this.length-1)*26+p},"bitLength");function P(b){for(var l=new Array(b.bitLength()),p=0;p<l.length;p++){var _=p/26|0,A=p%26;l[p]=b.words[_]>>>A&1}return l}o(P,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,p=0;p<this.length;p++){var _=this._zeroBits(this.words[p]);if(l+=_,_!==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 p=0;p<l.length;p++)this.words[p]=this.words[p]|l.words[p];return this._strip()},"iuor"),i.prototype.ior=o(function(l){return r((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 p;this.length>l.length?p=l:p=this;for(var _=0;_<p.length;_++)this.words[_]=this.words[_]&l.words[_];return this.length=p.length,this._strip()},"iuand"),i.prototype.iand=o(function(l){return r((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 p,_;this.length>l.length?(p=this,_=l):(p=l,_=this);for(var A=0;A<_.length;A++)this.words[A]=p.words[A]^_.words[A];if(this!==p)for(;A<p.length;A++)this.words[A]=p.words[A];return this.length=p.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(l){return r((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){r(typeof l=="number"&&l>=0);var p=Math.ceil(l/26)|0,_=l%26;this._expand(p),_>0&&p--;for(var A=0;A<p;A++)this.words[A]=~this.words[A]&67108863;return _>0&&(this.words[A]=~this.words[A]&67108863>>26-_),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,p){r(typeof l=="number"&&l>=0);var _=l/26|0,A=l%26;return this._expand(_+1),p?this.words[_]=this.words[_]|1<<A:this.words[_]=this.words[_]&~(1<<A),this._strip()},"setn"),i.prototype.iadd=o(function(l){var p;if(this.negative!==0&&l.negative===0)return this.negative=0,p=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,p=this.isub(l),l.negative=1,p._normSign();var _,A;this.length>l.length?(_=this,A=l):(_=l,A=this);for(var E=0,g=0;g<A.length;g++)p=(_.words[g]|0)+(A.words[g]|0)+E,this.words[g]=p&67108863,E=p>>>26;for(;E!==0&&g<_.length;g++)p=(_.words[g]|0)+E,this.words[g]=p&67108863,E=p>>>26;if(this.length=_.length,E!==0)this.words[this.length]=E,this.length++;else if(_!==this)for(;g<_.length;g++)this.words[g]=_.words[g];return this},"iadd"),i.prototype.add=o(function(l){var p;return l.negative!==0&&this.negative===0?(l.negative=0,p=this.sub(l),l.negative^=1,p):l.negative===0&&this.negative!==0?(this.negative=0,p=l.sub(this),this.negative=1,p):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 p=this.iadd(l);return l.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var _=this.cmp(l);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var A,E;_>0?(A=this,E=l):(A=l,E=this);for(var g=0,C=0;C<E.length;C++)p=(A.words[C]|0)-(E.words[C]|0)+g,g=p>>26,this.words[C]=p&67108863;for(;g!==0&&C<A.length;C++)p=(A.words[C]|0)+g,g=p>>26,this.words[C]=p&67108863;if(g===0&&C<A.length&&A!==this)for(;C<A.length;C++)this.words[C]=A.words[C];return this.length=Math.max(this.length,C),A!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function J(b,l,p){p.negative=l.negative^b.negative;var _=b.length+l.length|0;p.length=_,_=_-1|0;var A=b.words[0]|0,E=l.words[0]|0,g=A*E,C=g&67108863,N=g/67108864|0;p.words[0]=C;for(var w=1;w<_;w++){for(var k=N>>>26,he=N&67108863,I=Math.min(w,l.length-1),Z=Math.max(0,w-b.length+1);Z<=I;Z++){var se=w-Z|0;A=b.words[se]|0,E=l.words[Z]|0,g=A*E+he,k+=g/67108864|0,he=g&67108863}p.words[w]=he|0,N=k|0}return N!==0?p.words[w]=N|0:p.length--,p._strip()}o(J,"smallMulTo");var L=o(function(l,p,_){var A=l.words,E=p.words,g=_.words,C=0,N,w,k,he=A[0]|0,I=he&8191,Z=he>>>13,se=A[1]|0,q=se&8191,F=se>>>13,ee=A[2]|0,ne=ee&8191,ae=ee>>>13,Ae=A[3]|0,ge=Ae&8191,re=Ae>>>13,Se=A[4]|0,ce=Se&8191,ve=Se>>>13,V=A[5]|0,pe=V&8191,Ce=V>>>13,He=A[6]|0,Re=He&8191,Ve=He>>>13,pr=A[7]|0,ue=pr&8191,ie=pr>>>13,$=A[8]|0,X=$&8191,me=$>>>13,ye=A[9]|0,we=ye&8191,ke=ye>>>13,It=E[0]|0,Ue=It&8191,Oe=It>>>13,Bt=E[1]|0,je=Bt&8191,Je=Bt>>>13,Tn=E[2]|0,nt=Tn&8191,it=Tn>>>13,Yn=E[3]|0,ot=Yn&8191,et=Yn>>>13,Xn=E[4]|0,st=Xn&8191,at=Xn>>>13,cn=E[5]|0,ft=cn&8191,Xe=cn>>>13,Zn=E[6]|0,ct=Zn&8191,ut=Zn>>>13,Qn=E[7]|0,lt=Qn&8191,ht=Qn>>>13,ei=E[8]|0,dt=ei&8191,tt=ei>>>13,Cn=E[9]|0,Ft=Cn&8191,qt=Cn>>>13;_.negative=l.negative^p.negative,_.length=19,N=Math.imul(I,Ue),w=Math.imul(I,Oe),w=w+Math.imul(Z,Ue)|0,k=Math.imul(Z,Oe);var un=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(un>>>26)|0,un&=67108863,N=Math.imul(q,Ue),w=Math.imul(q,Oe),w=w+Math.imul(F,Ue)|0,k=Math.imul(F,Oe),N=N+Math.imul(I,je)|0,w=w+Math.imul(I,Je)|0,w=w+Math.imul(Z,je)|0,k=k+Math.imul(Z,Je)|0;var ln=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ln>>>26)|0,ln&=67108863,N=Math.imul(ne,Ue),w=Math.imul(ne,Oe),w=w+Math.imul(ae,Ue)|0,k=Math.imul(ae,Oe),N=N+Math.imul(q,je)|0,w=w+Math.imul(q,Je)|0,w=w+Math.imul(F,je)|0,k=k+Math.imul(F,Je)|0,N=N+Math.imul(I,nt)|0,w=w+Math.imul(I,it)|0,w=w+Math.imul(Z,nt)|0,k=k+Math.imul(Z,it)|0;var hn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(hn>>>26)|0,hn&=67108863,N=Math.imul(ge,Ue),w=Math.imul(ge,Oe),w=w+Math.imul(re,Ue)|0,k=Math.imul(re,Oe),N=N+Math.imul(ne,je)|0,w=w+Math.imul(ne,Je)|0,w=w+Math.imul(ae,je)|0,k=k+Math.imul(ae,Je)|0,N=N+Math.imul(q,nt)|0,w=w+Math.imul(q,it)|0,w=w+Math.imul(F,nt)|0,k=k+Math.imul(F,it)|0,N=N+Math.imul(I,ot)|0,w=w+Math.imul(I,et)|0,w=w+Math.imul(Z,ot)|0,k=k+Math.imul(Z,et)|0;var Nr=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,N=Math.imul(ce,Ue),w=Math.imul(ce,Oe),w=w+Math.imul(ve,Ue)|0,k=Math.imul(ve,Oe),N=N+Math.imul(ge,je)|0,w=w+Math.imul(ge,Je)|0,w=w+Math.imul(re,je)|0,k=k+Math.imul(re,Je)|0,N=N+Math.imul(ne,nt)|0,w=w+Math.imul(ne,it)|0,w=w+Math.imul(ae,nt)|0,k=k+Math.imul(ae,it)|0,N=N+Math.imul(q,ot)|0,w=w+Math.imul(q,et)|0,w=w+Math.imul(F,ot)|0,k=k+Math.imul(F,et)|0,N=N+Math.imul(I,st)|0,w=w+Math.imul(I,at)|0,w=w+Math.imul(Z,st)|0,k=k+Math.imul(Z,at)|0;var dn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,N=Math.imul(pe,Ue),w=Math.imul(pe,Oe),w=w+Math.imul(Ce,Ue)|0,k=Math.imul(Ce,Oe),N=N+Math.imul(ce,je)|0,w=w+Math.imul(ce,Je)|0,w=w+Math.imul(ve,je)|0,k=k+Math.imul(ve,Je)|0,N=N+Math.imul(ge,nt)|0,w=w+Math.imul(ge,it)|0,w=w+Math.imul(re,nt)|0,k=k+Math.imul(re,it)|0,N=N+Math.imul(ne,ot)|0,w=w+Math.imul(ne,et)|0,w=w+Math.imul(ae,ot)|0,k=k+Math.imul(ae,et)|0,N=N+Math.imul(q,st)|0,w=w+Math.imul(q,at)|0,w=w+Math.imul(F,st)|0,k=k+Math.imul(F,at)|0,N=N+Math.imul(I,ft)|0,w=w+Math.imul(I,Xe)|0,w=w+Math.imul(Z,ft)|0,k=k+Math.imul(Z,Xe)|0;var ti=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ti>>>26)|0,ti&=67108863,N=Math.imul(Re,Ue),w=Math.imul(Re,Oe),w=w+Math.imul(Ve,Ue)|0,k=Math.imul(Ve,Oe),N=N+Math.imul(pe,je)|0,w=w+Math.imul(pe,Je)|0,w=w+Math.imul(Ce,je)|0,k=k+Math.imul(Ce,Je)|0,N=N+Math.imul(ce,nt)|0,w=w+Math.imul(ce,it)|0,w=w+Math.imul(ve,nt)|0,k=k+Math.imul(ve,it)|0,N=N+Math.imul(ge,ot)|0,w=w+Math.imul(ge,et)|0,w=w+Math.imul(re,ot)|0,k=k+Math.imul(re,et)|0,N=N+Math.imul(ne,st)|0,w=w+Math.imul(ne,at)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,N=N+Math.imul(q,ft)|0,w=w+Math.imul(q,Xe)|0,w=w+Math.imul(F,ft)|0,k=k+Math.imul(F,Xe)|0,N=N+Math.imul(I,ct)|0,w=w+Math.imul(I,ut)|0,w=w+Math.imul(Z,ct)|0,k=k+Math.imul(Z,ut)|0;var Ao=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,N=Math.imul(ue,Ue),w=Math.imul(ue,Oe),w=w+Math.imul(ie,Ue)|0,k=Math.imul(ie,Oe),N=N+Math.imul(Re,je)|0,w=w+Math.imul(Re,Je)|0,w=w+Math.imul(Ve,je)|0,k=k+Math.imul(Ve,Je)|0,N=N+Math.imul(pe,nt)|0,w=w+Math.imul(pe,it)|0,w=w+Math.imul(Ce,nt)|0,k=k+Math.imul(Ce,it)|0,N=N+Math.imul(ce,ot)|0,w=w+Math.imul(ce,et)|0,w=w+Math.imul(ve,ot)|0,k=k+Math.imul(ve,et)|0,N=N+Math.imul(ge,st)|0,w=w+Math.imul(ge,at)|0,w=w+Math.imul(re,st)|0,k=k+Math.imul(re,at)|0,N=N+Math.imul(ne,ft)|0,w=w+Math.imul(ne,Xe)|0,w=w+Math.imul(ae,ft)|0,k=k+Math.imul(ae,Xe)|0,N=N+Math.imul(q,ct)|0,w=w+Math.imul(q,ut)|0,w=w+Math.imul(F,ct)|0,k=k+Math.imul(F,ut)|0,N=N+Math.imul(I,lt)|0,w=w+Math.imul(I,ht)|0,w=w+Math.imul(Z,lt)|0,k=k+Math.imul(Z,ht)|0;var So=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(So>>>26)|0,So&=67108863,N=Math.imul(X,Ue),w=Math.imul(X,Oe),w=w+Math.imul(me,Ue)|0,k=Math.imul(me,Oe),N=N+Math.imul(ue,je)|0,w=w+Math.imul(ue,Je)|0,w=w+Math.imul(ie,je)|0,k=k+Math.imul(ie,Je)|0,N=N+Math.imul(Re,nt)|0,w=w+Math.imul(Re,it)|0,w=w+Math.imul(Ve,nt)|0,k=k+Math.imul(Ve,it)|0,N=N+Math.imul(pe,ot)|0,w=w+Math.imul(pe,et)|0,w=w+Math.imul(Ce,ot)|0,k=k+Math.imul(Ce,et)|0,N=N+Math.imul(ce,st)|0,w=w+Math.imul(ce,at)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,N=N+Math.imul(ge,ft)|0,w=w+Math.imul(ge,Xe)|0,w=w+Math.imul(re,ft)|0,k=k+Math.imul(re,Xe)|0,N=N+Math.imul(ne,ct)|0,w=w+Math.imul(ne,ut)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,N=N+Math.imul(q,lt)|0,w=w+Math.imul(q,ht)|0,w=w+Math.imul(F,lt)|0,k=k+Math.imul(F,ht)|0,N=N+Math.imul(I,dt)|0,w=w+Math.imul(I,tt)|0,w=w+Math.imul(Z,dt)|0,k=k+Math.imul(Z,tt)|0;var Mo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,N=Math.imul(we,Ue),w=Math.imul(we,Oe),w=w+Math.imul(ke,Ue)|0,k=Math.imul(ke,Oe),N=N+Math.imul(X,je)|0,w=w+Math.imul(X,Je)|0,w=w+Math.imul(me,je)|0,k=k+Math.imul(me,Je)|0,N=N+Math.imul(ue,nt)|0,w=w+Math.imul(ue,it)|0,w=w+Math.imul(ie,nt)|0,k=k+Math.imul(ie,it)|0,N=N+Math.imul(Re,ot)|0,w=w+Math.imul(Re,et)|0,w=w+Math.imul(Ve,ot)|0,k=k+Math.imul(Ve,et)|0,N=N+Math.imul(pe,st)|0,w=w+Math.imul(pe,at)|0,w=w+Math.imul(Ce,st)|0,k=k+Math.imul(Ce,at)|0,N=N+Math.imul(ce,ft)|0,w=w+Math.imul(ce,Xe)|0,w=w+Math.imul(ve,ft)|0,k=k+Math.imul(ve,Xe)|0,N=N+Math.imul(ge,ct)|0,w=w+Math.imul(ge,ut)|0,w=w+Math.imul(re,ct)|0,k=k+Math.imul(re,ut)|0,N=N+Math.imul(ne,lt)|0,w=w+Math.imul(ne,ht)|0,w=w+Math.imul(ae,lt)|0,k=k+Math.imul(ae,ht)|0,N=N+Math.imul(q,dt)|0,w=w+Math.imul(q,tt)|0,w=w+Math.imul(F,dt)|0,k=k+Math.imul(F,tt)|0,N=N+Math.imul(I,Ft)|0,w=w+Math.imul(I,qt)|0,w=w+Math.imul(Z,Ft)|0,k=k+Math.imul(Z,qt)|0;var Xi=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,N=Math.imul(we,je),w=Math.imul(we,Je),w=w+Math.imul(ke,je)|0,k=Math.imul(ke,Je),N=N+Math.imul(X,nt)|0,w=w+Math.imul(X,it)|0,w=w+Math.imul(me,nt)|0,k=k+Math.imul(me,it)|0,N=N+Math.imul(ue,ot)|0,w=w+Math.imul(ue,et)|0,w=w+Math.imul(ie,ot)|0,k=k+Math.imul(ie,et)|0,N=N+Math.imul(Re,st)|0,w=w+Math.imul(Re,at)|0,w=w+Math.imul(Ve,st)|0,k=k+Math.imul(Ve,at)|0,N=N+Math.imul(pe,ft)|0,w=w+Math.imul(pe,Xe)|0,w=w+Math.imul(Ce,ft)|0,k=k+Math.imul(Ce,Xe)|0,N=N+Math.imul(ce,ct)|0,w=w+Math.imul(ce,ut)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,N=N+Math.imul(ge,lt)|0,w=w+Math.imul(ge,ht)|0,w=w+Math.imul(re,lt)|0,k=k+Math.imul(re,ht)|0,N=N+Math.imul(ne,dt)|0,w=w+Math.imul(ne,tt)|0,w=w+Math.imul(ae,dt)|0,k=k+Math.imul(ae,tt)|0,N=N+Math.imul(q,Ft)|0,w=w+Math.imul(q,qt)|0,w=w+Math.imul(F,Ft)|0,k=k+Math.imul(F,qt)|0;var Zi=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,N=Math.imul(we,nt),w=Math.imul(we,it),w=w+Math.imul(ke,nt)|0,k=Math.imul(ke,it),N=N+Math.imul(X,ot)|0,w=w+Math.imul(X,et)|0,w=w+Math.imul(me,ot)|0,k=k+Math.imul(me,et)|0,N=N+Math.imul(ue,st)|0,w=w+Math.imul(ue,at)|0,w=w+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,N=N+Math.imul(Re,ft)|0,w=w+Math.imul(Re,Xe)|0,w=w+Math.imul(Ve,ft)|0,k=k+Math.imul(Ve,Xe)|0,N=N+Math.imul(pe,ct)|0,w=w+Math.imul(pe,ut)|0,w=w+Math.imul(Ce,ct)|0,k=k+Math.imul(Ce,ut)|0,N=N+Math.imul(ce,lt)|0,w=w+Math.imul(ce,ht)|0,w=w+Math.imul(ve,lt)|0,k=k+Math.imul(ve,ht)|0,N=N+Math.imul(ge,dt)|0,w=w+Math.imul(ge,tt)|0,w=w+Math.imul(re,dt)|0,k=k+Math.imul(re,tt)|0,N=N+Math.imul(ne,Ft)|0,w=w+Math.imul(ne,qt)|0,w=w+Math.imul(ae,Ft)|0,k=k+Math.imul(ae,qt)|0;var Qi=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,N=Math.imul(we,ot),w=Math.imul(we,et),w=w+Math.imul(ke,ot)|0,k=Math.imul(ke,et),N=N+Math.imul(X,st)|0,w=w+Math.imul(X,at)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,N=N+Math.imul(ue,ft)|0,w=w+Math.imul(ue,Xe)|0,w=w+Math.imul(ie,ft)|0,k=k+Math.imul(ie,Xe)|0,N=N+Math.imul(Re,ct)|0,w=w+Math.imul(Re,ut)|0,w=w+Math.imul(Ve,ct)|0,k=k+Math.imul(Ve,ut)|0,N=N+Math.imul(pe,lt)|0,w=w+Math.imul(pe,ht)|0,w=w+Math.imul(Ce,lt)|0,k=k+Math.imul(Ce,ht)|0,N=N+Math.imul(ce,dt)|0,w=w+Math.imul(ce,tt)|0,w=w+Math.imul(ve,dt)|0,k=k+Math.imul(ve,tt)|0,N=N+Math.imul(ge,Ft)|0,w=w+Math.imul(ge,qt)|0,w=w+Math.imul(re,Ft)|0,k=k+Math.imul(re,qt)|0;var To=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(To>>>26)|0,To&=67108863,N=Math.imul(we,st),w=Math.imul(we,at),w=w+Math.imul(ke,st)|0,k=Math.imul(ke,at),N=N+Math.imul(X,ft)|0,w=w+Math.imul(X,Xe)|0,w=w+Math.imul(me,ft)|0,k=k+Math.imul(me,Xe)|0,N=N+Math.imul(ue,ct)|0,w=w+Math.imul(ue,ut)|0,w=w+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,N=N+Math.imul(Re,lt)|0,w=w+Math.imul(Re,ht)|0,w=w+Math.imul(Ve,lt)|0,k=k+Math.imul(Ve,ht)|0,N=N+Math.imul(pe,dt)|0,w=w+Math.imul(pe,tt)|0,w=w+Math.imul(Ce,dt)|0,k=k+Math.imul(Ce,tt)|0,N=N+Math.imul(ce,Ft)|0,w=w+Math.imul(ce,qt)|0,w=w+Math.imul(ve,Ft)|0,k=k+Math.imul(ve,qt)|0;var Co=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Co>>>26)|0,Co&=67108863,N=Math.imul(we,ft),w=Math.imul(we,Xe),w=w+Math.imul(ke,ft)|0,k=Math.imul(ke,Xe),N=N+Math.imul(X,ct)|0,w=w+Math.imul(X,ut)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,N=N+Math.imul(ue,lt)|0,w=w+Math.imul(ue,ht)|0,w=w+Math.imul(ie,lt)|0,k=k+Math.imul(ie,ht)|0,N=N+Math.imul(Re,dt)|0,w=w+Math.imul(Re,tt)|0,w=w+Math.imul(Ve,dt)|0,k=k+Math.imul(Ve,tt)|0,N=N+Math.imul(pe,Ft)|0,w=w+Math.imul(pe,qt)|0,w=w+Math.imul(Ce,Ft)|0,k=k+Math.imul(Ce,qt)|0;var ko=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ko>>>26)|0,ko&=67108863,N=Math.imul(we,ct),w=Math.imul(we,ut),w=w+Math.imul(ke,ct)|0,k=Math.imul(ke,ut),N=N+Math.imul(X,lt)|0,w=w+Math.imul(X,ht)|0,w=w+Math.imul(me,lt)|0,k=k+Math.imul(me,ht)|0,N=N+Math.imul(ue,dt)|0,w=w+Math.imul(ue,tt)|0,w=w+Math.imul(ie,dt)|0,k=k+Math.imul(ie,tt)|0,N=N+Math.imul(Re,Ft)|0,w=w+Math.imul(Re,qt)|0,w=w+Math.imul(Ve,Ft)|0,k=k+Math.imul(Ve,qt)|0;var Io=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Io>>>26)|0,Io&=67108863,N=Math.imul(we,lt),w=Math.imul(we,ht),w=w+Math.imul(ke,lt)|0,k=Math.imul(ke,ht),N=N+Math.imul(X,dt)|0,w=w+Math.imul(X,tt)|0,w=w+Math.imul(me,dt)|0,k=k+Math.imul(me,tt)|0,N=N+Math.imul(ue,Ft)|0,w=w+Math.imul(ue,qt)|0,w=w+Math.imul(ie,Ft)|0,k=k+Math.imul(ie,qt)|0;var vf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(vf>>>26)|0,vf&=67108863,N=Math.imul(we,dt),w=Math.imul(we,tt),w=w+Math.imul(ke,dt)|0,k=Math.imul(ke,tt),N=N+Math.imul(X,Ft)|0,w=w+Math.imul(X,qt)|0,w=w+Math.imul(me,Ft)|0,k=k+Math.imul(me,qt)|0;var yf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(yf>>>26)|0,yf&=67108863,N=Math.imul(we,Ft),w=Math.imul(we,qt),w=w+Math.imul(ke,Ft)|0,k=Math.imul(ke,qt);var xf=(C+N|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(xf>>>26)|0,xf&=67108863,g[0]=un,g[1]=ln,g[2]=hn,g[3]=Nr,g[4]=dn,g[5]=ti,g[6]=Ao,g[7]=So,g[8]=Mo,g[9]=Xi,g[10]=Zi,g[11]=Qi,g[12]=To,g[13]=Co,g[14]=ko,g[15]=Io,g[16]=vf,g[17]=yf,g[18]=xf,C!==0&&(g[19]=C,_.length++),_},"comb10MulTo");Math.imul||(L=J);function W(b,l,p){p.negative=l.negative^b.negative,p.length=b.length+l.length;for(var _=0,A=0,E=0;E<p.length-1;E++){var g=A;A=0;for(var C=_&67108863,N=Math.min(E,l.length-1),w=Math.max(0,E-b.length+1);w<=N;w++){var k=E-w,he=b.words[k]|0,I=l.words[w]|0,Z=he*I,se=Z&67108863;g=g+(Z/67108864|0)|0,se=se+C|0,C=se&67108863,g=g+(se>>>26)|0,A+=g>>>26,g&=67108863}p.words[E]=C,_=g,g=A}return _!==0?p.words[E]=_:p.length--,p._strip()}o(W,"bigMulTo");function Q(b,l,p){return W(b,l,p)}o(Q,"jumboMulTo"),i.prototype.mulTo=o(function(l,p){var _,A=this.length+l.length;return this.length===10&&l.length===10?_=L(this,l,p):A<63?_=J(this,l,p):A<1024?_=W(this,l,p):_=Q(this,l,p),_},"mulTo");function Y(b,l){this.x=b,this.y=l}o(Y,"FFTM"),Y.prototype.makeRBT=o(function(l){for(var p=new Array(l),_=i.prototype._countBits(l)-1,A=0;A<l;A++)p[A]=this.revBin(A,_,l);return p},"makeRBT"),Y.prototype.revBin=o(function(l,p,_){if(l===0||l===_-1)return l;for(var A=0,E=0;E<p;E++)A|=(l&1)<<p-E-1,l>>=1;return A},"revBin"),Y.prototype.permute=o(function(l,p,_,A,E,g){for(var C=0;C<g;C++)A[C]=p[l[C]],E[C]=_[l[C]]},"permute"),Y.prototype.transform=o(function(l,p,_,A,E,g){this.permute(g,l,p,_,A,E);for(var C=1;C<E;C<<=1)for(var N=C<<1,w=Math.cos(2*Math.PI/N),k=Math.sin(2*Math.PI/N),he=0;he<E;he+=N)for(var I=w,Z=k,se=0;se<C;se++){var q=_[he+se],F=A[he+se],ee=_[he+se+C],ne=A[he+se+C],ae=I*ee-Z*ne;ne=I*ne+Z*ee,ee=ae,_[he+se]=q+ee,A[he+se]=F+ne,_[he+se+C]=q-ee,A[he+se+C]=F-ne,se!==N&&(ae=w*I-k*Z,Z=w*Z+k*I,I=ae)}},"transform"),Y.prototype.guessLen13b=o(function(l,p){var _=Math.max(p,l)|1,A=_&1,E=0;for(_=_/2|0;_;_=_>>>1)E++;return 1<<E+1+A},"guessLen13b"),Y.prototype.conjugate=o(function(l,p,_){if(!(_<=1))for(var A=0;A<_/2;A++){var E=l[A];l[A]=l[_-A-1],l[_-A-1]=E,E=p[A],p[A]=-p[_-A-1],p[_-A-1]=-E}},"conjugate"),Y.prototype.normalize13b=o(function(l,p){for(var _=0,A=0;A<p/2;A++){var E=Math.round(l[2*A+1]/p)*8192+Math.round(l[2*A]/p)+_;l[A]=E&67108863,E<67108864?_=0:_=E/67108864|0}return l},"normalize13b"),Y.prototype.convert13b=o(function(l,p,_,A){for(var E=0,g=0;g<p;g++)E=E+(l[g]|0),_[2*g]=E&8191,E=E>>>13,_[2*g+1]=E&8191,E=E>>>13;for(g=2*p;g<A;++g)_[g]=0;r(E===0),r((E&-8192)===0)},"convert13b"),Y.prototype.stub=o(function(l){for(var p=new Array(l),_=0;_<l;_++)p[_]=0;return p},"stub"),Y.prototype.mulp=o(function(l,p,_){var A=2*this.guessLen13b(l.length,p.length),E=this.makeRBT(A),g=this.stub(A),C=new Array(A),N=new Array(A),w=new Array(A),k=new Array(A),he=new Array(A),I=new Array(A),Z=_.words;Z.length=A,this.convert13b(l.words,l.length,C,A),this.convert13b(p.words,p.length,k,A),this.transform(C,g,N,w,A,E),this.transform(k,g,he,I,A,E);for(var se=0;se<A;se++){var q=N[se]*he[se]-w[se]*I[se];w[se]=N[se]*I[se]+w[se]*he[se],N[se]=q}return this.conjugate(N,w,A),this.transform(N,w,Z,g,A,E),this.conjugate(Z,g,A),this.normalize13b(Z,A),_.negative=l.negative^p.negative,_.length=l.length+p.length,_._strip()},"mulp"),i.prototype.mul=o(function(l){var p=new i(null);return p.words=new Array(this.length+l.length),this.mulTo(l,p)},"mul"),i.prototype.mulf=o(function(l){var p=new i(null);return p.words=new Array(this.length+l.length),Q(this,l,p)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var p=l<0;p&&(l=-l),r(typeof l=="number"),r(l<67108864);for(var _=0,A=0;A<this.length;A++){var E=(this.words[A]|0)*l,g=(E&67108863)+(_&67108863);_>>=26,_+=E/67108864|0,_+=g>>>26,this.words[A]=g&67108863}return _!==0&&(this.words[A]=_,this.length++),p?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 p=P(l);if(p.length===0)return new i(1);for(var _=this,A=0;A<p.length&&p[A]===0;A++,_=_.sqr());if(++A<p.length)for(var E=_.sqr();A<p.length;A++,E=E.sqr())p[A]!==0&&(_=_.mul(E));return _},"pow"),i.prototype.iushln=o(function(l){r(typeof l=="number"&&l>=0);var p=l%26,_=(l-p)/26,A=67108863>>>26-p<<26-p,E;if(p!==0){var g=0;for(E=0;E<this.length;E++){var C=this.words[E]&A,N=(this.words[E]|0)-C<<p;this.words[E]=N|g,g=C>>>26-p}g&&(this.words[E]=g,this.length++)}if(_!==0){for(E=this.length-1;E>=0;E--)this.words[E+_]=this.words[E];for(E=0;E<_;E++)this.words[E]=0;this.length+=_}return this._strip()},"iushln"),i.prototype.ishln=o(function(l){return r(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,p,_){r(typeof l=="number"&&l>=0);var A;p?A=(p-p%26)/26:A=0;var E=l%26,g=Math.min((l-E)/26,this.length),C=67108863^67108863>>>E<<E,N=_;if(A-=g,A=Math.max(0,A),N){for(var w=0;w<g;w++)N.words[w]=this.words[w];N.length=g}if(g!==0)if(this.length>g)for(this.length-=g,w=0;w<this.length;w++)this.words[w]=this.words[w+g];else this.words[0]=0,this.length=1;var k=0;for(w=this.length-1;w>=0&&(k!==0||w>=A);w--){var he=this.words[w]|0;this.words[w]=k<<26-E|he>>>E,k=he&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,p,_){return r(this.negative===0),this.iushrn(l,p,_)},"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){r(typeof l=="number"&&l>=0);var p=l%26,_=(l-p)/26,A=1<<p;if(this.length<=_)return!1;var E=this.words[_];return!!(E&A)},"testn"),i.prototype.imaskn=o(function(l){r(typeof l=="number"&&l>=0);var p=l%26,_=(l-p)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(p!==0&&_++,this.length=Math.min(_,this.length),p!==0){var A=67108863^67108863>>>p<<p;this.words[this.length-1]&=A}return this._strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return r(typeof l=="number"),r(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 p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},"_iaddn"),i.prototype.isubn=o(function(l){if(r(typeof l=="number"),r(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 p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+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,p,_){var A=l.length+_,E;this._expand(A);var g,C=0;for(E=0;E<l.length;E++){g=(this.words[E+_]|0)+C;var N=(l.words[E]|0)*p;g-=N&67108863,C=(g>>26)-(N/67108864|0),this.words[E+_]=g&67108863}for(;E<this.length-_;E++)g=(this.words[E+_]|0)+C,C=g>>26,this.words[E+_]=g&67108863;if(C===0)return this._strip();for(r(C===-1),C=0,E=0;E<this.length;E++)g=-(this.words[E]|0)+C,C=g>>26,this.words[E]=g&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,p){var _=this.length-l.length,A=this.clone(),E=l,g=E.words[E.length-1]|0,C=this._countBits(g);_=26-C,_!==0&&(E=E.ushln(_),A.iushln(_),g=E.words[E.length-1]|0);var N=A.length-E.length,w;if(p!=="mod"){w=new i(null),w.length=N+1,w.words=new Array(w.length);for(var k=0;k<w.length;k++)w.words[k]=0}var he=A.clone()._ishlnsubmul(E,1,N);he.negative===0&&(A=he,w&&(w.words[N]=1));for(var I=N-1;I>=0;I--){var Z=(A.words[E.length+I]|0)*67108864+(A.words[E.length+I-1]|0);for(Z=Math.min(Z/g|0,67108863),A._ishlnsubmul(E,Z,I);A.negative!==0;)Z--,A.negative=0,A._ishlnsubmul(E,1,I),A.isZero()||(A.negative^=1);w&&(w.words[I]=Z)}return w&&w._strip(),A._strip(),p!=="div"&&_!==0&&A.iushrn(_),{div:w||null,mod:A}},"_wordDiv"),i.prototype.divmod=o(function(l,p,_){if(r(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var A,E,g;return this.negative!==0&&l.negative===0?(g=this.neg().divmod(l,p),p!=="mod"&&(A=g.div.neg()),p!=="div"&&(E=g.mod.neg(),_&&E.negative!==0&&E.iadd(l)),{div:A,mod:E}):this.negative===0&&l.negative!==0?(g=this.divmod(l.neg(),p),p!=="mod"&&(A=g.div.neg()),{div:A,mod:g.mod}):(this.negative&l.negative)!==0?(g=this.neg().divmod(l.neg(),p),p!=="div"&&(E=g.mod.neg(),_&&E.negative!==0&&E.isub(l)),{div:g.div,mod:E}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?p==="div"?{div:this.divn(l.words[0]),mod:null}:p==="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,p)},"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 p=this.divmod(l);if(p.mod.isZero())return p.div;var _=p.div.negative!==0?p.mod.isub(l):p.mod,A=l.ushrn(1),E=l.andln(1),g=_.cmp(A);return g<0||E===1&&g===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var p=l<0;p&&(l=-l),r(l<=67108863);for(var _=(1<<26)%l,A=0,E=this.length-1;E>=0;E--)A=(_*A+(this.words[E]|0))%l;return p?-A:A},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var p=l<0;p&&(l=-l),r(l<=67108863);for(var _=0,A=this.length-1;A>=0;A--){var E=(this.words[A]|0)+_*67108864;this.words[A]=E/l|0,_=E%l}return this._strip(),p?this.ineg():this},"idivn"),i.prototype.divn=o(function(l){return this.clone().idivn(l)},"divn"),i.prototype.egcd=o(function(l){r(l.negative===0),r(!l.isZero());var p=this,_=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var A=new i(1),E=new i(0),g=new i(0),C=new i(1),N=0;p.isEven()&&_.isEven();)p.iushrn(1),_.iushrn(1),++N;for(var w=_.clone(),k=p.clone();!p.isZero();){for(var he=0,I=1;(p.words[0]&I)===0&&he<26;++he,I<<=1);if(he>0)for(p.iushrn(he);he-- >0;)(A.isOdd()||E.isOdd())&&(A.iadd(w),E.isub(k)),A.iushrn(1),E.iushrn(1);for(var Z=0,se=1;(_.words[0]&se)===0&&Z<26;++Z,se<<=1);if(Z>0)for(_.iushrn(Z);Z-- >0;)(g.isOdd()||C.isOdd())&&(g.iadd(w),C.isub(k)),g.iushrn(1),C.iushrn(1);p.cmp(_)>=0?(p.isub(_),A.isub(g),E.isub(C)):(_.isub(p),g.isub(A),C.isub(E))}return{a:g,b:C,gcd:_.iushln(N)}},"egcd"),i.prototype._invmp=o(function(l){r(l.negative===0),r(!l.isZero());var p=this,_=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var A=new i(1),E=new i(0),g=_.clone();p.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,N=1;(p.words[0]&N)===0&&C<26;++C,N<<=1);if(C>0)for(p.iushrn(C);C-- >0;)A.isOdd()&&A.iadd(g),A.iushrn(1);for(var w=0,k=1;(_.words[0]&k)===0&&w<26;++w,k<<=1);if(w>0)for(_.iushrn(w);w-- >0;)E.isOdd()&&E.iadd(g),E.iushrn(1);p.cmp(_)>=0?(p.isub(_),A.isub(E)):(_.isub(p),E.isub(A))}var he;return p.cmpn(1)===0?he=A:he=E,he.cmpn(0)<0&&he.iadd(l),he},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var p=this.clone(),_=l.clone();p.negative=0,_.negative=0;for(var A=0;p.isEven()&&_.isEven();A++)p.iushrn(1),_.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;_.isEven();)_.iushrn(1);var E=p.cmp(_);if(E<0){var g=p;p=_,_=g}else if(E===0||_.cmpn(1)===0)break;p.isub(_)}while(!0);return _.iushln(A)},"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){r(typeof l=="number");var p=l%26,_=(l-p)/26,A=1<<p;if(this.length<=_)return this._expand(_+1),this.words[_]|=A,this;for(var E=A,g=_;E!==0&&g<this.length;g++){var C=this.words[g]|0;C+=E,E=C>>>26,C&=67108863,this.words[g]=C}return E!==0&&(this.words[g]=E,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 p=l<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var _;if(this.length>1)_=1;else{p&&(l=-l),r(l<=67108863,"Number is too big");var A=this.words[0]|0;_=A===l?0:A<l?-1:1}return this.negative!==0?-_|0:_},"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 p=this.ucmp(l);return this.negative!==0?-p|0:p},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var p=0,_=this.length-1;_>=0;_--){var A=this.words[_]|0,E=l.words[_]|0;if(A!==E){A<E?p=-1:A>E&&(p=1);break}}return p},"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 r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return r(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 r(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 r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return r(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var oe={k256:null,p224:null,p192:null,p25519:null};function j(b,l){this.name=b,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(j,"MPrime"),j.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),j.prototype.ireduce=o(function(l){var p=l,_;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),_=p.bitLength();while(_>this.n);var A=_<this.n?-1:p.ucmp(this.p);return A===0?(p.words[0]=0,p.length=1):A>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},"ireduce"),j.prototype.split=o(function(l,p){l.iushrn(this.n,0,p)},"split"),j.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,j),H.prototype.split=o(function(l,p){for(var _=4194303,A=Math.min(l.length,9),E=0;E<A;E++)p.words[E]=l.words[E];if(p.length=A,l.length<=9){l.words[0]=0,l.length=1;return}var g=l.words[9];for(p.words[p.length++]=g&_,E=10;E<l.length;E++){var C=l.words[E]|0;l.words[E-10]=(C&_)<<4|g>>>22,g=C}g>>>=22,l.words[E-10]=g,g===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var p=0,_=0;_<l.length;_++){var A=l.words[_]|0;p+=A*977,l.words[_]=p&67108863,p=A*64+(p/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function G(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(G,"P224"),n(G,j);function le(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,"P192"),n(le,j);function T(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(T,"P25519"),n(T,j),T.prototype.imulK=o(function(l){for(var p=0,_=0;_<l.length;_++){var A=(l.words[_]|0)*19+p,E=A&67108863;A>>>=26,l.words[_]=E,p=A}return p!==0&&(l.words[l.length++]=p),l},"imulK"),i._prime=o(function(l){if(oe[l])return oe[l];var p;if(l==="k256")p=new H;else if(l==="p224")p=new G;else if(l==="p192")p=new le;else if(l==="p25519")p=new T;else throw new Error("Unknown prime "+l);return oe[l]=p,p},"prime");function h(b){if(typeof b=="string"){var l=i._prime(b);this.m=l.p,this.prime=l}else r(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){r(l.negative===0,"red works only with positives"),r(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,p){r((l.negative|p.negative)===0,"red works only with positives"),r(l.red&&l.red===p.red,"red works only with red numbers")},"_verify2"),h.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(v(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,p){this._verify2(l,p);var _=l.add(p);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},"add"),h.prototype.iadd=o(function(l,p){this._verify2(l,p);var _=l.iadd(p);return _.cmp(this.m)>=0&&_.isub(this.m),_},"iadd"),h.prototype.sub=o(function(l,p){this._verify2(l,p);var _=l.sub(p);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},"sub"),h.prototype.isub=o(function(l,p){this._verify2(l,p);var _=l.isub(p);return _.cmpn(0)<0&&_.iadd(this.m),_},"isub"),h.prototype.shl=o(function(l,p){return this._verify1(l),this.imod(l.ushln(p))},"shl"),h.prototype.imul=o(function(l,p){return this._verify2(l,p),this.imod(l.imul(p))},"imul"),h.prototype.mul=o(function(l,p){return this._verify2(l,p),this.imod(l.mul(p))},"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 p=this.m.andln(3);if(r(p%2===1),p===3){var _=this.m.add(new i(1)).iushrn(2);return this.pow(l,_)}for(var A=this.m.subn(1),E=0;!A.isZero()&&A.andln(1)===0;)E++,A.iushrn(1);r(!A.isZero());var g=new i(1).toRed(this),C=g.redNeg(),N=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,N).cmp(C)!==0;)w.redIAdd(C);for(var k=this.pow(w,A),he=this.pow(l,A.addn(1).iushrn(1)),I=this.pow(l,A),Z=E;I.cmp(g)!==0;){for(var se=I,q=0;se.cmp(g)!==0;q++)se=se.redSqr();r(q<Z);var F=this.pow(k,new i(1).iushln(Z-q-1));he=he.redMul(F),k=F.redSqr(),I=I.redMul(k),Z=q}return he},"sqrt"),h.prototype.invm=o(function(l){var p=l._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},"invm"),h.prototype.pow=o(function(l,p){if(p.isZero())return new i(1).toRed(this);if(p.cmpn(1)===0)return l.clone();var _=4,A=new Array(1<<_);A[0]=new i(1).toRed(this),A[1]=l;for(var E=2;E<A.length;E++)A[E]=this.mul(A[E-1],l);var g=A[0],C=0,N=0,w=p.bitLength()%26;for(w===0&&(w=26),E=p.length-1;E>=0;E--){for(var k=p.words[E],he=w-1;he>=0;he--){var I=k>>he&1;if(g!==A[0]&&(g=this.sqr(g)),I===0&&C===0){N=0;continue}C<<=1,C|=I,N++,!(N!==_&&(E!==0||he!==0))&&(g=this.mul(g,A[C]),N=0,C=0)}w=26}return g},"pow"),h.prototype.convertTo=o(function(l){var p=l.umod(this.m);return p===l?p.clone():p},"convertTo"),h.prototype.convertFrom=o(function(l){var p=l.clone();return p.red=null,p},"convertFrom"),i.mont=o(function(l){return new y(l)},"mont");function y(b){h.call(this,b),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(y,"Mont"),n(y,h),y.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),y.prototype.convertFrom=o(function(l){var p=this.imod(l.mul(this.rinv));return p.red=null,p},"convertFrom"),y.prototype.imul=o(function(l,p){if(l.isZero()||p.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(p),A=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=_.isub(A).iushrn(this.shift),g=E;return E.cmp(this.m)>=0?g=E.isub(this.m):E.cmpn(0)<0&&(g=E.iadd(this.m)),g._forceRed(this)},"imul"),y.prototype.mul=o(function(l,p){if(l.isZero()||p.isZero())return new i(0)._forceRed(this);var _=l.mul(p),A=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=_.isub(A).iushrn(this.shift),g=E;return E.cmp(this.m)>=0?g=E.isub(this.m):E.cmpn(0)<0&&(g=E.iadd(this.m)),g._forceRed(this)},"mul"),y.prototype.invm=o(function(l){var p=this.imod(l._invmp(this.m).mul(this.r2));return p._forceRed(this)},"invm")})(typeof bb>"u"||bb,b5)});var n8=De((FW,r8)=>{r8.exports=Db;var t8=128,FL=127,qL=~FL,HL=Math.pow(2,31);function Db(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw Db.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=HL;)e[r++]=t&255|t8,t/=128;for(;t&qL;)e[r++]=t&255|t8,t>>>=7;return e[r]=t|0,Db.bytes=r-n+1,e}o(Db,"encode")});var s8=De((qW,o8)=>{o8.exports=Ob;var zL=128,i8=127;function Ob(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u||i>49)throw Ob.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&i8)<<i:(c&i8)*Math.pow(2,i),i+=7}while(c>=zL);return Ob.bytes=a-n,r}o(Ob,"read")});var f8=De((HW,a8)=>{var KL=Math.pow(2,7),jL=Math.pow(2,14),GL=Math.pow(2,21),VL=Math.pow(2,28),WL=Math.pow(2,35),JL=Math.pow(2,42),YL=Math.pow(2,49),XL=Math.pow(2,56),ZL=Math.pow(2,63);a8.exports=function(t){return t<KL?1:t<jL?2:t<GL?3:t<VL?4:t<WL?5:t<JL?6:t<YL?7:t<XL?8:t<ZL?9:10}});var el=De((zW,c8)=>{c8.exports={encode:n8(),decode:s8(),encodingLength:f8()}});var y8=De((WW,v8)=>{"use strict";v8.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(a){return function(c){return function(u,m){var v={key:u,value:c[u]},x={key:m,value:c[m]};return a(v,x)}}}(e.cmp),i=[];return o(function a(c){if(c&&c.toJSON&&typeof c.toJSON=="function"&&(c=c.toJSON()),c!==void 0){if(typeof c=="number")return isFinite(c)?""+c:"null";if(typeof c!="object")return JSON.stringify(c);var u,m;if(Array.isArray(c)){for(m="[",u=0;u<c.length;u++)u&&(m+=","),m+=a(c[u])||"null";return m+"]"}if(c===null)return"null";if(i.indexOf(c)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var v=i.push(c)-1,x=Object.keys(c).sort(n&&n(c));for(m="",u=0;u<x.length;u++){var S=x[u],O=a(c[S]);!O||(m&&(m+=","),m+=JSON.stringify(S)+":"+O)}return i.splice(v,1),"{"+m+"}"}},"stringify")(t)}});var Ac=De((ol,xc)=>{var RB=200,B8="__lodash_hash_undefined__",U8=9007199254740991,tg="[object Arguments]",NB="[object Array]",$8="[object Boolean]",F8="[object Date]",PB="[object Error]",rg="[object Function]",q8="[object GeneratorFunction]",o0="[object Map]",H8="[object Number]",ng="[object Object]",M8="[object Promise]",z8="[object RegExp]",s0="[object Set]",K8="[object String]",j8="[object Symbol]",Jb="[object WeakMap]",G8="[object ArrayBuffer]",a0="[object DataView]",V8="[object Float32Array]",W8="[object Float64Array]",J8="[object Int8Array]",Y8="[object Int16Array]",X8="[object Int32Array]",Z8="[object Uint8Array]",Q8="[object Uint8ClampedArray]",e_="[object Uint16Array]",t_="[object Uint32Array]",LB=/[\\^$.*+?()[\]{}|]/g,BB=/\w*$/,UB=/^\[object .+?Constructor\]$/,$B=/^(?:0|[1-9]\d*)$/,nr={};nr[tg]=nr[NB]=nr[G8]=nr[a0]=nr[$8]=nr[F8]=nr[V8]=nr[W8]=nr[J8]=nr[Y8]=nr[X8]=nr[o0]=nr[H8]=nr[ng]=nr[z8]=nr[s0]=nr[K8]=nr[j8]=nr[Z8]=nr[Q8]=nr[e_]=nr[t_]=!0;nr[PB]=nr[rg]=nr[Jb]=!1;var FB=typeof global=="object"&&global&&global.Object===Object&&global,qB=typeof self=="object"&&self&&self.Object===Object&&self,rs=FB||qB||Function("return this")(),r_=typeof ol=="object"&&ol&&!ol.nodeType&&ol,T8=r_&&typeof xc=="object"&&xc&&!xc.nodeType&&xc,HB=T8&&T8.exports===r_;function zB(t,e){return t.set(e[0],e[1]),t}o(zB,"addMapEntry");function KB(t,e){return t.add(e),t}o(KB,"addSetEntry");function jB(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}o(jB,"arrayEach");function GB(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}o(GB,"arrayPush");function n_(t,e,r,n){var i=-1,a=t?t.length:0;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}o(n_,"arrayReduce");function VB(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(VB,"baseTimes");function WB(t,e){return t?.[e]}o(WB,"getValue");function i_(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}o(i_,"isHostObject");function C8(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}o(C8,"mapToArray");function ig(t,e){return function(r){return t(e(r))}}o(ig,"overArg");function k8(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}o(k8,"setToArray");var JB=Array.prototype,YB=Function.prototype,f0=Object.prototype,Wb=rs["__core-js_shared__"],I8=function(){var t=/[^.]+$/.exec(Wb&&Wb.keys&&Wb.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),o_=YB.toString,Ws=f0.hasOwnProperty,c0=f0.toString,XB=RegExp("^"+o_.call(Ws).replace(LB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D8=HB?rs.Buffer:void 0,O8=rs.Symbol,R8=rs.Uint8Array,ZB=ig(Object.getPrototypeOf,Object),QB=Object.create,eU=f0.propertyIsEnumerable,tU=JB.splice,N8=Object.getOwnPropertySymbols,rU=D8?D8.isBuffer:void 0,nU=ig(Object.keys,Object),Yb=Ec(rs,"DataView"),sl=Ec(rs,"Map"),Xb=Ec(rs,"Promise"),Zb=Ec(rs,"Set"),Qb=Ec(rs,"WeakMap"),al=Ec(Object,"create"),iU=Za(Yb),oU=Za(sl),sU=Za(Xb),aU=Za(Zb),fU=Za(Qb),P8=O8?O8.prototype:void 0,L8=P8?P8.valueOf:void 0;function Xa(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Xa,"Hash");function cU(){this.__data__=al?al(null):{}}o(cU,"hashClear");function uU(t){return this.has(t)&&delete this.__data__[t]}o(uU,"hashDelete");function lU(t){var e=this.__data__;if(al){var r=e[t];return r===B8?void 0:r}return Ws.call(e,t)?e[t]:void 0}o(lU,"hashGet");function hU(t){var e=this.__data__;return al?e[t]!==void 0:Ws.call(e,t)}o(hU,"hashHas");function dU(t,e){var r=this.__data__;return r[t]=al&&e===void 0?B8:e,this}o(dU,"hashSet");Xa.prototype.clear=cU;Xa.prototype.delete=uU;Xa.prototype.get=lU;Xa.prototype.has=hU;Xa.prototype.set=dU;function ns(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(ns,"ListCache");function pU(){this.__data__=[]}o(pU,"listCacheClear");function mU(t){var e=this.__data__,r=u0(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():tU.call(e,r,1),!0}o(mU,"listCacheDelete");function bU(t){var e=this.__data__,r=u0(e,t);return r<0?void 0:e[r][1]}o(bU,"listCacheGet");function gU(t){return u0(this.__data__,t)>-1}o(gU,"listCacheHas");function vU(t,e){var r=this.__data__,n=u0(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}o(vU,"listCacheSet");ns.prototype.clear=pU;ns.prototype.delete=mU;ns.prototype.get=bU;ns.prototype.has=gU;ns.prototype.set=vU;function wc(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(wc,"MapCache");function yU(){this.__data__={hash:new Xa,map:new(sl||ns),string:new Xa}}o(yU,"mapCacheClear");function xU(t){return l0(this,t).delete(t)}o(xU,"mapCacheDelete");function wU(t){return l0(this,t).get(t)}o(wU,"mapCacheGet");function _U(t){return l0(this,t).has(t)}o(_U,"mapCacheHas");function EU(t,e){return l0(this,t).set(t,e),this}o(EU,"mapCacheSet");wc.prototype.clear=yU;wc.prototype.delete=xU;wc.prototype.get=wU;wc.prototype.has=_U;wc.prototype.set=EU;function _c(t){this.__data__=new ns(t)}o(_c,"Stack");function AU(){this.__data__=new ns}o(AU,"stackClear");function SU(t){return this.__data__.delete(t)}o(SU,"stackDelete");function MU(t){return this.__data__.get(t)}o(MU,"stackGet");function TU(t){return this.__data__.has(t)}o(TU,"stackHas");function CU(t,e){var r=this.__data__;if(r instanceof ns){var n=r.__data__;if(!sl||n.length<RB-1)return n.push([t,e]),this;r=this.__data__=new wc(n)}return r.set(t,e),this}o(CU,"stackSet");_c.prototype.clear=AU;_c.prototype.delete=SU;_c.prototype.get=MU;_c.prototype.has=TU;_c.prototype.set=CU;function kU(t,e){var r=sg(t)||QU(t)?VB(t.length,String):[],n=r.length,i=!!n;for(var a in t)(e||Ws.call(t,a))&&!(i&&(a=="length"||JU(a,n)))&&r.push(a);return r}o(kU,"arrayLikeKeys");function s_(t,e,r){var n=t[e];(!(Ws.call(t,e)&&u_(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}o(s_,"assignValue");function u0(t,e){for(var r=t.length;r--;)if(u_(t[r][0],e))return r;return-1}o(u0,"assocIndexOf");function IU(t,e){return t&&a_(e,ag(e),t)}o(IU,"baseAssign");function eg(t,e,r,n,i,a,c){var u;if(n&&(u=a?n(t,i,a,c):n(t)),u!==void 0)return u;if(!h0(t))return t;var m=sg(t);if(m){if(u=GU(t),!e)return zU(t,u)}else{var v=Ya(t),x=v==rg||v==q8;if(t$(t))return LU(t,e);if(v==ng||v==tg||x&&!a){if(i_(t))return a?t:{};if(u=VU(x?{}:t),!e)return KU(t,IU(u,t))}else{if(!nr[v])return a?t:{};u=WU(t,v,eg,e)}}c||(c=new _c);var S=c.get(t);if(S)return S;if(c.set(t,u),!m)var O=r?jU(t):ag(t);return jB(O||t,function(R,D){O&&(D=R,R=t[D]),s_(u,D,eg(R,e,r,n,D,t,c))}),u}o(eg,"baseClone");function DU(t){return h0(t)?QB(t):{}}o(DU,"baseCreate");function OU(t,e,r){var n=e(t);return sg(t)?n:GB(n,r(t))}o(OU,"baseGetAllKeys");function RU(t){return c0.call(t)}o(RU,"baseGetTag");function NU(t){if(!h0(t)||XU(t))return!1;var e=h_(t)||i_(t)?XB:UB;return e.test(Za(t))}o(NU,"baseIsNative");function PU(t){if(!c_(t))return nU(t);var e=[];for(var r in Object(t))Ws.call(t,r)&&r!="constructor"&&e.push(r);return e}o(PU,"baseKeys");function LU(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}o(LU,"cloneBuffer");function og(t){var e=new t.constructor(t.byteLength);return new R8(e).set(new R8(t)),e}o(og,"cloneArrayBuffer");function BU(t,e){var r=e?og(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}o(BU,"cloneDataView");function UU(t,e,r){var n=e?r(C8(t),!0):C8(t);return n_(n,zB,new t.constructor)}o(UU,"cloneMap");function $U(t){var e=new t.constructor(t.source,BB.exec(t));return e.lastIndex=t.lastIndex,e}o($U,"cloneRegExp");function FU(t,e,r){var n=e?r(k8(t),!0):k8(t);return n_(n,KB,new t.constructor)}o(FU,"cloneSet");function qU(t){return L8?Object(L8.call(t)):{}}o(qU,"cloneSymbol");function HU(t,e){var r=e?og(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o(HU,"cloneTypedArray");function zU(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(zU,"copyArray");function a_(t,e,r,n){r||(r={});for(var i=-1,a=e.length;++i<a;){var c=e[i],u=n?n(r[c],t[c],c,r,t):void 0;s_(r,c,u===void 0?t[c]:u)}return r}o(a_,"copyObject");function KU(t,e){return a_(t,f_(t),e)}o(KU,"copySymbols");function jU(t){return OU(t,ag,f_)}o(jU,"getAllKeys");function l0(t,e){var r=t.__data__;return YU(e)?r[typeof e=="string"?"string":"hash"]:r.map}o(l0,"getMapData");function Ec(t,e){var r=WB(t,e);return NU(r)?r:void 0}o(Ec,"getNative");var f_=N8?ig(N8,Object):i$,Ya=RU;(Yb&&Ya(new Yb(new ArrayBuffer(1)))!=a0||sl&&Ya(new sl)!=o0||Xb&&Ya(Xb.resolve())!=M8||Zb&&Ya(new Zb)!=s0||Qb&&Ya(new Qb)!=Jb)&&(Ya=o(function(t){var e=c0.call(t),r=e==ng?t.constructor:void 0,n=r?Za(r):void 0;if(n)switch(n){case iU:return a0;case oU:return o0;case sU:return M8;case aU:return s0;case fU:return Jb}return e},"getTag"));function GU(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&Ws.call(t,"index")&&(r.index=t.index,r.input=t.input),r}o(GU,"initCloneArray");function VU(t){return typeof t.constructor=="function"&&!c_(t)?DU(ZB(t)):{}}o(VU,"initCloneObject");function WU(t,e,r,n){var i=t.constructor;switch(e){case G8:return og(t);case $8:case F8:return new i(+t);case a0:return BU(t,n);case V8:case W8:case J8:case Y8:case X8:case Z8:case Q8:case e_:case t_:return HU(t,n);case o0:return UU(t,n,r);case H8:case K8:return new i(t);case z8:return $U(t);case s0:return FU(t,n,r);case j8:return qU(t)}}o(WU,"initCloneByTag");function JU(t,e){return e=e??U8,!!e&&(typeof t=="number"||$B.test(t))&&t>-1&&t%1==0&&t<e}o(JU,"isIndex");function YU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}o(YU,"isKeyable");function XU(t){return!!I8&&I8 in t}o(XU,"isMasked");function c_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||f0;return t===r}o(c_,"isPrototype");function Za(t){if(t!=null){try{return o_.call(t)}catch{}try{return t+""}catch{}}return""}o(Za,"toSource");function ZU(t){return eg(t,!0,!0)}o(ZU,"cloneDeep");function u_(t,e){return t===e||t!==t&&e!==e}o(u_,"eq");function QU(t){return e$(t)&&Ws.call(t,"callee")&&(!eU.call(t,"callee")||c0.call(t)==tg)}o(QU,"isArguments");var sg=Array.isArray;function l_(t){return t!=null&&r$(t.length)&&!h_(t)}o(l_,"isArrayLike");function e$(t){return n$(t)&&l_(t)}o(e$,"isArrayLikeObject");var t$=rU||o$;function h_(t){var e=h0(t)?c0.call(t):"";return e==rg||e==q8}o(h_,"isFunction");function r$(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=U8}o(r$,"isLength");function h0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}o(h0,"isObject");function n$(t){return!!t&&typeof t=="object"}o(n$,"isObjectLike");function ag(t){return l_(t)?kU(t):PU(t)}o(ag,"keys");function i$(){return[]}o(i$,"stubArray");function o$(){return!1}o(o$,"stubFalse");xc.exports=ZU});var aE=De((as,sE)=>{var oE=typeof self<"u"?self:as,U0=function(){function t(){this.fetch=!1,this.DOMException=oE.DOMException}return o(t,"F"),t.prototype=oE,new t}();(function(t){var e=function(r){var n={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function i(T){return T&&DataView.prototype.isPrototypeOf(T)}if(o(i,"isDataView"),n.arrayBuffer)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(T){return T&&a.indexOf(Object.prototype.toString.call(T))>-1};function u(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(T))throw new TypeError("Invalid character in header field name");return T.toLowerCase()}o(u,"normalizeName");function m(T){return typeof T!="string"&&(T=String(T)),T}o(m,"normalizeValue");function v(T){var h={next:function(){var y=T.shift();return{done:y===void 0,value:y}}};return n.iterable&&(h[Symbol.iterator]=function(){return h}),h}o(v,"iteratorFor");function x(T){this.map={},T instanceof x?T.forEach(function(h,y){this.append(y,h)},this):Array.isArray(T)?T.forEach(function(h){this.append(h[0],h[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(h){this.append(h,T[h])},this)}o(x,"Headers"),x.prototype.append=function(T,h){T=u(T),h=m(h);var y=this.map[T];this.map[T]=y?y+", "+h:h},x.prototype.delete=function(T){delete this.map[u(T)]},x.prototype.get=function(T){return T=u(T),this.has(T)?this.map[T]:null},x.prototype.has=function(T){return this.map.hasOwnProperty(u(T))},x.prototype.set=function(T,h){this.map[u(T)]=m(h)},x.prototype.forEach=function(T,h){for(var y in this.map)this.map.hasOwnProperty(y)&&T.call(h,this.map[y],y,this)},x.prototype.keys=function(){var T=[];return this.forEach(function(h,y){T.push(y)}),v(T)},x.prototype.values=function(){var T=[];return this.forEach(function(h){T.push(h)}),v(T)},x.prototype.entries=function(){var T=[];return this.forEach(function(h,y){T.push([y,h])}),v(T)},n.iterable&&(x.prototype[Symbol.iterator]=x.prototype.entries);function S(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}o(S,"consumed");function O(T){return new Promise(function(h,y){T.onload=function(){h(T.result)},T.onerror=function(){y(T.error)}})}o(O,"fileReaderReady");function R(T){var h=new FileReader,y=O(h);return h.readAsArrayBuffer(T),y}o(R,"readBlobAsArrayBuffer");function D(T){var h=new FileReader,y=O(h);return h.readAsText(T),y}o(D,"readBlobAsText");function P(T){for(var h=new Uint8Array(T),y=new Array(h.length),b=0;b<h.length;b++)y[b]=String.fromCharCode(h[b]);return y.join("")}o(P,"readArrayBufferAsText");function J(T){if(T.slice)return T.slice(0);var h=new Uint8Array(T.byteLength);return h.set(new Uint8Array(T)),h.buffer}o(J,"bufferClone");function L(){return this.bodyUsed=!1,this._initBody=function(T){this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:n.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:n.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():n.arrayBuffer&&n.blob&&i(T)?(this._bodyArrayBuffer=J(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||c(T))?this._bodyArrayBuffer=J(T):this._bodyText=T=Object.prototype.toString.call(T):this._bodyText="",this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var T=S(this);if(T)return T;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(){return this._bodyArrayBuffer?S(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(R)}),this.text=function(){var T=S(this);if(T)return T;if(this._bodyBlob)return D(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(oe)}),this.json=function(){return this.text().then(JSON.parse)},this}o(L,"Body");var W=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Q(T){var h=T.toUpperCase();return W.indexOf(h)>-1?h:T}o(Q,"normalizeMethod");function Y(T,h){h=h||{};var y=h.body;if(T instanceof Y){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,h.headers||(this.headers=new x(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!y&&T._bodyInit!=null&&(y=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new x(h.headers)),this.method=Q(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(y)}o(Y,"Request"),Y.prototype.clone=function(){return new Y(this,{body:this._bodyInit})};function oe(T){var h=new FormData;return T.trim().split("&").forEach(function(y){if(y){var b=y.split("="),l=b.shift().replace(/\+/g," "),p=b.join("=").replace(/\+/g," ");h.append(decodeURIComponent(l),decodeURIComponent(p))}}),h}o(oe,"decode");function j(T){var h=new x,y=T.replace(/\r?\n[\t ]+/g," ");return y.split(/\r?\n/).forEach(function(b){var l=b.split(":"),p=l.shift().trim();if(p){var _=l.join(":").trim();h.append(p,_)}}),h}o(j,"parseHeaders"),L.call(Y.prototype);function H(T,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new x(h.headers),this.url=h.url||"",this._initBody(T)}o(H,"Response"),L.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},H.error=function(){var T=new H(null,{status:0,statusText:""});return T.type="error",T};var G=[301,302,303,307,308];H.redirect=function(T,h){if(G.indexOf(h)===-1)throw new RangeError("Invalid status code");return new H(null,{status:h,headers:{location:T}})},r.DOMException=t.DOMException;try{new r.DOMException}catch{r.DOMException=function(h,y){this.message=h,this.name=y;var b=Error(h);this.stack=b.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function le(T,h){return new Promise(function(y,b){var l=new Y(T,h);if(l.signal&&l.signal.aborted)return b(new r.DOMException("Aborted","AbortError"));var p=new XMLHttpRequest;function _(){p.abort()}o(_,"abortXhr"),p.onload=function(){var A={status:p.status,statusText:p.statusText,headers:j(p.getAllResponseHeaders()||"")};A.url="responseURL"in p?p.responseURL:A.headers.get("X-Request-URL");var E="response"in p?p.response:p.responseText;y(new H(E,A))},p.onerror=function(){b(new TypeError("Network request failed"))},p.ontimeout=function(){b(new TypeError("Network request failed"))},p.onabort=function(){b(new r.DOMException("Aborted","AbortError"))},p.open(l.method,l.url,!0),l.credentials==="include"?p.withCredentials=!0:l.credentials==="omit"&&(p.withCredentials=!1),"responseType"in p&&n.blob&&(p.responseType="blob"),l.headers.forEach(function(A,E){p.setRequestHeader(E,A)}),l.signal&&(l.signal.addEventListener("abort",_),p.onreadystatechange=function(){p.readyState===4&&l.signal.removeEventListener("abort",_)}),p.send(typeof l._bodyInit>"u"?null:l._bodyInit)})}return o(le,"fetch"),le.polyfill=!0,t.fetch||(t.fetch=le,t.Headers=x,t.Request=Y,t.Response=H),r.Headers=x,r.Request=Y,r.Response=H,r.fetch=le,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})(U0);U0.fetch.ponyfill=!0;delete U0.fetch.polyfill;var Lc=U0;as=Lc.fetch;as.default=Lc.fetch;as.fetch=Lc.fetch;as.Headers=Lc.Headers;as.Request=Lc.Request;as.Response=Lc.Response;sE.exports=as});var vE=De((Dee,gE)=>{"use strict";var K$=function(){function t(r,n){if(typeof r!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+r+"."));this._batchLoadFn=r,this._maxBatchSize=W$(n),this._batchScheduleFn=J$(n),this._cacheKeyFn=Y$(n),this._cacheMap=X$(n),this._batch=null,this.name=Z$(n)}o(t,"DataLoader");var e=t.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=G$(this),a=this._cacheMap,c=this._cacheKeyFn(n);if(a){var u=a.get(c);if(u){var m=i.cacheHits||(i.cacheHits=[]);return new Promise(function(x){m.push(function(){x(u)})})}}i.keys.push(n);var v=new Promise(function(x,S){i.callbacks.push({resolve:x,reject:S})});return a&&a.set(c,v),v},"load"),e.loadMany=o(function(n){if(!bE(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],a=0;a<n.length;a++)i.push(this.load(n[a]).catch(function(c){return c}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var a=this._cacheKeyFn(n);i.delete(a)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var a=this._cacheMap;if(a){var c=this._cacheKeyFn(n);if(a.get(c)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),a.set(c,u)}}return this},"prime"),t}(),j$=typeof process=="object"&&typeof process.nextTick=="function"?function(t){Ng||(Ng=Promise.resolve()),Ng.then(function(){process.nextTick(t)})}:typeof setImmediate=="function"?function(t){setImmediate(t)}:function(t){setTimeout(t)},Ng;function G$(t){var e=t._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<t._maxBatchSize)return e;var r={hasDispatched:!1,keys:[],callbacks:[]};return t._batch=r,t._batchScheduleFn(function(){V$(t,r)}),r}o(G$,"getCurrentBatch");function V$(t,e){if(e.hasDispatched=!0,e.keys.length===0){Lg(e);return}var r;try{r=t._batchLoadFn(e.keys)}catch(n){return Pg(t,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(!r||typeof r.then!="function")return Pg(t,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(r)+".")));r.then(function(n){if(!bE(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."+(`
|
|
645
|
+
`}),b},"errorsToAscii"),Q=!1,Y=!1,oe=!1,j=!1,H=0,G;if(this.errors=[],Buffer.isBuffer(e))this.chars=a.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=a.decode("STRING",e);else throw new Error(`${r}input source is not a string, byte Buffer or character array`);this.sabnf=a.encode("STRING",this.chars),this.scan=o(function(T,h){this.lines=c(this.chars,this.errors,T,h),Q=!0},"scan"),this.parse=o(function(T,h){if(!Q)throw new Error(`${r}grammar not scanned`);u.syntax(this.chars,this.lines,this.errors,T,h),Y=!0},"parse"),this.translate=o(function(){if(!Y)throw new Error(`${r}grammar not scanned and parsed`);let T=u.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=T.rules,this.udts=T.udts,G=T.lineMap,oe=!0)},"translate"),this.attributes=o(function(){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return H=m(this.rules,this.udts,G,this.errors),j=!0,H},"attrs"),this.generate=o(function(T){if(this.lines=c(this.chars,this.errors,T),this.errors.length||(u.syntax(this.chars,this.lines,this.errors,T),this.errors.length))return;let h=u.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=h.rules,this.udts=h.udts,G=h.lineMap,H=m(this.rules,this.udts,G,this.errors),j=!0)},"generate"),this.displayRules=o(function(T="index"){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return O(this.rules,this.udts,T)},"displayRules"),this.displayRuleDependencies=o(function(T="index"){if(!j)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return S(T)},"displayRuleDependencies"),this.displayAttributes=o(function(T="index"){if(!j)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return H&&x(T),v(T)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!j)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return x()},"displayAttributeErrors"),this.toSource=o(function(T){if(!j)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${r}can't generate parser source - attributes have ${H} errors`);return u.generateSource(this.chars,this.lines,this.rules,this.udts,T)},"toSource"),this.toObject=o(function(){if(!j)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(H)throw new Error(`${r}can't generate parser source - attributes have ${H} errors`);return u.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return W(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(T){return B(this.errors,this.lines,this.chars,T)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return P(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return J(this.lines)},"linesToHtmlFunc")},"api")});var yb=De((v5,vb)=>{(function(t,e){"use strict";function r(b,l){if(!b)throw new Error(l||"Assertion failed")}o(r,"assert");function n(b,l){b.super_=l;var p=o(function(){},"TempCtor");p.prototype=l.prototype,b.prototype=new p,b.prototype.constructor=b}o(n,"inherits");function i(b,l,p){if(i.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((l==="le"||l==="be")&&(p=l,l=10),this._init(b||0,l||10,p||"be"))}o(i,"BN"),typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=zm().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,p){return l.cmp(p)>0?l:p},"max"),i.min=o(function(l,p){return l.cmp(p)<0?l:p},"min"),i.prototype._init=o(function(l,p,_){if(typeof l=="number")return this._initNumber(l,p,_);if(typeof l=="object")return this._initArray(l,p,_);p==="hex"&&(p=16),r(p===(p|0)&&p>=2&&p<=36),l=l.toString().replace(/\s+/g,"");var A=0;l[0]==="-"&&(A++,this.negative=1),A<l.length&&(p===16?this._parseHex(l,A,_):(this._parseBase(l,p,A),_==="le"&&this._initArray(this.toArray(),p,_)))},"init"),i.prototype._initNumber=o(function(l,p,_){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):(r(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),p,_)},"_initNumber"),i.prototype._initArray=o(function(l,p,_){if(r(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 A=0;A<this.length;A++)this.words[A]=0;var E,g,C=0;if(_==="be")for(A=l.length-1,E=0;A>=0;A-=3)g=l[A]|l[A-1]<<8|l[A-2]<<16,this.words[E]|=g<<C&67108863,this.words[E+1]=g>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);else if(_==="le")for(A=0,E=0;A<l.length;A+=3)g=l[A]|l[A+1]<<8|l[A+2]<<16,this.words[E]|=g<<C&67108863,this.words[E+1]=g>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);return this._strip()},"_initArray");function c(b,l){var p=b.charCodeAt(l);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;r(!1,"Invalid character in "+b)}o(c,"parseHex4Bits");function u(b,l,p){var _=c(b,p);return p-1>=l&&(_|=c(b,p-1)<<4),_}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,p,_){this.length=Math.ceil((l.length-p)/6),this.words=new Array(this.length);for(var A=0;A<this.length;A++)this.words[A]=0;var E=0,g=0,C;if(_==="be")for(A=l.length-1;A>=p;A-=2)C=u(l,p,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8;else{var N=l.length-p;for(A=N%2===0?p+1:p;A<l.length;A+=2)C=u(l,p,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8}this._strip()},"_parseHex");function m(b,l,p,_){for(var A=0,E=0,g=Math.min(b.length,p),C=l;C<g;C++){var N=b.charCodeAt(C)-48;A*=_,N>=49?E=N-49+10:N>=17?E=N-17+10:E=N,r(N>=0&&E<_,"Invalid character"),A+=E}return A}o(m,"parseBase"),i.prototype._parseBase=o(function(l,p,_){this.words=[0],this.length=1;for(var A=0,E=1;E<=67108863;E*=p)A++;A--,E=E/p|0;for(var g=l.length-_,C=g%A,N=Math.min(g,g-C)+_,w=0,k=_;k<N;k+=A)w=m(l,k,k+A,p),this.imuln(E),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(C!==0){var he=1;for(w=m(l,k,l.length,p),k=0;k<C;k++)he*=p;this.imuln(he),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this._strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var p=0;p<this.length;p++)l.words[p]=this.words[p];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy");function v(b,l){b.words=l.words,b.length=l.length,b.negative=l.negative,b.red=l.red}if(o(v,"move"),i.prototype._move=o(function(l){v(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")]=x}catch{i.prototype.inspect=x}else i.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(x,"inspect");var S=["","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,p){l=l||10,p=p|0||1;var _;if(l===16||l==="hex"){_="";for(var A=0,E=0,g=0;g<this.length;g++){var C=this.words[g],N=((C<<A|E)&16777215).toString(16);E=C>>>24-A&16777215,A+=2,A>=26&&(A-=26,g--),E!==0||g!==this.length-1?_=S[6-N.length]+N+_:_=N+_}for(E!==0&&(_=E.toString(16)+_);_.length%p!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(l===(l|0)&&l>=2&&l<=36){var w=O[l],k=R[l];_="";var he=this.clone();for(he.negative=0;!he.isZero();){var I=he.modrn(k).toString(l);he=he.idivn(k),he.isZero()?_=I+_:_=S[w-I.length]+I+_}for(this.isZero()&&(_="0"+_);_.length%p!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}r(!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&&r(!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"),a&&(i.prototype.toBuffer=o(function(l,p){return this.toArrayLike(a,l,p)},"toBuffer")),i.prototype.toArray=o(function(l,p){return this.toArrayLike(Array,l,p)},"toArray");var D=o(function(l,p){return l.allocUnsafe?l.allocUnsafe(p):new l(p)},"allocate");i.prototype.toArrayLike=o(function(l,p,_){this._strip();var A=this.byteLength(),E=_||Math.max(1,A);r(A<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0");var g=D(l,E),C=p==="le"?"LE":"BE";return this["_toArrayLike"+C](g,A),g},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,p){for(var _=0,A=0,E=0,g=0;E<this.length;E++){var C=this.words[E]<<g|A;l[_++]=C&255,_<l.length&&(l[_++]=C>>8&255),_<l.length&&(l[_++]=C>>16&255),g===6?(_<l.length&&(l[_++]=C>>24&255),A=0,g=0):(A=C>>>24,g+=2)}if(_<l.length)for(l[_++]=A;_<l.length;)l[_++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(l,p){for(var _=l.length-1,A=0,E=0,g=0;E<this.length;E++){var C=this.words[E]<<g|A;l[_--]=C&255,_>=0&&(l[_--]=C>>8&255),_>=0&&(l[_--]=C>>16&255),g===6?(_>=0&&(l[_--]=C>>24&255),A=0,g=0):(A=C>>>24,g+=2)}if(_>=0)for(l[_--]=A;_>=0;)l[_--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var p=l,_=0;return p>=4096&&(_+=13,p>>>=13),p>=64&&(_+=7,p>>>=7),p>=8&&(_+=4,p>>>=4),p>=2&&(_+=2,p>>>=2),_+p},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var p=l,_=0;return(p&8191)===0&&(_+=13,p>>>=13),(p&127)===0&&(_+=7,p>>>=7),(p&15)===0&&(_+=4,p>>>=4),(p&3)===0&&(_+=2,p>>>=2),(p&1)===0&&_++,_},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],p=this._countBits(l);return(this.length-1)*26+p},"bitLength");function P(b){for(var l=new Array(b.bitLength()),p=0;p<l.length;p++){var _=p/26|0,A=p%26;l[p]=b.words[_]>>>A&1}return l}o(P,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,p=0;p<this.length;p++){var _=this._zeroBits(this.words[p]);if(l+=_,_!==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 p=0;p<l.length;p++)this.words[p]=this.words[p]|l.words[p];return this._strip()},"iuor"),i.prototype.ior=o(function(l){return r((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 p;this.length>l.length?p=l:p=this;for(var _=0;_<p.length;_++)this.words[_]=this.words[_]&l.words[_];return this.length=p.length,this._strip()},"iuand"),i.prototype.iand=o(function(l){return r((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 p,_;this.length>l.length?(p=this,_=l):(p=l,_=this);for(var A=0;A<_.length;A++)this.words[A]=p.words[A]^_.words[A];if(this!==p)for(;A<p.length;A++)this.words[A]=p.words[A];return this.length=p.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(l){return r((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){r(typeof l=="number"&&l>=0);var p=Math.ceil(l/26)|0,_=l%26;this._expand(p),_>0&&p--;for(var A=0;A<p;A++)this.words[A]=~this.words[A]&67108863;return _>0&&(this.words[A]=~this.words[A]&67108863>>26-_),this._strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,p){r(typeof l=="number"&&l>=0);var _=l/26|0,A=l%26;return this._expand(_+1),p?this.words[_]=this.words[_]|1<<A:this.words[_]=this.words[_]&~(1<<A),this._strip()},"setn"),i.prototype.iadd=o(function(l){var p;if(this.negative!==0&&l.negative===0)return this.negative=0,p=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,p=this.isub(l),l.negative=1,p._normSign();var _,A;this.length>l.length?(_=this,A=l):(_=l,A=this);for(var E=0,g=0;g<A.length;g++)p=(_.words[g]|0)+(A.words[g]|0)+E,this.words[g]=p&67108863,E=p>>>26;for(;E!==0&&g<_.length;g++)p=(_.words[g]|0)+E,this.words[g]=p&67108863,E=p>>>26;if(this.length=_.length,E!==0)this.words[this.length]=E,this.length++;else if(_!==this)for(;g<_.length;g++)this.words[g]=_.words[g];return this},"iadd"),i.prototype.add=o(function(l){var p;return l.negative!==0&&this.negative===0?(l.negative=0,p=this.sub(l),l.negative^=1,p):l.negative===0&&this.negative!==0?(this.negative=0,p=l.sub(this),this.negative=1,p):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 p=this.iadd(l);return l.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var _=this.cmp(l);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var A,E;_>0?(A=this,E=l):(A=l,E=this);for(var g=0,C=0;C<E.length;C++)p=(A.words[C]|0)-(E.words[C]|0)+g,g=p>>26,this.words[C]=p&67108863;for(;g!==0&&C<A.length;C++)p=(A.words[C]|0)+g,g=p>>26,this.words[C]=p&67108863;if(g===0&&C<A.length&&A!==this)for(;C<A.length;C++)this.words[C]=A.words[C];return this.length=Math.max(this.length,C),A!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function J(b,l,p){p.negative=l.negative^b.negative;var _=b.length+l.length|0;p.length=_,_=_-1|0;var A=b.words[0]|0,E=l.words[0]|0,g=A*E,C=g&67108863,N=g/67108864|0;p.words[0]=C;for(var w=1;w<_;w++){for(var k=N>>>26,he=N&67108863,I=Math.min(w,l.length-1),Z=Math.max(0,w-b.length+1);Z<=I;Z++){var se=w-Z|0;A=b.words[se]|0,E=l.words[Z]|0,g=A*E+he,k+=g/67108864|0,he=g&67108863}p.words[w]=he|0,N=k|0}return N!==0?p.words[w]=N|0:p.length--,p._strip()}o(J,"smallMulTo");var B=o(function(l,p,_){var A=l.words,E=p.words,g=_.words,C=0,N,w,k,he=A[0]|0,I=he&8191,Z=he>>>13,se=A[1]|0,q=se&8191,F=se>>>13,ee=A[2]|0,ne=ee&8191,ae=ee>>>13,Ae=A[3]|0,ge=Ae&8191,re=Ae>>>13,Se=A[4]|0,ce=Se&8191,ve=Se>>>13,V=A[5]|0,pe=V&8191,Ce=V>>>13,He=A[6]|0,Re=He&8191,Ve=He>>>13,pr=A[7]|0,ue=pr&8191,ie=pr>>>13,$=A[8]|0,X=$&8191,me=$>>>13,ye=A[9]|0,we=ye&8191,ke=ye>>>13,It=E[0]|0,Ue=It&8191,Oe=It>>>13,Bt=E[1]|0,je=Bt&8191,Je=Bt>>>13,Tn=E[2]|0,nt=Tn&8191,it=Tn>>>13,Yn=E[3]|0,ot=Yn&8191,et=Yn>>>13,Xn=E[4]|0,st=Xn&8191,at=Xn>>>13,cn=E[5]|0,ft=cn&8191,Xe=cn>>>13,Zn=E[6]|0,ct=Zn&8191,ut=Zn>>>13,Qn=E[7]|0,lt=Qn&8191,ht=Qn>>>13,ei=E[8]|0,dt=ei&8191,tt=ei>>>13,Cn=E[9]|0,Ft=Cn&8191,qt=Cn>>>13;_.negative=l.negative^p.negative,_.length=19,N=Math.imul(I,Ue),w=Math.imul(I,Oe),w=w+Math.imul(Z,Ue)|0,k=Math.imul(Z,Oe);var un=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(un>>>26)|0,un&=67108863,N=Math.imul(q,Ue),w=Math.imul(q,Oe),w=w+Math.imul(F,Ue)|0,k=Math.imul(F,Oe),N=N+Math.imul(I,je)|0,w=w+Math.imul(I,Je)|0,w=w+Math.imul(Z,je)|0,k=k+Math.imul(Z,Je)|0;var ln=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ln>>>26)|0,ln&=67108863,N=Math.imul(ne,Ue),w=Math.imul(ne,Oe),w=w+Math.imul(ae,Ue)|0,k=Math.imul(ae,Oe),N=N+Math.imul(q,je)|0,w=w+Math.imul(q,Je)|0,w=w+Math.imul(F,je)|0,k=k+Math.imul(F,Je)|0,N=N+Math.imul(I,nt)|0,w=w+Math.imul(I,it)|0,w=w+Math.imul(Z,nt)|0,k=k+Math.imul(Z,it)|0;var hn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(hn>>>26)|0,hn&=67108863,N=Math.imul(ge,Ue),w=Math.imul(ge,Oe),w=w+Math.imul(re,Ue)|0,k=Math.imul(re,Oe),N=N+Math.imul(ne,je)|0,w=w+Math.imul(ne,Je)|0,w=w+Math.imul(ae,je)|0,k=k+Math.imul(ae,Je)|0,N=N+Math.imul(q,nt)|0,w=w+Math.imul(q,it)|0,w=w+Math.imul(F,nt)|0,k=k+Math.imul(F,it)|0,N=N+Math.imul(I,ot)|0,w=w+Math.imul(I,et)|0,w=w+Math.imul(Z,ot)|0,k=k+Math.imul(Z,et)|0;var Nr=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,N=Math.imul(ce,Ue),w=Math.imul(ce,Oe),w=w+Math.imul(ve,Ue)|0,k=Math.imul(ve,Oe),N=N+Math.imul(ge,je)|0,w=w+Math.imul(ge,Je)|0,w=w+Math.imul(re,je)|0,k=k+Math.imul(re,Je)|0,N=N+Math.imul(ne,nt)|0,w=w+Math.imul(ne,it)|0,w=w+Math.imul(ae,nt)|0,k=k+Math.imul(ae,it)|0,N=N+Math.imul(q,ot)|0,w=w+Math.imul(q,et)|0,w=w+Math.imul(F,ot)|0,k=k+Math.imul(F,et)|0,N=N+Math.imul(I,st)|0,w=w+Math.imul(I,at)|0,w=w+Math.imul(Z,st)|0,k=k+Math.imul(Z,at)|0;var dn=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,N=Math.imul(pe,Ue),w=Math.imul(pe,Oe),w=w+Math.imul(Ce,Ue)|0,k=Math.imul(Ce,Oe),N=N+Math.imul(ce,je)|0,w=w+Math.imul(ce,Je)|0,w=w+Math.imul(ve,je)|0,k=k+Math.imul(ve,Je)|0,N=N+Math.imul(ge,nt)|0,w=w+Math.imul(ge,it)|0,w=w+Math.imul(re,nt)|0,k=k+Math.imul(re,it)|0,N=N+Math.imul(ne,ot)|0,w=w+Math.imul(ne,et)|0,w=w+Math.imul(ae,ot)|0,k=k+Math.imul(ae,et)|0,N=N+Math.imul(q,st)|0,w=w+Math.imul(q,at)|0,w=w+Math.imul(F,st)|0,k=k+Math.imul(F,at)|0,N=N+Math.imul(I,ft)|0,w=w+Math.imul(I,Xe)|0,w=w+Math.imul(Z,ft)|0,k=k+Math.imul(Z,Xe)|0;var ti=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ti>>>26)|0,ti&=67108863,N=Math.imul(Re,Ue),w=Math.imul(Re,Oe),w=w+Math.imul(Ve,Ue)|0,k=Math.imul(Ve,Oe),N=N+Math.imul(pe,je)|0,w=w+Math.imul(pe,Je)|0,w=w+Math.imul(Ce,je)|0,k=k+Math.imul(Ce,Je)|0,N=N+Math.imul(ce,nt)|0,w=w+Math.imul(ce,it)|0,w=w+Math.imul(ve,nt)|0,k=k+Math.imul(ve,it)|0,N=N+Math.imul(ge,ot)|0,w=w+Math.imul(ge,et)|0,w=w+Math.imul(re,ot)|0,k=k+Math.imul(re,et)|0,N=N+Math.imul(ne,st)|0,w=w+Math.imul(ne,at)|0,w=w+Math.imul(ae,st)|0,k=k+Math.imul(ae,at)|0,N=N+Math.imul(q,ft)|0,w=w+Math.imul(q,Xe)|0,w=w+Math.imul(F,ft)|0,k=k+Math.imul(F,Xe)|0,N=N+Math.imul(I,ct)|0,w=w+Math.imul(I,ut)|0,w=w+Math.imul(Z,ct)|0,k=k+Math.imul(Z,ut)|0;var So=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(So>>>26)|0,So&=67108863,N=Math.imul(ue,Ue),w=Math.imul(ue,Oe),w=w+Math.imul(ie,Ue)|0,k=Math.imul(ie,Oe),N=N+Math.imul(Re,je)|0,w=w+Math.imul(Re,Je)|0,w=w+Math.imul(Ve,je)|0,k=k+Math.imul(Ve,Je)|0,N=N+Math.imul(pe,nt)|0,w=w+Math.imul(pe,it)|0,w=w+Math.imul(Ce,nt)|0,k=k+Math.imul(Ce,it)|0,N=N+Math.imul(ce,ot)|0,w=w+Math.imul(ce,et)|0,w=w+Math.imul(ve,ot)|0,k=k+Math.imul(ve,et)|0,N=N+Math.imul(ge,st)|0,w=w+Math.imul(ge,at)|0,w=w+Math.imul(re,st)|0,k=k+Math.imul(re,at)|0,N=N+Math.imul(ne,ft)|0,w=w+Math.imul(ne,Xe)|0,w=w+Math.imul(ae,ft)|0,k=k+Math.imul(ae,Xe)|0,N=N+Math.imul(q,ct)|0,w=w+Math.imul(q,ut)|0,w=w+Math.imul(F,ct)|0,k=k+Math.imul(F,ut)|0,N=N+Math.imul(I,lt)|0,w=w+Math.imul(I,ht)|0,w=w+Math.imul(Z,lt)|0,k=k+Math.imul(Z,ht)|0;var Mo=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,N=Math.imul(X,Ue),w=Math.imul(X,Oe),w=w+Math.imul(me,Ue)|0,k=Math.imul(me,Oe),N=N+Math.imul(ue,je)|0,w=w+Math.imul(ue,Je)|0,w=w+Math.imul(ie,je)|0,k=k+Math.imul(ie,Je)|0,N=N+Math.imul(Re,nt)|0,w=w+Math.imul(Re,it)|0,w=w+Math.imul(Ve,nt)|0,k=k+Math.imul(Ve,it)|0,N=N+Math.imul(pe,ot)|0,w=w+Math.imul(pe,et)|0,w=w+Math.imul(Ce,ot)|0,k=k+Math.imul(Ce,et)|0,N=N+Math.imul(ce,st)|0,w=w+Math.imul(ce,at)|0,w=w+Math.imul(ve,st)|0,k=k+Math.imul(ve,at)|0,N=N+Math.imul(ge,ft)|0,w=w+Math.imul(ge,Xe)|0,w=w+Math.imul(re,ft)|0,k=k+Math.imul(re,Xe)|0,N=N+Math.imul(ne,ct)|0,w=w+Math.imul(ne,ut)|0,w=w+Math.imul(ae,ct)|0,k=k+Math.imul(ae,ut)|0,N=N+Math.imul(q,lt)|0,w=w+Math.imul(q,ht)|0,w=w+Math.imul(F,lt)|0,k=k+Math.imul(F,ht)|0,N=N+Math.imul(I,dt)|0,w=w+Math.imul(I,tt)|0,w=w+Math.imul(Z,dt)|0,k=k+Math.imul(Z,tt)|0;var To=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(To>>>26)|0,To&=67108863,N=Math.imul(we,Ue),w=Math.imul(we,Oe),w=w+Math.imul(ke,Ue)|0,k=Math.imul(ke,Oe),N=N+Math.imul(X,je)|0,w=w+Math.imul(X,Je)|0,w=w+Math.imul(me,je)|0,k=k+Math.imul(me,Je)|0,N=N+Math.imul(ue,nt)|0,w=w+Math.imul(ue,it)|0,w=w+Math.imul(ie,nt)|0,k=k+Math.imul(ie,it)|0,N=N+Math.imul(Re,ot)|0,w=w+Math.imul(Re,et)|0,w=w+Math.imul(Ve,ot)|0,k=k+Math.imul(Ve,et)|0,N=N+Math.imul(pe,st)|0,w=w+Math.imul(pe,at)|0,w=w+Math.imul(Ce,st)|0,k=k+Math.imul(Ce,at)|0,N=N+Math.imul(ce,ft)|0,w=w+Math.imul(ce,Xe)|0,w=w+Math.imul(ve,ft)|0,k=k+Math.imul(ve,Xe)|0,N=N+Math.imul(ge,ct)|0,w=w+Math.imul(ge,ut)|0,w=w+Math.imul(re,ct)|0,k=k+Math.imul(re,ut)|0,N=N+Math.imul(ne,lt)|0,w=w+Math.imul(ne,ht)|0,w=w+Math.imul(ae,lt)|0,k=k+Math.imul(ae,ht)|0,N=N+Math.imul(q,dt)|0,w=w+Math.imul(q,tt)|0,w=w+Math.imul(F,dt)|0,k=k+Math.imul(F,tt)|0,N=N+Math.imul(I,Ft)|0,w=w+Math.imul(I,qt)|0,w=w+Math.imul(Z,Ft)|0,k=k+Math.imul(Z,qt)|0;var Xi=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,N=Math.imul(we,je),w=Math.imul(we,Je),w=w+Math.imul(ke,je)|0,k=Math.imul(ke,Je),N=N+Math.imul(X,nt)|0,w=w+Math.imul(X,it)|0,w=w+Math.imul(me,nt)|0,k=k+Math.imul(me,it)|0,N=N+Math.imul(ue,ot)|0,w=w+Math.imul(ue,et)|0,w=w+Math.imul(ie,ot)|0,k=k+Math.imul(ie,et)|0,N=N+Math.imul(Re,st)|0,w=w+Math.imul(Re,at)|0,w=w+Math.imul(Ve,st)|0,k=k+Math.imul(Ve,at)|0,N=N+Math.imul(pe,ft)|0,w=w+Math.imul(pe,Xe)|0,w=w+Math.imul(Ce,ft)|0,k=k+Math.imul(Ce,Xe)|0,N=N+Math.imul(ce,ct)|0,w=w+Math.imul(ce,ut)|0,w=w+Math.imul(ve,ct)|0,k=k+Math.imul(ve,ut)|0,N=N+Math.imul(ge,lt)|0,w=w+Math.imul(ge,ht)|0,w=w+Math.imul(re,lt)|0,k=k+Math.imul(re,ht)|0,N=N+Math.imul(ne,dt)|0,w=w+Math.imul(ne,tt)|0,w=w+Math.imul(ae,dt)|0,k=k+Math.imul(ae,tt)|0,N=N+Math.imul(q,Ft)|0,w=w+Math.imul(q,qt)|0,w=w+Math.imul(F,Ft)|0,k=k+Math.imul(F,qt)|0;var Zi=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,N=Math.imul(we,nt),w=Math.imul(we,it),w=w+Math.imul(ke,nt)|0,k=Math.imul(ke,it),N=N+Math.imul(X,ot)|0,w=w+Math.imul(X,et)|0,w=w+Math.imul(me,ot)|0,k=k+Math.imul(me,et)|0,N=N+Math.imul(ue,st)|0,w=w+Math.imul(ue,at)|0,w=w+Math.imul(ie,st)|0,k=k+Math.imul(ie,at)|0,N=N+Math.imul(Re,ft)|0,w=w+Math.imul(Re,Xe)|0,w=w+Math.imul(Ve,ft)|0,k=k+Math.imul(Ve,Xe)|0,N=N+Math.imul(pe,ct)|0,w=w+Math.imul(pe,ut)|0,w=w+Math.imul(Ce,ct)|0,k=k+Math.imul(Ce,ut)|0,N=N+Math.imul(ce,lt)|0,w=w+Math.imul(ce,ht)|0,w=w+Math.imul(ve,lt)|0,k=k+Math.imul(ve,ht)|0,N=N+Math.imul(ge,dt)|0,w=w+Math.imul(ge,tt)|0,w=w+Math.imul(re,dt)|0,k=k+Math.imul(re,tt)|0,N=N+Math.imul(ne,Ft)|0,w=w+Math.imul(ne,qt)|0,w=w+Math.imul(ae,Ft)|0,k=k+Math.imul(ae,qt)|0;var Qi=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,N=Math.imul(we,ot),w=Math.imul(we,et),w=w+Math.imul(ke,ot)|0,k=Math.imul(ke,et),N=N+Math.imul(X,st)|0,w=w+Math.imul(X,at)|0,w=w+Math.imul(me,st)|0,k=k+Math.imul(me,at)|0,N=N+Math.imul(ue,ft)|0,w=w+Math.imul(ue,Xe)|0,w=w+Math.imul(ie,ft)|0,k=k+Math.imul(ie,Xe)|0,N=N+Math.imul(Re,ct)|0,w=w+Math.imul(Re,ut)|0,w=w+Math.imul(Ve,ct)|0,k=k+Math.imul(Ve,ut)|0,N=N+Math.imul(pe,lt)|0,w=w+Math.imul(pe,ht)|0,w=w+Math.imul(Ce,lt)|0,k=k+Math.imul(Ce,ht)|0,N=N+Math.imul(ce,dt)|0,w=w+Math.imul(ce,tt)|0,w=w+Math.imul(ve,dt)|0,k=k+Math.imul(ve,tt)|0,N=N+Math.imul(ge,Ft)|0,w=w+Math.imul(ge,qt)|0,w=w+Math.imul(re,Ft)|0,k=k+Math.imul(re,qt)|0;var Co=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Co>>>26)|0,Co&=67108863,N=Math.imul(we,st),w=Math.imul(we,at),w=w+Math.imul(ke,st)|0,k=Math.imul(ke,at),N=N+Math.imul(X,ft)|0,w=w+Math.imul(X,Xe)|0,w=w+Math.imul(me,ft)|0,k=k+Math.imul(me,Xe)|0,N=N+Math.imul(ue,ct)|0,w=w+Math.imul(ue,ut)|0,w=w+Math.imul(ie,ct)|0,k=k+Math.imul(ie,ut)|0,N=N+Math.imul(Re,lt)|0,w=w+Math.imul(Re,ht)|0,w=w+Math.imul(Ve,lt)|0,k=k+Math.imul(Ve,ht)|0,N=N+Math.imul(pe,dt)|0,w=w+Math.imul(pe,tt)|0,w=w+Math.imul(Ce,dt)|0,k=k+Math.imul(Ce,tt)|0,N=N+Math.imul(ce,Ft)|0,w=w+Math.imul(ce,qt)|0,w=w+Math.imul(ve,Ft)|0,k=k+Math.imul(ve,qt)|0;var ko=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ko>>>26)|0,ko&=67108863,N=Math.imul(we,ft),w=Math.imul(we,Xe),w=w+Math.imul(ke,ft)|0,k=Math.imul(ke,Xe),N=N+Math.imul(X,ct)|0,w=w+Math.imul(X,ut)|0,w=w+Math.imul(me,ct)|0,k=k+Math.imul(me,ut)|0,N=N+Math.imul(ue,lt)|0,w=w+Math.imul(ue,ht)|0,w=w+Math.imul(ie,lt)|0,k=k+Math.imul(ie,ht)|0,N=N+Math.imul(Re,dt)|0,w=w+Math.imul(Re,tt)|0,w=w+Math.imul(Ve,dt)|0,k=k+Math.imul(Ve,tt)|0,N=N+Math.imul(pe,Ft)|0,w=w+Math.imul(pe,qt)|0,w=w+Math.imul(Ce,Ft)|0,k=k+Math.imul(Ce,qt)|0;var Io=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Io>>>26)|0,Io&=67108863,N=Math.imul(we,ct),w=Math.imul(we,ut),w=w+Math.imul(ke,ct)|0,k=Math.imul(ke,ut),N=N+Math.imul(X,lt)|0,w=w+Math.imul(X,ht)|0,w=w+Math.imul(me,lt)|0,k=k+Math.imul(me,ht)|0,N=N+Math.imul(ue,dt)|0,w=w+Math.imul(ue,tt)|0,w=w+Math.imul(ie,dt)|0,k=k+Math.imul(ie,tt)|0,N=N+Math.imul(Re,Ft)|0,w=w+Math.imul(Re,qt)|0,w=w+Math.imul(Ve,Ft)|0,k=k+Math.imul(Ve,qt)|0;var Do=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Do>>>26)|0,Do&=67108863,N=Math.imul(we,lt),w=Math.imul(we,ht),w=w+Math.imul(ke,lt)|0,k=Math.imul(ke,ht),N=N+Math.imul(X,dt)|0,w=w+Math.imul(X,tt)|0,w=w+Math.imul(me,dt)|0,k=k+Math.imul(me,tt)|0,N=N+Math.imul(ue,Ft)|0,w=w+Math.imul(ue,qt)|0,w=w+Math.imul(ie,Ft)|0,k=k+Math.imul(ie,qt)|0;var yf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(yf>>>26)|0,yf&=67108863,N=Math.imul(we,dt),w=Math.imul(we,tt),w=w+Math.imul(ke,dt)|0,k=Math.imul(ke,tt),N=N+Math.imul(X,Ft)|0,w=w+Math.imul(X,qt)|0,w=w+Math.imul(me,Ft)|0,k=k+Math.imul(me,qt)|0;var xf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(xf>>>26)|0,xf&=67108863,N=Math.imul(we,Ft),w=Math.imul(we,qt),w=w+Math.imul(ke,Ft)|0,k=Math.imul(ke,qt);var wf=(C+N|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(wf>>>26)|0,wf&=67108863,g[0]=un,g[1]=ln,g[2]=hn,g[3]=Nr,g[4]=dn,g[5]=ti,g[6]=So,g[7]=Mo,g[8]=To,g[9]=Xi,g[10]=Zi,g[11]=Qi,g[12]=Co,g[13]=ko,g[14]=Io,g[15]=Do,g[16]=yf,g[17]=xf,g[18]=wf,C!==0&&(g[19]=C,_.length++),_},"comb10MulTo");Math.imul||(B=J);function W(b,l,p){p.negative=l.negative^b.negative,p.length=b.length+l.length;for(var _=0,A=0,E=0;E<p.length-1;E++){var g=A;A=0;for(var C=_&67108863,N=Math.min(E,l.length-1),w=Math.max(0,E-b.length+1);w<=N;w++){var k=E-w,he=b.words[k]|0,I=l.words[w]|0,Z=he*I,se=Z&67108863;g=g+(Z/67108864|0)|0,se=se+C|0,C=se&67108863,g=g+(se>>>26)|0,A+=g>>>26,g&=67108863}p.words[E]=C,_=g,g=A}return _!==0?p.words[E]=_:p.length--,p._strip()}o(W,"bigMulTo");function Q(b,l,p){return W(b,l,p)}o(Q,"jumboMulTo"),i.prototype.mulTo=o(function(l,p){var _,A=this.length+l.length;return this.length===10&&l.length===10?_=B(this,l,p):A<63?_=J(this,l,p):A<1024?_=W(this,l,p):_=Q(this,l,p),_},"mulTo");function Y(b,l){this.x=b,this.y=l}o(Y,"FFTM"),Y.prototype.makeRBT=o(function(l){for(var p=new Array(l),_=i.prototype._countBits(l)-1,A=0;A<l;A++)p[A]=this.revBin(A,_,l);return p},"makeRBT"),Y.prototype.revBin=o(function(l,p,_){if(l===0||l===_-1)return l;for(var A=0,E=0;E<p;E++)A|=(l&1)<<p-E-1,l>>=1;return A},"revBin"),Y.prototype.permute=o(function(l,p,_,A,E,g){for(var C=0;C<g;C++)A[C]=p[l[C]],E[C]=_[l[C]]},"permute"),Y.prototype.transform=o(function(l,p,_,A,E,g){this.permute(g,l,p,_,A,E);for(var C=1;C<E;C<<=1)for(var N=C<<1,w=Math.cos(2*Math.PI/N),k=Math.sin(2*Math.PI/N),he=0;he<E;he+=N)for(var I=w,Z=k,se=0;se<C;se++){var q=_[he+se],F=A[he+se],ee=_[he+se+C],ne=A[he+se+C],ae=I*ee-Z*ne;ne=I*ne+Z*ee,ee=ae,_[he+se]=q+ee,A[he+se]=F+ne,_[he+se+C]=q-ee,A[he+se+C]=F-ne,se!==N&&(ae=w*I-k*Z,Z=w*Z+k*I,I=ae)}},"transform"),Y.prototype.guessLen13b=o(function(l,p){var _=Math.max(p,l)|1,A=_&1,E=0;for(_=_/2|0;_;_=_>>>1)E++;return 1<<E+1+A},"guessLen13b"),Y.prototype.conjugate=o(function(l,p,_){if(!(_<=1))for(var A=0;A<_/2;A++){var E=l[A];l[A]=l[_-A-1],l[_-A-1]=E,E=p[A],p[A]=-p[_-A-1],p[_-A-1]=-E}},"conjugate"),Y.prototype.normalize13b=o(function(l,p){for(var _=0,A=0;A<p/2;A++){var E=Math.round(l[2*A+1]/p)*8192+Math.round(l[2*A]/p)+_;l[A]=E&67108863,E<67108864?_=0:_=E/67108864|0}return l},"normalize13b"),Y.prototype.convert13b=o(function(l,p,_,A){for(var E=0,g=0;g<p;g++)E=E+(l[g]|0),_[2*g]=E&8191,E=E>>>13,_[2*g+1]=E&8191,E=E>>>13;for(g=2*p;g<A;++g)_[g]=0;r(E===0),r((E&-8192)===0)},"convert13b"),Y.prototype.stub=o(function(l){for(var p=new Array(l),_=0;_<l;_++)p[_]=0;return p},"stub"),Y.prototype.mulp=o(function(l,p,_){var A=2*this.guessLen13b(l.length,p.length),E=this.makeRBT(A),g=this.stub(A),C=new Array(A),N=new Array(A),w=new Array(A),k=new Array(A),he=new Array(A),I=new Array(A),Z=_.words;Z.length=A,this.convert13b(l.words,l.length,C,A),this.convert13b(p.words,p.length,k,A),this.transform(C,g,N,w,A,E),this.transform(k,g,he,I,A,E);for(var se=0;se<A;se++){var q=N[se]*he[se]-w[se]*I[se];w[se]=N[se]*I[se]+w[se]*he[se],N[se]=q}return this.conjugate(N,w,A),this.transform(N,w,Z,g,A,E),this.conjugate(Z,g,A),this.normalize13b(Z,A),_.negative=l.negative^p.negative,_.length=l.length+p.length,_._strip()},"mulp"),i.prototype.mul=o(function(l){var p=new i(null);return p.words=new Array(this.length+l.length),this.mulTo(l,p)},"mul"),i.prototype.mulf=o(function(l){var p=new i(null);return p.words=new Array(this.length+l.length),Q(this,l,p)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var p=l<0;p&&(l=-l),r(typeof l=="number"),r(l<67108864);for(var _=0,A=0;A<this.length;A++){var E=(this.words[A]|0)*l,g=(E&67108863)+(_&67108863);_>>=26,_+=E/67108864|0,_+=g>>>26,this.words[A]=g&67108863}return _!==0&&(this.words[A]=_,this.length++),p?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 p=P(l);if(p.length===0)return new i(1);for(var _=this,A=0;A<p.length&&p[A]===0;A++,_=_.sqr());if(++A<p.length)for(var E=_.sqr();A<p.length;A++,E=E.sqr())p[A]!==0&&(_=_.mul(E));return _},"pow"),i.prototype.iushln=o(function(l){r(typeof l=="number"&&l>=0);var p=l%26,_=(l-p)/26,A=67108863>>>26-p<<26-p,E;if(p!==0){var g=0;for(E=0;E<this.length;E++){var C=this.words[E]&A,N=(this.words[E]|0)-C<<p;this.words[E]=N|g,g=C>>>26-p}g&&(this.words[E]=g,this.length++)}if(_!==0){for(E=this.length-1;E>=0;E--)this.words[E+_]=this.words[E];for(E=0;E<_;E++)this.words[E]=0;this.length+=_}return this._strip()},"iushln"),i.prototype.ishln=o(function(l){return r(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,p,_){r(typeof l=="number"&&l>=0);var A;p?A=(p-p%26)/26:A=0;var E=l%26,g=Math.min((l-E)/26,this.length),C=67108863^67108863>>>E<<E,N=_;if(A-=g,A=Math.max(0,A),N){for(var w=0;w<g;w++)N.words[w]=this.words[w];N.length=g}if(g!==0)if(this.length>g)for(this.length-=g,w=0;w<this.length;w++)this.words[w]=this.words[w+g];else this.words[0]=0,this.length=1;var k=0;for(w=this.length-1;w>=0&&(k!==0||w>=A);w--){var he=this.words[w]|0;this.words[w]=k<<26-E|he>>>E,k=he&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,p,_){return r(this.negative===0),this.iushrn(l,p,_)},"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){r(typeof l=="number"&&l>=0);var p=l%26,_=(l-p)/26,A=1<<p;if(this.length<=_)return!1;var E=this.words[_];return!!(E&A)},"testn"),i.prototype.imaskn=o(function(l){r(typeof l=="number"&&l>=0);var p=l%26,_=(l-p)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(p!==0&&_++,this.length=Math.min(_,this.length),p!==0){var A=67108863^67108863>>>p<<p;this.words[this.length-1]&=A}return this._strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return r(typeof l=="number"),r(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 p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},"_iaddn"),i.prototype.isubn=o(function(l){if(r(typeof l=="number"),r(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 p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+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,p,_){var A=l.length+_,E;this._expand(A);var g,C=0;for(E=0;E<l.length;E++){g=(this.words[E+_]|0)+C;var N=(l.words[E]|0)*p;g-=N&67108863,C=(g>>26)-(N/67108864|0),this.words[E+_]=g&67108863}for(;E<this.length-_;E++)g=(this.words[E+_]|0)+C,C=g>>26,this.words[E+_]=g&67108863;if(C===0)return this._strip();for(r(C===-1),C=0,E=0;E<this.length;E++)g=-(this.words[E]|0)+C,C=g>>26,this.words[E]=g&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,p){var _=this.length-l.length,A=this.clone(),E=l,g=E.words[E.length-1]|0,C=this._countBits(g);_=26-C,_!==0&&(E=E.ushln(_),A.iushln(_),g=E.words[E.length-1]|0);var N=A.length-E.length,w;if(p!=="mod"){w=new i(null),w.length=N+1,w.words=new Array(w.length);for(var k=0;k<w.length;k++)w.words[k]=0}var he=A.clone()._ishlnsubmul(E,1,N);he.negative===0&&(A=he,w&&(w.words[N]=1));for(var I=N-1;I>=0;I--){var Z=(A.words[E.length+I]|0)*67108864+(A.words[E.length+I-1]|0);for(Z=Math.min(Z/g|0,67108863),A._ishlnsubmul(E,Z,I);A.negative!==0;)Z--,A.negative=0,A._ishlnsubmul(E,1,I),A.isZero()||(A.negative^=1);w&&(w.words[I]=Z)}return w&&w._strip(),A._strip(),p!=="div"&&_!==0&&A.iushrn(_),{div:w||null,mod:A}},"_wordDiv"),i.prototype.divmod=o(function(l,p,_){if(r(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var A,E,g;return this.negative!==0&&l.negative===0?(g=this.neg().divmod(l,p),p!=="mod"&&(A=g.div.neg()),p!=="div"&&(E=g.mod.neg(),_&&E.negative!==0&&E.iadd(l)),{div:A,mod:E}):this.negative===0&&l.negative!==0?(g=this.divmod(l.neg(),p),p!=="mod"&&(A=g.div.neg()),{div:A,mod:g.mod}):(this.negative&l.negative)!==0?(g=this.neg().divmod(l.neg(),p),p!=="div"&&(E=g.mod.neg(),_&&E.negative!==0&&E.isub(l)),{div:g.div,mod:E}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?p==="div"?{div:this.divn(l.words[0]),mod:null}:p==="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,p)},"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 p=this.divmod(l);if(p.mod.isZero())return p.div;var _=p.div.negative!==0?p.mod.isub(l):p.mod,A=l.ushrn(1),E=l.andln(1),g=_.cmp(A);return g<0||E===1&&g===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var p=l<0;p&&(l=-l),r(l<=67108863);for(var _=(1<<26)%l,A=0,E=this.length-1;E>=0;E--)A=(_*A+(this.words[E]|0))%l;return p?-A:A},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var p=l<0;p&&(l=-l),r(l<=67108863);for(var _=0,A=this.length-1;A>=0;A--){var E=(this.words[A]|0)+_*67108864;this.words[A]=E/l|0,_=E%l}return this._strip(),p?this.ineg():this},"idivn"),i.prototype.divn=o(function(l){return this.clone().idivn(l)},"divn"),i.prototype.egcd=o(function(l){r(l.negative===0),r(!l.isZero());var p=this,_=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var A=new i(1),E=new i(0),g=new i(0),C=new i(1),N=0;p.isEven()&&_.isEven();)p.iushrn(1),_.iushrn(1),++N;for(var w=_.clone(),k=p.clone();!p.isZero();){for(var he=0,I=1;(p.words[0]&I)===0&&he<26;++he,I<<=1);if(he>0)for(p.iushrn(he);he-- >0;)(A.isOdd()||E.isOdd())&&(A.iadd(w),E.isub(k)),A.iushrn(1),E.iushrn(1);for(var Z=0,se=1;(_.words[0]&se)===0&&Z<26;++Z,se<<=1);if(Z>0)for(_.iushrn(Z);Z-- >0;)(g.isOdd()||C.isOdd())&&(g.iadd(w),C.isub(k)),g.iushrn(1),C.iushrn(1);p.cmp(_)>=0?(p.isub(_),A.isub(g),E.isub(C)):(_.isub(p),g.isub(A),C.isub(E))}return{a:g,b:C,gcd:_.iushln(N)}},"egcd"),i.prototype._invmp=o(function(l){r(l.negative===0),r(!l.isZero());var p=this,_=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var A=new i(1),E=new i(0),g=_.clone();p.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,N=1;(p.words[0]&N)===0&&C<26;++C,N<<=1);if(C>0)for(p.iushrn(C);C-- >0;)A.isOdd()&&A.iadd(g),A.iushrn(1);for(var w=0,k=1;(_.words[0]&k)===0&&w<26;++w,k<<=1);if(w>0)for(_.iushrn(w);w-- >0;)E.isOdd()&&E.iadd(g),E.iushrn(1);p.cmp(_)>=0?(p.isub(_),A.isub(E)):(_.isub(p),E.isub(A))}var he;return p.cmpn(1)===0?he=A:he=E,he.cmpn(0)<0&&he.iadd(l),he},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var p=this.clone(),_=l.clone();p.negative=0,_.negative=0;for(var A=0;p.isEven()&&_.isEven();A++)p.iushrn(1),_.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;_.isEven();)_.iushrn(1);var E=p.cmp(_);if(E<0){var g=p;p=_,_=g}else if(E===0||_.cmpn(1)===0)break;p.isub(_)}while(!0);return _.iushln(A)},"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){r(typeof l=="number");var p=l%26,_=(l-p)/26,A=1<<p;if(this.length<=_)return this._expand(_+1),this.words[_]|=A,this;for(var E=A,g=_;E!==0&&g<this.length;g++){var C=this.words[g]|0;C+=E,E=C>>>26,C&=67108863,this.words[g]=C}return E!==0&&(this.words[g]=E,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 p=l<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var _;if(this.length>1)_=1;else{p&&(l=-l),r(l<=67108863,"Number is too big");var A=this.words[0]|0;_=A===l?0:A<l?-1:1}return this.negative!==0?-_|0:_},"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 p=this.ucmp(l);return this.negative!==0?-p|0:p},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var p=0,_=this.length-1;_>=0;_--){var A=this.words[_]|0,E=l.words[_]|0;if(A!==E){A<E?p=-1:A>E&&(p=1);break}}return p},"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 r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return r(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 r(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 r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return r(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var oe={k256:null,p224:null,p192:null,p25519:null};function j(b,l){this.name=b,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(j,"MPrime"),j.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),j.prototype.ireduce=o(function(l){var p=l,_;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),_=p.bitLength();while(_>this.n);var A=_<this.n?-1:p.ucmp(this.p);return A===0?(p.words[0]=0,p.length=1):A>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},"ireduce"),j.prototype.split=o(function(l,p){l.iushrn(this.n,0,p)},"split"),j.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,j),H.prototype.split=o(function(l,p){for(var _=4194303,A=Math.min(l.length,9),E=0;E<A;E++)p.words[E]=l.words[E];if(p.length=A,l.length<=9){l.words[0]=0,l.length=1;return}var g=l.words[9];for(p.words[p.length++]=g&_,E=10;E<l.length;E++){var C=l.words[E]|0;l.words[E-10]=(C&_)<<4|g>>>22,g=C}g>>>=22,l.words[E-10]=g,g===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var p=0,_=0;_<l.length;_++){var A=l.words[_]|0;p+=A*977,l.words[_]=p&67108863,p=A*64+(p/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function G(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(G,"P224"),n(G,j);function le(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,"P192"),n(le,j);function T(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(T,"P25519"),n(T,j),T.prototype.imulK=o(function(l){for(var p=0,_=0;_<l.length;_++){var A=(l.words[_]|0)*19+p,E=A&67108863;A>>>=26,l.words[_]=E,p=A}return p!==0&&(l.words[l.length++]=p),l},"imulK"),i._prime=o(function(l){if(oe[l])return oe[l];var p;if(l==="k256")p=new H;else if(l==="p224")p=new G;else if(l==="p192")p=new le;else if(l==="p25519")p=new T;else throw new Error("Unknown prime "+l);return oe[l]=p,p},"prime");function h(b){if(typeof b=="string"){var l=i._prime(b);this.m=l.p,this.prime=l}else r(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}o(h,"Red"),h.prototype._verify1=o(function(l){r(l.negative===0,"red works only with positives"),r(l.red,"red works only with red numbers")},"_verify1"),h.prototype._verify2=o(function(l,p){r((l.negative|p.negative)===0,"red works only with positives"),r(l.red&&l.red===p.red,"red works only with red numbers")},"_verify2"),h.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(v(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,p){this._verify2(l,p);var _=l.add(p);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},"add"),h.prototype.iadd=o(function(l,p){this._verify2(l,p);var _=l.iadd(p);return _.cmp(this.m)>=0&&_.isub(this.m),_},"iadd"),h.prototype.sub=o(function(l,p){this._verify2(l,p);var _=l.sub(p);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},"sub"),h.prototype.isub=o(function(l,p){this._verify2(l,p);var _=l.isub(p);return _.cmpn(0)<0&&_.iadd(this.m),_},"isub"),h.prototype.shl=o(function(l,p){return this._verify1(l),this.imod(l.ushln(p))},"shl"),h.prototype.imul=o(function(l,p){return this._verify2(l,p),this.imod(l.imul(p))},"imul"),h.prototype.mul=o(function(l,p){return this._verify2(l,p),this.imod(l.mul(p))},"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 p=this.m.andln(3);if(r(p%2===1),p===3){var _=this.m.add(new i(1)).iushrn(2);return this.pow(l,_)}for(var A=this.m.subn(1),E=0;!A.isZero()&&A.andln(1)===0;)E++,A.iushrn(1);r(!A.isZero());var g=new i(1).toRed(this),C=g.redNeg(),N=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,N).cmp(C)!==0;)w.redIAdd(C);for(var k=this.pow(w,A),he=this.pow(l,A.addn(1).iushrn(1)),I=this.pow(l,A),Z=E;I.cmp(g)!==0;){for(var se=I,q=0;se.cmp(g)!==0;q++)se=se.redSqr();r(q<Z);var F=this.pow(k,new i(1).iushln(Z-q-1));he=he.redMul(F),k=F.redSqr(),I=I.redMul(k),Z=q}return he},"sqrt"),h.prototype.invm=o(function(l){var p=l._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},"invm"),h.prototype.pow=o(function(l,p){if(p.isZero())return new i(1).toRed(this);if(p.cmpn(1)===0)return l.clone();var _=4,A=new Array(1<<_);A[0]=new i(1).toRed(this),A[1]=l;for(var E=2;E<A.length;E++)A[E]=this.mul(A[E-1],l);var g=A[0],C=0,N=0,w=p.bitLength()%26;for(w===0&&(w=26),E=p.length-1;E>=0;E--){for(var k=p.words[E],he=w-1;he>=0;he--){var I=k>>he&1;if(g!==A[0]&&(g=this.sqr(g)),I===0&&C===0){N=0;continue}C<<=1,C|=I,N++,!(N!==_&&(E!==0||he!==0))&&(g=this.mul(g,A[C]),N=0,C=0)}w=26}return g},"pow"),h.prototype.convertTo=o(function(l){var p=l.umod(this.m);return p===l?p.clone():p},"convertTo"),h.prototype.convertFrom=o(function(l){var p=l.clone();return p.red=null,p},"convertFrom"),i.mont=o(function(l){return new y(l)},"mont");function y(b){h.call(this,b),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(y,"Mont"),n(y,h),y.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),y.prototype.convertFrom=o(function(l){var p=this.imod(l.mul(this.rinv));return p.red=null,p},"convertFrom"),y.prototype.imul=o(function(l,p){if(l.isZero()||p.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(p),A=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=_.isub(A).iushrn(this.shift),g=E;return E.cmp(this.m)>=0?g=E.isub(this.m):E.cmpn(0)<0&&(g=E.iadd(this.m)),g._forceRed(this)},"imul"),y.prototype.mul=o(function(l,p){if(l.isZero()||p.isZero())return new i(0)._forceRed(this);var _=l.mul(p),A=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=_.isub(A).iushrn(this.shift),g=E;return E.cmp(this.m)>=0?g=E.isub(this.m):E.cmpn(0)<0&&(g=E.iadd(this.m)),g._forceRed(this)},"mul"),y.prototype.invm=o(function(l){var p=this.imod(l._invmp(this.m).mul(this.r2));return p._forceRed(this)},"invm")})(typeof vb>"u"||vb,v5)});var o8=De((zW,i8)=>{i8.exports=Rb;var n8=128,KL=127,jL=~KL,GL=Math.pow(2,31);function Rb(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw Rb.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=GL;)e[r++]=t&255|n8,t/=128;for(;t&jL;)e[r++]=t&255|n8,t>>>=7;return e[r]=t|0,Rb.bytes=r-n+1,e}o(Rb,"encode")});var f8=De((KW,a8)=>{a8.exports=Nb;var VL=128,s8=127;function Nb(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u||i>49)throw Nb.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&s8)<<i:(c&s8)*Math.pow(2,i),i+=7}while(c>=VL);return Nb.bytes=a-n,r}o(Nb,"read")});var u8=De((jW,c8)=>{var WL=Math.pow(2,7),JL=Math.pow(2,14),YL=Math.pow(2,21),XL=Math.pow(2,28),ZL=Math.pow(2,35),QL=Math.pow(2,42),eB=Math.pow(2,49),tB=Math.pow(2,56),rB=Math.pow(2,63);c8.exports=function(t){return t<WL?1:t<JL?2:t<YL?3:t<XL?4:t<ZL?5:t<QL?6:t<eB?7:t<tB?8:t<rB?9:10}});var tl=De((GW,l8)=>{l8.exports={encode:o8(),decode:f8(),encodingLength:u8()}});var w8=De((XW,x8)=>{"use strict";x8.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(a){return function(c){return function(u,m){var v={key:u,value:c[u]},x={key:m,value:c[m]};return a(v,x)}}}(e.cmp),i=[];return o(function a(c){if(c&&c.toJSON&&typeof c.toJSON=="function"&&(c=c.toJSON()),c!==void 0){if(typeof c=="number")return isFinite(c)?""+c:"null";if(typeof c!="object")return JSON.stringify(c);var u,m;if(Array.isArray(c)){for(m="[",u=0;u<c.length;u++)u&&(m+=","),m+=a(c[u])||"null";return m+"]"}if(c===null)return"null";if(i.indexOf(c)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var v=i.push(c)-1,x=Object.keys(c).sort(n&&n(c));for(m="",u=0;u<x.length;u++){var S=x[u],O=a(c[S]);!O||(m&&(m+=","),m+=JSON.stringify(S)+":"+O)}return i.splice(v,1),"{"+m+"}"}},"stringify")(t)}});var Sc=De((sl,wc)=>{var BB=200,$8="__lodash_hash_undefined__",F8=9007199254740991,ng="[object Arguments]",UB="[object Array]",q8="[object Boolean]",H8="[object Date]",$B="[object Error]",ig="[object Function]",z8="[object GeneratorFunction]",s0="[object Map]",K8="[object Number]",og="[object Object]",C8="[object Promise]",j8="[object RegExp]",a0="[object Set]",G8="[object String]",V8="[object Symbol]",Xb="[object WeakMap]",W8="[object ArrayBuffer]",f0="[object DataView]",J8="[object Float32Array]",Y8="[object Float64Array]",X8="[object Int8Array]",Z8="[object Int16Array]",Q8="[object Int32Array]",e_="[object Uint8Array]",t_="[object Uint8ClampedArray]",r_="[object Uint16Array]",n_="[object Uint32Array]",FB=/[\\^$.*+?()[\]{}|]/g,qB=/\w*$/,HB=/^\[object .+?Constructor\]$/,zB=/^(?:0|[1-9]\d*)$/,nr={};nr[ng]=nr[UB]=nr[W8]=nr[f0]=nr[q8]=nr[H8]=nr[J8]=nr[Y8]=nr[X8]=nr[Z8]=nr[Q8]=nr[s0]=nr[K8]=nr[og]=nr[j8]=nr[a0]=nr[G8]=nr[V8]=nr[e_]=nr[t_]=nr[r_]=nr[n_]=!0;nr[$B]=nr[ig]=nr[Xb]=!1;var KB=typeof global=="object"&&global&&global.Object===Object&&global,jB=typeof self=="object"&&self&&self.Object===Object&&self,ns=KB||jB||Function("return this")(),i_=typeof sl=="object"&&sl&&!sl.nodeType&&sl,k8=i_&&typeof wc=="object"&&wc&&!wc.nodeType&&wc,GB=k8&&k8.exports===i_;function VB(t,e){return t.set(e[0],e[1]),t}o(VB,"addMapEntry");function WB(t,e){return t.add(e),t}o(WB,"addSetEntry");function JB(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}o(JB,"arrayEach");function YB(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}o(YB,"arrayPush");function o_(t,e,r,n){var i=-1,a=t?t.length:0;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}o(o_,"arrayReduce");function XB(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(XB,"baseTimes");function ZB(t,e){return t?.[e]}o(ZB,"getValue");function s_(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}o(s_,"isHostObject");function I8(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}o(I8,"mapToArray");function sg(t,e){return function(r){return t(e(r))}}o(sg,"overArg");function D8(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}o(D8,"setToArray");var QB=Array.prototype,eU=Function.prototype,c0=Object.prototype,Yb=ns["__core-js_shared__"],O8=function(){var t=/[^.]+$/.exec(Yb&&Yb.keys&&Yb.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),a_=eU.toString,Js=c0.hasOwnProperty,u0=c0.toString,tU=RegExp("^"+a_.call(Js).replace(FB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R8=GB?ns.Buffer:void 0,N8=ns.Symbol,P8=ns.Uint8Array,rU=sg(Object.getPrototypeOf,Object),nU=Object.create,iU=c0.propertyIsEnumerable,oU=QB.splice,L8=Object.getOwnPropertySymbols,sU=R8?R8.isBuffer:void 0,aU=sg(Object.keys,Object),Zb=Ac(ns,"DataView"),al=Ac(ns,"Map"),Qb=Ac(ns,"Promise"),eg=Ac(ns,"Set"),tg=Ac(ns,"WeakMap"),fl=Ac(Object,"create"),fU=Za(Zb),cU=Za(al),uU=Za(Qb),lU=Za(eg),hU=Za(tg),B8=N8?N8.prototype:void 0,U8=B8?B8.valueOf:void 0;function Xa(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Xa,"Hash");function dU(){this.__data__=fl?fl(null):{}}o(dU,"hashClear");function pU(t){return this.has(t)&&delete this.__data__[t]}o(pU,"hashDelete");function mU(t){var e=this.__data__;if(fl){var r=e[t];return r===$8?void 0:r}return Js.call(e,t)?e[t]:void 0}o(mU,"hashGet");function bU(t){var e=this.__data__;return fl?e[t]!==void 0:Js.call(e,t)}o(bU,"hashHas");function gU(t,e){var r=this.__data__;return r[t]=fl&&e===void 0?$8:e,this}o(gU,"hashSet");Xa.prototype.clear=dU;Xa.prototype.delete=pU;Xa.prototype.get=mU;Xa.prototype.has=bU;Xa.prototype.set=gU;function is(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(is,"ListCache");function vU(){this.__data__=[]}o(vU,"listCacheClear");function yU(t){var e=this.__data__,r=l0(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():oU.call(e,r,1),!0}o(yU,"listCacheDelete");function xU(t){var e=this.__data__,r=l0(e,t);return r<0?void 0:e[r][1]}o(xU,"listCacheGet");function wU(t){return l0(this.__data__,t)>-1}o(wU,"listCacheHas");function _U(t,e){var r=this.__data__,n=l0(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}o(_U,"listCacheSet");is.prototype.clear=vU;is.prototype.delete=yU;is.prototype.get=xU;is.prototype.has=wU;is.prototype.set=_U;function _c(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(_c,"MapCache");function EU(){this.__data__={hash:new Xa,map:new(al||is),string:new Xa}}o(EU,"mapCacheClear");function AU(t){return h0(this,t).delete(t)}o(AU,"mapCacheDelete");function SU(t){return h0(this,t).get(t)}o(SU,"mapCacheGet");function MU(t){return h0(this,t).has(t)}o(MU,"mapCacheHas");function TU(t,e){return h0(this,t).set(t,e),this}o(TU,"mapCacheSet");_c.prototype.clear=EU;_c.prototype.delete=AU;_c.prototype.get=SU;_c.prototype.has=MU;_c.prototype.set=TU;function Ec(t){this.__data__=new is(t)}o(Ec,"Stack");function CU(){this.__data__=new is}o(CU,"stackClear");function kU(t){return this.__data__.delete(t)}o(kU,"stackDelete");function IU(t){return this.__data__.get(t)}o(IU,"stackGet");function DU(t){return this.__data__.has(t)}o(DU,"stackHas");function OU(t,e){var r=this.__data__;if(r instanceof is){var n=r.__data__;if(!al||n.length<BB-1)return n.push([t,e]),this;r=this.__data__=new _c(n)}return r.set(t,e),this}o(OU,"stackSet");Ec.prototype.clear=CU;Ec.prototype.delete=kU;Ec.prototype.get=IU;Ec.prototype.has=DU;Ec.prototype.set=OU;function RU(t,e){var r=fg(t)||n$(t)?XB(t.length,String):[],n=r.length,i=!!n;for(var a in t)(e||Js.call(t,a))&&!(i&&(a=="length"||QU(a,n)))&&r.push(a);return r}o(RU,"arrayLikeKeys");function f_(t,e,r){var n=t[e];(!(Js.call(t,e)&&h_(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}o(f_,"assignValue");function l0(t,e){for(var r=t.length;r--;)if(h_(t[r][0],e))return r;return-1}o(l0,"assocIndexOf");function NU(t,e){return t&&c_(e,cg(e),t)}o(NU,"baseAssign");function rg(t,e,r,n,i,a,c){var u;if(n&&(u=a?n(t,i,a,c):n(t)),u!==void 0)return u;if(!d0(t))return t;var m=fg(t);if(m){if(u=YU(t),!e)return VU(t,u)}else{var v=Ya(t),x=v==ig||v==z8;if(o$(t))return FU(t,e);if(v==og||v==ng||x&&!a){if(s_(t))return a?t:{};if(u=XU(x?{}:t),!e)return WU(t,NU(u,t))}else{if(!nr[v])return a?t:{};u=ZU(t,v,rg,e)}}c||(c=new Ec);var S=c.get(t);if(S)return S;if(c.set(t,u),!m)var O=r?JU(t):cg(t);return JB(O||t,function(R,D){O&&(D=R,R=t[D]),f_(u,D,rg(R,e,r,n,D,t,c))}),u}o(rg,"baseClone");function PU(t){return d0(t)?nU(t):{}}o(PU,"baseCreate");function LU(t,e,r){var n=e(t);return fg(t)?n:YB(n,r(t))}o(LU,"baseGetAllKeys");function BU(t){return u0.call(t)}o(BU,"baseGetTag");function UU(t){if(!d0(t)||t$(t))return!1;var e=p_(t)||s_(t)?tU:HB;return e.test(Za(t))}o(UU,"baseIsNative");function $U(t){if(!l_(t))return aU(t);var e=[];for(var r in Object(t))Js.call(t,r)&&r!="constructor"&&e.push(r);return e}o($U,"baseKeys");function FU(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}o(FU,"cloneBuffer");function ag(t){var e=new t.constructor(t.byteLength);return new P8(e).set(new P8(t)),e}o(ag,"cloneArrayBuffer");function qU(t,e){var r=e?ag(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}o(qU,"cloneDataView");function HU(t,e,r){var n=e?r(I8(t),!0):I8(t);return o_(n,VB,new t.constructor)}o(HU,"cloneMap");function zU(t){var e=new t.constructor(t.source,qB.exec(t));return e.lastIndex=t.lastIndex,e}o(zU,"cloneRegExp");function KU(t,e,r){var n=e?r(D8(t),!0):D8(t);return o_(n,WB,new t.constructor)}o(KU,"cloneSet");function jU(t){return U8?Object(U8.call(t)):{}}o(jU,"cloneSymbol");function GU(t,e){var r=e?ag(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o(GU,"cloneTypedArray");function VU(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(VU,"copyArray");function c_(t,e,r,n){r||(r={});for(var i=-1,a=e.length;++i<a;){var c=e[i],u=n?n(r[c],t[c],c,r,t):void 0;f_(r,c,u===void 0?t[c]:u)}return r}o(c_,"copyObject");function WU(t,e){return c_(t,u_(t),e)}o(WU,"copySymbols");function JU(t){return LU(t,cg,u_)}o(JU,"getAllKeys");function h0(t,e){var r=t.__data__;return e$(e)?r[typeof e=="string"?"string":"hash"]:r.map}o(h0,"getMapData");function Ac(t,e){var r=ZB(t,e);return UU(r)?r:void 0}o(Ac,"getNative");var u_=L8?sg(L8,Object):f$,Ya=BU;(Zb&&Ya(new Zb(new ArrayBuffer(1)))!=f0||al&&Ya(new al)!=s0||Qb&&Ya(Qb.resolve())!=C8||eg&&Ya(new eg)!=a0||tg&&Ya(new tg)!=Xb)&&(Ya=o(function(t){var e=u0.call(t),r=e==og?t.constructor:void 0,n=r?Za(r):void 0;if(n)switch(n){case fU:return f0;case cU:return s0;case uU:return C8;case lU:return a0;case hU:return Xb}return e},"getTag"));function YU(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&Js.call(t,"index")&&(r.index=t.index,r.input=t.input),r}o(YU,"initCloneArray");function XU(t){return typeof t.constructor=="function"&&!l_(t)?PU(rU(t)):{}}o(XU,"initCloneObject");function ZU(t,e,r,n){var i=t.constructor;switch(e){case W8:return ag(t);case q8:case H8:return new i(+t);case f0:return qU(t,n);case J8:case Y8:case X8:case Z8:case Q8:case e_:case t_:case r_:case n_:return GU(t,n);case s0:return HU(t,n,r);case K8:case G8:return new i(t);case j8:return zU(t);case a0:return KU(t,n,r);case V8:return jU(t)}}o(ZU,"initCloneByTag");function QU(t,e){return e=e??F8,!!e&&(typeof t=="number"||zB.test(t))&&t>-1&&t%1==0&&t<e}o(QU,"isIndex");function e$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}o(e$,"isKeyable");function t$(t){return!!O8&&O8 in t}o(t$,"isMasked");function l_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||c0;return t===r}o(l_,"isPrototype");function Za(t){if(t!=null){try{return a_.call(t)}catch{}try{return t+""}catch{}}return""}o(Za,"toSource");function r$(t){return rg(t,!0,!0)}o(r$,"cloneDeep");function h_(t,e){return t===e||t!==t&&e!==e}o(h_,"eq");function n$(t){return i$(t)&&Js.call(t,"callee")&&(!iU.call(t,"callee")||u0.call(t)==ng)}o(n$,"isArguments");var fg=Array.isArray;function d_(t){return t!=null&&s$(t.length)&&!p_(t)}o(d_,"isArrayLike");function i$(t){return a$(t)&&d_(t)}o(i$,"isArrayLikeObject");var o$=sU||c$;function p_(t){var e=d0(t)?u0.call(t):"";return e==ig||e==z8}o(p_,"isFunction");function s$(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=F8}o(s$,"isLength");function d0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}o(d0,"isObject");function a$(t){return!!t&&typeof t=="object"}o(a$,"isObjectLike");function cg(t){return d_(t)?RU(t):$U(t)}o(cg,"keys");function f$(){return[]}o(f$,"stubArray");function c$(){return!1}o(c$,"stubFalse");wc.exports=r$});var cE=De((fs,fE)=>{var aE=typeof self<"u"?self:fs,$0=function(){function t(){this.fetch=!1,this.DOMException=aE.DOMException}return o(t,"F"),t.prototype=aE,new t}();(function(t){var e=function(r){var n={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function i(T){return T&&DataView.prototype.isPrototypeOf(T)}if(o(i,"isDataView"),n.arrayBuffer)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(T){return T&&a.indexOf(Object.prototype.toString.call(T))>-1};function u(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(T))throw new TypeError("Invalid character in header field name");return T.toLowerCase()}o(u,"normalizeName");function m(T){return typeof T!="string"&&(T=String(T)),T}o(m,"normalizeValue");function v(T){var h={next:function(){var y=T.shift();return{done:y===void 0,value:y}}};return n.iterable&&(h[Symbol.iterator]=function(){return h}),h}o(v,"iteratorFor");function x(T){this.map={},T instanceof x?T.forEach(function(h,y){this.append(y,h)},this):Array.isArray(T)?T.forEach(function(h){this.append(h[0],h[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(h){this.append(h,T[h])},this)}o(x,"Headers"),x.prototype.append=function(T,h){T=u(T),h=m(h);var y=this.map[T];this.map[T]=y?y+", "+h:h},x.prototype.delete=function(T){delete this.map[u(T)]},x.prototype.get=function(T){return T=u(T),this.has(T)?this.map[T]:null},x.prototype.has=function(T){return this.map.hasOwnProperty(u(T))},x.prototype.set=function(T,h){this.map[u(T)]=m(h)},x.prototype.forEach=function(T,h){for(var y in this.map)this.map.hasOwnProperty(y)&&T.call(h,this.map[y],y,this)},x.prototype.keys=function(){var T=[];return this.forEach(function(h,y){T.push(y)}),v(T)},x.prototype.values=function(){var T=[];return this.forEach(function(h){T.push(h)}),v(T)},x.prototype.entries=function(){var T=[];return this.forEach(function(h,y){T.push([y,h])}),v(T)},n.iterable&&(x.prototype[Symbol.iterator]=x.prototype.entries);function S(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}o(S,"consumed");function O(T){return new Promise(function(h,y){T.onload=function(){h(T.result)},T.onerror=function(){y(T.error)}})}o(O,"fileReaderReady");function R(T){var h=new FileReader,y=O(h);return h.readAsArrayBuffer(T),y}o(R,"readBlobAsArrayBuffer");function D(T){var h=new FileReader,y=O(h);return h.readAsText(T),y}o(D,"readBlobAsText");function P(T){for(var h=new Uint8Array(T),y=new Array(h.length),b=0;b<h.length;b++)y[b]=String.fromCharCode(h[b]);return y.join("")}o(P,"readArrayBufferAsText");function J(T){if(T.slice)return T.slice(0);var h=new Uint8Array(T.byteLength);return h.set(new Uint8Array(T)),h.buffer}o(J,"bufferClone");function B(){return this.bodyUsed=!1,this._initBody=function(T){this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:n.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:n.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():n.arrayBuffer&&n.blob&&i(T)?(this._bodyArrayBuffer=J(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||c(T))?this._bodyArrayBuffer=J(T):this._bodyText=T=Object.prototype.toString.call(T):this._bodyText="",this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var T=S(this);if(T)return T;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(){return this._bodyArrayBuffer?S(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(R)}),this.text=function(){var T=S(this);if(T)return T;if(this._bodyBlob)return D(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(oe)}),this.json=function(){return this.text().then(JSON.parse)},this}o(B,"Body");var W=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Q(T){var h=T.toUpperCase();return W.indexOf(h)>-1?h:T}o(Q,"normalizeMethod");function Y(T,h){h=h||{};var y=h.body;if(T instanceof Y){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,h.headers||(this.headers=new x(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!y&&T._bodyInit!=null&&(y=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new x(h.headers)),this.method=Q(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(y)}o(Y,"Request"),Y.prototype.clone=function(){return new Y(this,{body:this._bodyInit})};function oe(T){var h=new FormData;return T.trim().split("&").forEach(function(y){if(y){var b=y.split("="),l=b.shift().replace(/\+/g," "),p=b.join("=").replace(/\+/g," ");h.append(decodeURIComponent(l),decodeURIComponent(p))}}),h}o(oe,"decode");function j(T){var h=new x,y=T.replace(/\r?\n[\t ]+/g," ");return y.split(/\r?\n/).forEach(function(b){var l=b.split(":"),p=l.shift().trim();if(p){var _=l.join(":").trim();h.append(p,_)}}),h}o(j,"parseHeaders"),B.call(Y.prototype);function H(T,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new x(h.headers),this.url=h.url||"",this._initBody(T)}o(H,"Response"),B.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},H.error=function(){var T=new H(null,{status:0,statusText:""});return T.type="error",T};var G=[301,302,303,307,308];H.redirect=function(T,h){if(G.indexOf(h)===-1)throw new RangeError("Invalid status code");return new H(null,{status:h,headers:{location:T}})},r.DOMException=t.DOMException;try{new r.DOMException}catch{r.DOMException=function(h,y){this.message=h,this.name=y;var b=Error(h);this.stack=b.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function le(T,h){return new Promise(function(y,b){var l=new Y(T,h);if(l.signal&&l.signal.aborted)return b(new r.DOMException("Aborted","AbortError"));var p=new XMLHttpRequest;function _(){p.abort()}o(_,"abortXhr"),p.onload=function(){var A={status:p.status,statusText:p.statusText,headers:j(p.getAllResponseHeaders()||"")};A.url="responseURL"in p?p.responseURL:A.headers.get("X-Request-URL");var E="response"in p?p.response:p.responseText;y(new H(E,A))},p.onerror=function(){b(new TypeError("Network request failed"))},p.ontimeout=function(){b(new TypeError("Network request failed"))},p.onabort=function(){b(new r.DOMException("Aborted","AbortError"))},p.open(l.method,l.url,!0),l.credentials==="include"?p.withCredentials=!0:l.credentials==="omit"&&(p.withCredentials=!1),"responseType"in p&&n.blob&&(p.responseType="blob"),l.headers.forEach(function(A,E){p.setRequestHeader(E,A)}),l.signal&&(l.signal.addEventListener("abort",_),p.onreadystatechange=function(){p.readyState===4&&l.signal.removeEventListener("abort",_)}),p.send(typeof l._bodyInit>"u"?null:l._bodyInit)})}return o(le,"fetch"),le.polyfill=!0,t.fetch||(t.fetch=le,t.Headers=x,t.Request=Y,t.Response=H),r.Headers=x,r.Request=Y,r.Response=H,r.fetch=le,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})($0);$0.fetch.ponyfill=!0;delete $0.fetch.polyfill;var Bc=$0;fs=Bc.fetch;fs.default=Bc.fetch;fs.fetch=Bc.fetch;fs.Headers=Bc.Headers;fs.Request=Bc.Request;fs.Response=Bc.Response;fE.exports=fs});var xE=De((Nee,yE)=>{"use strict";var W$=function(){function t(r,n){if(typeof r!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+r+"."));this._batchLoadFn=r,this._maxBatchSize=Z$(n),this._batchScheduleFn=Q$(n),this._cacheKeyFn=eF(n),this._cacheMap=tF(n),this._batch=null,this.name=rF(n)}o(t,"DataLoader");var e=t.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=Y$(this),a=this._cacheMap,c=this._cacheKeyFn(n);if(a){var u=a.get(c);if(u){var m=i.cacheHits||(i.cacheHits=[]);return new Promise(function(x){m.push(function(){x(u)})})}}i.keys.push(n);var v=new Promise(function(x,S){i.callbacks.push({resolve:x,reject:S})});return a&&a.set(c,v),v},"load"),e.loadMany=o(function(n){if(!vE(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],a=0;a<n.length;a++)i.push(this.load(n[a]).catch(function(c){return c}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var a=this._cacheKeyFn(n);i.delete(a)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var a=this._cacheMap;if(a){var c=this._cacheKeyFn(n);if(a.get(c)===void 0){var u;i instanceof Error?(u=Promise.reject(i),u.catch(function(){})):u=Promise.resolve(i),a.set(c,u)}}return this},"prime"),t}(),J$=typeof process=="object"&&typeof process.nextTick=="function"?function(t){Lg||(Lg=Promise.resolve()),Lg.then(function(){process.nextTick(t)})}:typeof setImmediate=="function"?function(t){setImmediate(t)}:function(t){setTimeout(t)},Lg;function Y$(t){var e=t._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<t._maxBatchSize)return e;var r={hasDispatched:!1,keys:[],callbacks:[]};return t._batch=r,t._batchScheduleFn(function(){X$(t,r)}),r}o(Y$,"getCurrentBatch");function X$(t,e){if(e.hasDispatched=!0,e.keys.length===0){Ug(e);return}var r;try{r=t._batchLoadFn(e.keys)}catch(n){return Bg(t,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(!r||typeof r.then!="function")return Bg(t,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(r)+".")));r.then(function(n){if(!vE(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."+(`
|
|
646
646
|
|
|
647
647
|
Keys:
|
|
648
648
|
`+String(e.keys))+(`
|
|
649
649
|
|
|
650
650
|
Values:
|
|
651
|
-
`+String(n)));Lg(e);for(var i=0;i<e.callbacks.length;i++){var a=n[i];a instanceof Error?e.callbacks[i].reject(a):e.callbacks[i].resolve(a)}}).catch(function(n){Pg(t,e,n)})}o(V$,"dispatchBatch");function Pg(t,e,r){Lg(e);for(var n=0;n<e.keys.length;n++)t.clear(e.keys[n]),e.callbacks[n].reject(r)}o(Pg,"failedDispatch");function Lg(t){if(t.cacheHits)for(var e=0;e<t.cacheHits.length;e++)t.cacheHits[e]()}o(Lg,"resolveCacheHits");function W$(t){var e=!t||t.batch!==!1;if(!e)return 1;var r=t&&t.maxBatchSize;if(r===void 0)return 1/0;if(typeof r!="number"||r<1)throw new TypeError("maxBatchSize must be a positive number: "+r);return r}o(W$,"getValidMaxBatchSize");function J$(t){var e=t&&t.batchScheduleFn;if(e===void 0)return j$;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(J$,"getValidBatchScheduleFn");function Y$(t){var e=t&&t.cacheKeyFn;if(e===void 0)return function(r){return r};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(Y$,"getValidCacheKeyFn");function X$(t){var e=!t||t.cache!==!1;if(!e)return null;var r=t&&t.cacheMap;if(r===void 0)return new Map;if(r!==null){var n=["get","set","delete","clear"],i=n.filter(function(a){return r&&typeof r[a]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return r}o(X$,"getValidCacheMap");function Z$(t){return t&&t.name?t.name:null}o(Z$,"getValidName");function bE(t){return typeof t=="object"&&t!==null&&typeof t.length=="number"&&(t.length===0||t.length>0&&Object.prototype.hasOwnProperty.call(t,t.length-1))}o(bE,"isArrayLike");gE.exports=K$});var RE=De((ite,OE)=>{"use strict";function bF(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),a=i.charCodeAt(0);if(e[a]!==255)throw new TypeError(i+" is ambiguous");e[a]=n}var c=t.length,u=t.charAt(0),m=Math.log(c)/Math.log(256),v=Math.log(256)/Math.log(c);function x(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 D=0,P=0,J=0,L=R.length;J!==L&&R[J]===0;)J++,D++;for(var W=(L-J)*v+1>>>0,Q=new Uint8Array(W);J!==L;){for(var Y=R[J],oe=0,j=W-1;(Y!==0||oe<P)&&j!==-1;j--,oe++)Y+=256*Q[j]>>>0,Q[j]=Y%c>>>0,Y=Y/c>>>0;if(Y!==0)throw new Error("Non-zero carry");P=oe,J++}for(var H=W-P;H!==W&&Q[H]===0;)H++;for(var G=u.repeat(D);H<W;++H)G+=t.charAt(Q[H]);return G}o(x,"encode");function S(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var D=0;if(R[D]!==" "){for(var P=0,J=0;R[D]===u;)P++,D++;for(var L=(R.length-D)*m+1>>>0,W=new Uint8Array(L);R[D];){var Q=e[R.charCodeAt(D)];if(Q===255)return;for(var Y=0,oe=L-1;(Q!==0||Y<J)&&oe!==-1;oe--,Y++)Q+=c*W[oe]>>>0,W[oe]=Q%256>>>0,Q=Q/256>>>0;if(Q!==0)throw new Error("Non-zero carry");J=Y,D++}if(R[D]!==" "){for(var j=L-J;j!==L&&W[j]===0;)j++;for(var H=new Uint8Array(P+(L-j)),G=P;j!==L;)H[G++]=W[j++];return H}}}o(S,"decodeUnsafe");function O(R){var D=S(R);if(D)return D;throw new Error("Non-base"+c+" character")}return o(O,"decode"),{encode:x,decodeUnsafe:S,decode:O}}o(bF,"base");OE.exports=bF});var F0=De((ote,NE)=>{"use strict";var gF=new TextDecoder,vF=o(t=>gF.decode(t),"decodeText"),yF=new TextEncoder,xF=o(t=>yF.encode(t),"encodeText");function wF(t,e){let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(wF,"concat");NE.exports={decodeText:vF,encodeText:xF,concat:wF}});var LE=De((ste,PE)=>{"use strict";var{encodeText:_F}=F0(),q0=class{constructor(e,r,n,i){this.name=e,this.code=r,this.codeBuf=_F(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let r of e)if(this.alphabet&&this.alphabet.indexOf(r)<0)throw new Error(`invalid character '${r}' in '${e}'`);return this.codec.decode(e)}};o(q0,"Base");PE.exports=q0});var UE=De((ate,BE)=>{"use strict";var EF=o((t,e,r)=>{let n={};for(let v=0;v<e.length;++v)n[e[v]]=v;let i=t.length;for(;t[i-1]==="=";)--i;let a=new Uint8Array(i*r/8|0),c=0,u=0,m=0;for(let v=0;v<i;++v){let x=n[t[v]];if(x===void 0)throw new SyntaxError("Invalid character "+t[v]);u=u<<r|x,c+=r,c>=8&&(c-=8,a[m++]=255&u>>c)}if(c>=r||255&u<<8-c)throw new SyntaxError("Unexpected end of data");return a},"decode"),AF=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let m=0;m<t.length;++m)for(u=u<<8|t[m],c+=8;c>r;)c-=r,a+=e[i&u>>c];if(c&&(a+=e[i&u<<r-c]),n)for(;a.length*r&7;)a+="=";return a},"encode"),SF=o(t=>e=>({encode(r){return AF(r,e,t)},decode(r){return EF(r,e,t)}}),"rfc4648");BE.exports={rfc4648:SF}});var HE=De((fte,qE)=>{"use strict";var wl=RE(),MF=LE(),{rfc4648:zr}=UE(),{decodeText:TF,encodeText:CF}=F0(),kF=o(()=>({encode:TF,decode:CF}),"identity"),$E=[["identity","\0",kF,""],["base2","0",zr(1),"01"],["base8","7",zr(3),"01234567"],["base10","9",wl,"0123456789"],["base16","f",zr(4),"0123456789abcdef"],["base16upper","F",zr(4),"0123456789ABCDEF"],["base32hex","v",zr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",zr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",zr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",zr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",zr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",zr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",zr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",zr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",zr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",wl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",wl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",wl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",wl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],FE=$E.reduce((t,e)=>(t[e[0]]=new MF(e[0],e[1],e[2],e[3]),t),{}),IF=$E.reduce((t,e)=>(t[e[1]]=FE[e[0]],t),{});qE.exports={names:FE,codes:IF}});var jE=De((cs,KE)=>{"use strict";var Bc=HE(),{encodeText:DF,decodeText:H0,concat:zE}=F0();function OF(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=cf(t);return LF(r,e),zE([n,e],n.length+e.length)}o(OF,"multibase");function RF(t,e){let r=cf(t),n=DF(r.encode(e));return zE([r.codeBuf,n],r.codeBuf.length+n.length)}o(RF,"encode");function NF(t){t instanceof Uint8Array&&(t=H0(t));let e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),cf(t[0]).decode(t.substring(1))}o(NF,"decode");function PF(t){if(t instanceof Uint8Array&&(t=H0(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return cf(t[0]).name}catch{return!1}}o(PF,"isEncoded");function LF(t,e){cf(t).decode(H0(e))}o(LF,"validEncode");function cf(t){if(Object.prototype.hasOwnProperty.call(Bc.names,t))return Bc.names[t];if(Object.prototype.hasOwnProperty.call(Bc.codes,t))return Bc.codes[t];throw new Error(`Unsupported encoding: ${t}`)}o(cf,"encoding");function BF(t){return t instanceof Uint8Array&&(t=H0(t)),cf(t[0])}o(BF,"encodingFromData");cs=KE.exports=OF;cs.encode=RF;cs.decode=NF;cs.isEncoded=PF;cs.encoding=cf;cs.encodingFromData=BF;var UF=Object.freeze(Bc.names),$F=Object.freeze(Bc.codes);cs.names=UF;cs.codes=$F});var JE=De((cte,WE)=>{WE.exports=VE;var GE=128,FF=127,qF=~FF,HF=Math.pow(2,31);function VE(t,e,r){e=e||[],r=r||0;for(var n=r;t>=HF;)e[r++]=t&255|GE,t/=128;for(;t&qF;)e[r++]=t&255|GE,t>>>=7;return e[r]=t|0,VE.bytes=r-n+1,e}o(VE,"encode")});var ZE=De((ute,XE)=>{XE.exports=Gg;var zF=128,YE=127;function Gg(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Gg.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&YE)<<i:(c&YE)*Math.pow(2,i),i+=7}while(c>=zF);return Gg.bytes=a-n,r}o(Gg,"read")});var e9=De((lte,QE)=>{var KF=Math.pow(2,7),jF=Math.pow(2,14),GF=Math.pow(2,21),VF=Math.pow(2,28),WF=Math.pow(2,35),JF=Math.pow(2,42),YF=Math.pow(2,49),XF=Math.pow(2,56),ZF=Math.pow(2,63);QE.exports=function(t){return t<KF?1:t<jF?2:t<GF?3:t<VF?4:t<WF?5:t<JF?6:t<YF?7:t<XF?8:t<ZF?9:10}});var r9=De((hte,t9)=>{t9.exports={encode:JE(),decode:ZE(),encodingLength:e9()}});var i9=De((dte,n9)=>{"use strict";var QF=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});n9.exports={names:QF}});var l9=De((pte,u9)=>{"use strict";var o9=jE(),Uc=r9(),{names:_l}=i9(),{toString:z0}=(Ff(),gh(t3)),{fromString:eq}=(pu(),gh(e3)),{concat:tq}=(lm(),gh(Sy)),$c={};for(let t in _l){let e=t;$c[_l[e]]=e}Object.freeze($c);function rq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return z0(t,"base16")}o(rq,"toHexString");function nq(t){return eq(t,"base16")}o(nq,"fromHexString");function iq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return z0(o9.encode("base58btc",t)).slice(1)}o(iq,"toB58String");function oq(t){let e=t instanceof Uint8Array?z0(t):t;return o9.decode("z"+e)}o(oq,"fromB58String");function s9(t){if(!(t instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Uc.decode(t);if(!f9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);t=t.slice(Uc.decode.bytes);let r=Uc.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(Uc.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${z0(t,"base16")}`);return{code:e,name:$c[e],length:r,digest:t}}o(s9,"decode");function sq(t,e,r){if(!t||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=a9(e);if(!(t instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(r==null&&(r=t.length),r&&t.length!==r)throw new Error("digest length should be equal to specified length.");let i=Uc.encode(n),a=Uc.encode(r);return tq([i,a,t],i.length+a.length+t.length)}o(sq,"encode");function a9(t){let e=t;if(typeof t=="string"){if(_l[t]===void 0)throw new Error(`Unrecognized hash function named: ${t}`);e=_l[t]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if($c[e]===void 0&&!Vg(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(a9,"coerceCode");function Vg(t){return t>0&&t<16}o(Vg,"isAppCode");function f9(t){return!!(Vg(t)||$c[t])}o(f9,"isValidCode");function c9(t){s9(t)}o(c9,"validate");function aq(t){return c9(t),t.subarray(0,2)}o(aq,"prefix");u9.exports={names:_l,codes:$c,toHexString:rq,fromHexString:nq,toB58String:iq,fromB58String:oq,decode:s9,encode:sq,coerceCode:a9,isAppCode:Vg,validate:c9,prefix:aq,isValidCode:f9}});var XH={};Jt(XH,{CeramicURIValidator:()=>t2,default:()=>YH,getCeramicPlugin:()=>ep,streamIdToCeramicURI:()=>Q0});module.exports=gh(XH);var P9=Lt(_y());function qk(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}o(qk,"_catch");function Hk(){let t=new Map;return function(e,r){try{let i=function(c){if(n)return c;let u=t.get(e.didUrl);return u!==void 0?u:Promise.resolve(r()).then(function(m){var v;return((v=m.didResolutionMetadata)==null?void 0:v.error)!=="notFound"&&t.set(e.didUrl,m),m})};o(i,"_temp2");let n,a=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(r()).then(function(c){return n=1,c})}();return Promise.resolve(a&&a.then?a.then(i):i(a))}catch(n){return Promise.reject(n)}}}o(Hk,"inMemoryCache");function zk(t,e){return e()}o(zk,"noCache");var Kk="(?:%[0-9a-fA-F]{2})",Ey=`(?:[a-zA-Z0-9._-]|${Kk})`,jk="([a-z0-9]+)",Gk=`((?:${Ey}*:)*(${Ey}+))`,Ay="[a-zA-Z0-9_.:%-]",Vk=`;${Ay}+=${Ay}*`,Wk=`((${Vk})*)`,Jk="(/[^#?]*)?",Yk="([?][^#]*)?",Xk="(#.*)?",Zk=new RegExp(`^did:${jk}:${Gk}${Wk}${Jk}${Yk}${Xk}$`);function Qk(t){if(t===""||!t)return null;let e=t.match(Zk);if(e){let r={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:t};if(e[4]){let n=e[4].slice(1).split(";");r.params={};for(let i of n){let a=i.split("=");r.params[a[0]]=a[1]}}return e[6]&&(r.path=e[6]),e[7]&&(r.query=e[7].slice(1)),e[8]&&(r.fragment=e[8].slice(1)),r}return null}o(Qk,"parse");var vh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function eI(t){return function(e,r,n){try{return Promise.resolve(qk(function(){return Promise.resolve(t(e,r,n)).then(function(i){return{...vh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...vh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(eI,"wrapLegacyResolver");var ou=class{constructor(e={},r={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=r.cache===!0?Hk():r.cache||zk,r.legacyResolvers&&Object.keys(r.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=eI(r.legacyResolvers[n]))})}resolve(e,r={}){try{let n=this,i=Qk(e);if(i===null)return Promise.resolve({...vh,didResolutionMetadata:{error:"invalidDid"}});let a=n.registry[i.method];return a?Promise.resolve(n.cache(i,()=>a(i.did,i,n,r))):Promise.resolve({...vh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(ou,"Resolver");lm();pu();Ff();yh();su();Dm();var O1=Lt(c3()),Rx=Lt(Fm()),R1=Lt(L6()),hd=Lt(Au()),Nx=Lt(ax()),Iu=Lt(lx()),N1=Lt(Sx()),P1=Lt(Oa());function bi(t){return kt(t,"base64url")}o(bi,"bytesToBase64url");function xn(t){let e=t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Ot(e,"base64url")}o(xn,"base64ToBytes");function L1(t){return Ot(t,"base58btc")}o(L1,"base58ToBytes");function k1(t){let e=t.startsWith("0x")?t.substring(2):t;return Ot(e.toLowerCase(),"base16")}o(k1,"hexToBytes");function I1(t){return bi(Ot(t))}o(I1,"encodeBase64url");function Px(t){return kt(xn(t))}o(Px,"decodeBase64url");function La(t){return kt(t,"base16")}o(La,"bytesToHex");function Lx(t){return Ot(t)}o(Lx,"stringToBytes");function SN({r:t,s:e,recoveryParam:r},n){let i=new Uint8Array(n?65:64);if(i.set(Ot(t,"base16"),0),i.set(Ot(e,"base16"),32),n){if(typeof r>"u")throw new Error("Signer did not return a recoveryParam");i[64]=r}return bi(i)}o(SN,"toJose");function MN(t){let e=xn(t);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let r=La(e.slice(0,32)),n=La(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r,s:n,recoveryParam:i}}o(MN,"fromJose");function Bx(t,e){return Oi([xn(t),xn(e)])}o(Bx,"toSealed");var TN=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,CN=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,kN=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function IN(t){if(typeof t=="string"){if(TN.test(t))return k1(t);if(CN.test(t))return L1(t);if(kN.test(t))return xn(t);throw TypeError("bad_key: Invalid private key format")}else{if(t instanceof Uint8Array)return t;throw TypeError("bad_key: Invalid private key format")}}o(IN,"parseKey");function Ux(t){let e=typeof t=="string"?Ot(t):t;return(0,O1.hash)(e)}o(Ux,"sha256");function DN(t){return new Uint8Array(Rx.keccak_256.arrayBuffer(t))}o(DN,"keccak");function ON(t){let e=Ot(t.slice(2),"base16");return`0x${kt(DN(e).slice(-20),"base16")}`}o(ON,"toEthereumAddress");function D1(t,e=new Uint8Array(4)){let r=Ot(t.toString(),"base10");return e.set(r,4-r.length),e}o(D1,"writeUint32BE");var C1=o(t=>Oi([D1(t.length),t]),"lengthAndInput");function $x(t,e,r,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let a=Oi([C1(Ot(r)),C1(typeof n>"u"?new Uint8Array(0):n),C1(typeof i>"u"?new Uint8Array(0):i),D1(e)]);return(0,O1.hash)(Oi([D1(1),t,a]))}o($x,"concatKDF");var oj=new R1.ec("secp256k1");function Fx(t){let e=IN(t);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(r){try{let n=typeof r=="string"?Lx(r):r,i=(0,hd.sign)(e,n);return Promise.resolve(bi(i))}catch(n){return Promise.reject(n)}}}o(Fx,"EdDSASigner");function qx(t){return typeof t=="object"&&"r"in t&&"s"in t}o(qx,"instanceOfEcdsaSignature");function Mx(t){return o(function(r,n){try{return Promise.resolve(n(r)).then(function(i){if(qx(i))return SN(i,t);if(t&&typeof MN(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(Mx,"ES256KSignerAlg");function Tx(){return o(function(e,r){try{return Promise.resolve(r(e)).then(function(n){if(qx(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(Tx,"Ed25519SignerAlg");var RN={ES256K:Mx(),"ES256K-R":Mx(!0),Ed25519:Tx(),EdDSA:Tx()};function NN(t){let e=RN[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(NN,"SignerAlg");var B1=new R1.ec("secp256k1");function ld(t,e=!1){let r=xn(t);if(r.length!==(e?65:64))throw new Error("wrong signature length");let n=La(r.slice(0,32)),i=La(r.slice(32,64)),a={r:n,s:i};return e&&(a.recoveryParam=r[64]),a}o(ld,"toSignatureObject");function U1(t){if(t.publicKeyBase58)return L1(t.publicKeyBase58);if(t.publicKeyBase64)return xn(t.publicKeyBase64);if(t.publicKeyHex)return k1(t.publicKeyHex);if(t.publicKeyJwk&&t.publicKeyJwk.crv==="secp256k1"&&t.publicKeyJwk.x&&t.publicKeyJwk.y)return k1(B1.keyFromPublic({x:La(xn(t.publicKeyJwk.x)),y:La(xn(t.publicKeyJwk.y))}).getPublic("hex"));if(t.publicKeyMultibase){let{base16:e,base58btc:r,base64:n,base64url:i}=du;return e.decoder.or(r.decoder.or(n.decoder.or(i.decoder))).decode(t.publicKeyMultibase)}return new Uint8Array}o(U1,"extractPublicKeyBytes");function PN(t,e,r){let n=Ux(t),i=ld(e),a=r.filter(({ethereumAddress:m,blockchainAccountId:v})=>typeof m>"u"&&typeof v>"u"),c=r.filter(({ethereumAddress:m,blockchainAccountId:v})=>typeof m<"u"||typeof v!==void 0),u=a.find(m=>{try{let v=U1(m);return B1.keyFromPublic(v).verify(n,i)}catch{return!1}});if(!u&&c.length>0&&(u=Hx(t,e,c)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(PN,"verifyES256K");function Hx(t,e,r){let n;if(e.length>86)n=[ld(e,!0)];else{let c=ld(e,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let i=o(c=>{let u=Ux(t),m=B1.recoverPubKey(u,c,c.recoveryParam),v=m.encode("hex"),x=m.encode("hex",!0),S=ON(v);return r.find(R=>{var D,P,J;let L=La(U1(R));return L===v||L===x||((D=R.ethereumAddress)==null?void 0:D.toLowerCase())===S||((P=R.blockchainAccountId)==null||(J=P.split("@eip155"))==null?void 0:J[0].toLowerCase())===S})},"checkSignatureAgainstSigner"),a=n.map(i).filter(c=>typeof c<"u");if(a.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return a[0]}o(Hx,"verifyRecoverableES256K");function Cx(t,e,r){let n=Lx(t),i=xn(e),a=r.find(c=>(0,hd.verify)(U1(c),n,i));if(!a)throw new Error("invalid_signature: Signature invalid for JWT");return a}o(Cx,"verifyEd25519");var LN={ES256K:PN,"ES256K-R":Hx,Ed25519:Cx,EdDSA:Cx};function zx(t){let e=LN[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(zx,"VerifierAlgorithm");zx.toSignatureObject=ld;var Kx=o(function(t,e,r={},n={}){try{r.alg||(r.alg=BN);let i=typeof t=="string"?t:kx(t,n.canonicalize),a=[kx(r,n.canonicalize),i].join("."),c=NN(r.alg);return Promise.resolve(c(a,e)).then(function(u){return[a,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var BN="ES256K";function kx(t,e=!1){return I1(e?(0,Nx.default)(t):JSON.stringify(t))}o(kx,"encodeSection");function UN(t){let e=t.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Px(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(UN,"decodeJWS");function $N({header:t,data:e,signature:r},n){return Array.isArray(n)||(n=[n]),zx(t.alg)(e,r,n)}o($N,"verifyJWSDecoded");function jx(t,e){let r=UN(t);return $N(r,e)}o(jx,"verifyJWS");function FN(t,e,r){for(var n;;){var i=t();if(Ls(i)&&(i=i.v),!i)return a;if(i.then){n=0;break}var a=r();if(a&&a.then)if(Ls(a))a=a.s;else{n=1;break}if(e){var c=e();if(c&&c.then&&!Ls(c)){n=2;break}}}var u=new Ba,m=_r.bind(null,u,2);return(n===0?i.then(x):n===1?a.then(v):c.then(S)).then(void 0,m),u;function v(O){a=O;do{if(e&&(c=e(),c&&c.then&&!Ls(c))){c.then(S).then(void 0,m);return}if(i=t(),!i||Ls(i)&&!i.v){_r(u,1,a);return}if(i.then){i.then(x).then(void 0,m);return}a=r(),Ls(a)&&(a=a.v)}while(!a||!a.then);a.then(v).then(void 0,m)}o(v,"_resumeAfterBody");function x(O){O?(a=r(),a&&a.then?a.then(v).then(void 0,m):v(a)):_r(u,1,a)}o(x,"_resumeAfterTest");function S(){(i=t())?i.then?i.then(x).then(void 0,m):x(i):_r(u,1,a)}o(S,"_resumeAfterUpdate")}o(FN,"_for");var Gx=o(function(t,e){try{let n=function(v){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let r;zN(t);let i=JSON.parse(Px(t.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let a=Bx(t.ciphertext,t.tag),c=new Uint8Array(Buffer.from(t.aad?`${t.protected}.${t.aad}`:t.protected)),u=null,m=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(a,xn(t.iv),c)).then(function(v){u=v}):function(){if(!t.recipients||t.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let v=0;return FN(function(){return!u&&v<t.recipients.length},function(){return v++},function(){let x=t.recipients[v];Object.assign(x.header,i);let S=function(){if(x.header.alg===e.alg)return Promise.resolve(e.decrypt(a,xn(t.iv),c,x)).then(function(O){u=O})}();if(S&&S.then)return S.then(function(){})})}}()}();return Promise.resolve(m&&m.then?m.then(n):n(m))}catch(r){return Promise.reject(r)}},"decryptJWE"),Ix=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function _r(t,e,r){if(!t.s){if(r instanceof Ba)if(r.s)e&1&&(e=r.s),r=r.v;else{r.o=_r.bind(null,t,e);return}if(r&&r.then){r.then(_r.bind(null,t,e),_r.bind(null,t,2));return}t.s=e,t.v=r;let n=t.o;n&&n(t)}}o(_r,"_settle");var Ba=function(){function t(){}return o(t,"_Pact"),t.prototype.then=function(e,r){let n=new t,i=this.s;if(i){let a=i&1?e:r;if(a){try{_r(n,1,a(this.v))}catch(c){_r(n,2,c)}return n}else return this}return this.o=function(a){try{let c=a.v;a.s&1?_r(n,1,e?e(c):c):r?_r(n,1,r(c)):_r(n,2,c)}catch(c){_r(n,2,c)}},n},t}();function Ls(t){return t instanceof Ba&&t.s&1}o(Ls,"_isSettledPact");function qN(t,e,r){var n=-1,i,a;function c(u){try{for(;++n<t.length&&(!r||!r());)if(u=e(n),u&&u.then)if(Ls(u))u=u.v;else{u.then(c,a||(a=_r.bind(null,i=new Ba,2)));return}i?_r(i,1,u):i=u}catch(m){_r(i||(i=new Ba),2,m)}}return o(c,"_cycle"),c(),i}o(qN,"_forTo");function HN(t,e,r){if(typeof t[Ix]=="function"){let x=function(S){try{for(;!(i=n.next()).done&&(!r||!r());)if(S=e(i.value),S&&S.then)if(Ls(S))S=S.v;else{S.then(x,c||(c=_r.bind(null,a=new Ba,2)));return}a?_r(a,1,S):a=S}catch(O){_r(a||(a=new Ba),2,O)}};o(x,"_cycle");var n=t[Ix](),i,a,c;if(x(),n.return){var u=o(function(S){try{i.done||n.return()}catch{}return S},"_fixup");if(a&&a.then)return a.then(u,function(S){throw u(S)});u()}return a}if(!("length"in t))throw new TypeError("Object is not iterable");for(var m=[],v=0;v<t.length;v++)m.push(t[v]);return qN(m,function(x){return e(m[x])},r)}o(HN,"_forOf");function zN(t){if(!(t.protected&&t.iv&&t.ciphertext&&t.tag))throw new Error("bad_jwe: missing properties");t.recipients&&t.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(zN,"validateJWE");function Dx({ciphertext:t,tag:e,iv:r,protectedHeader:n,recipient:i},a){let c={protected:n,iv:bi(r),ciphertext:bi(t),tag:bi(e)};return a&&(c.aad=bi(a)),i&&(c.recipients=[i]),c}o(Dx,"encodeJWE");var Vx=o(function(t,e,r={},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(t,r,n)).then(function(i){return Dx(i,n)})}else{let i=e[0].enc;if(!e.reduce((m,v)=>m&&v.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let a,c,u=HN(e,function(m){let v=function(){return a?Promise.resolve(m.encryptCek==null?void 0:m.encryptCek(a)).then(function(x){if(x){var S,O;(S=c)==null||(O=S.recipients)==null||O.push(x)}}):Promise.resolve(m.encrypt(t,r,n)).then(function(x){a=x.cek,c=Dx(x,n)})}();if(v&&v.then)return v.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return c}):c)}}catch(i){return Promise.reject(i)}},"createJWE");var Wx=o(function(t,e){try{let r=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:a,didDocument:c}){var u;if(a!=null&&a.error||c==null)throw new Error(`resolver_error: Could not resolve ${i}: ${a.error}, ${a.message}`);if(!c.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let v=((u=c.keyAgreement)==null?void 0:u.map(x=>typeof x=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(S=>S.id===x):x).filter(x=>typeof x<"u")).filter(x=>x.type==="X25519KeyAgreementKey2019"&&Boolean(x.publicKeyBase58));if(!v.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return v.map(x=>jN(L1(x.publicKeyBase58),x.id))})}catch(a){return Promise.reject(a)}},"encryptersForDID"),n=t.map(i=>r(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(r){return Promise.reject(r)}},"resolveX25519Encrypters");function Jx(t){let e=new N1.XChaCha20Poly1305(t);return(r,n)=>{let i=(0,P1.randomBytes)(e.nonceLength),a=e.seal(i,r,n);return{ciphertext:a.subarray(0,a.length-e.tagLength),tag:a.subarray(a.length-e.tagLength),iv:i}}}o(Jx,"xc20pEncrypter");function KN(t){let e=o(function(a,c={},u){try{let m=I1(JSON.stringify(Object.assign({alg:i},c,{enc:n}))),v=new Uint8Array(Buffer.from(u?`${m}.${bi(u)}`:m));return Promise.resolve({...r(a,v),protectedHeader:m})}catch(m){return Promise.reject(m)}},"encrypt"),r=Jx(t),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(KN,"xc20pDirEncrypter");function Ox(t){let e=o(function(n,i,a){try{return Promise.resolve(r.open(i,n,a))}catch(c){return Promise.reject(c)}},"decrypt"),r=new N1.XChaCha20Poly1305(t);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Ox,"xc20pDirDecrypter");function jN(t,e){let r=o(function(u,m={},v){try{Object.assign(m,{alg:void 0});let x=(0,P1.randomBytes)(32);return Promise.resolve(KN(x).encrypt(u,m,v)).then(function(S){return Promise.resolve(n(x)).then(function(O){return{...S,recipient:O,cek:x}})})}catch(x){return Promise.reject(x)}},"encrypt"),n=o(function(u){try{let m=(0,Iu.generateKeyPair)(),v=(0,Iu.sharedKey)(m.secretKey,t),x=$x(v,a,i),S=Jx(x)(u),O={encrypted_key:bi(S.ciphertext),header:{alg:i,iv:bi(S.iv),tag:bi(S.tag),epk:{kty:"OKP",crv:c,x:bi(m.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(m){return Promise.reject(m)}},"encryptCek"),i="ECDH-ES+XC20PKW",a=256,c="X25519";return{alg:i,enc:"XC20P",encrypt:r,encryptCek:n}}o(jN,"x25519Encrypter");function GN(t){if(!(t&&t.epk&&t.iv&&t.tag))throw new Error("bad_jwe: malformed header")}o(GN,"validateHeader");function Yx(t){let e=o(function(a,c,u,m){try{let S=function(){let P=$x(R,n,r),J=Bx(m.encrypted_key,m.header.tag);return Promise.resolve(Ox(P).decrypt(J,xn(m.header.iv))).then(function(L){return L===null?null:Ox(L).decrypt(a,c,u)})};o(S,"_temp4");var v,x;if(GN((v=m)==null?void 0:v.header),m=m,((x=m.header.epk)==null?void 0:x.crv)!==i||typeof m.header.epk.x>"u")return Promise.resolve(null);let O=xn(m.header.epk.x),R,D=function(){if(t instanceof Uint8Array)R=(0,Iu.sharedKey)(t,O);else return Promise.resolve(t(O)).then(function(P){R=P})}();return Promise.resolve(D&&D.then?D.then(S):S(D))}catch(S){return Promise.reject(S)}},"decrypt"),r="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:r,enc:"XC20P",decrypt:e}}o(Yx,"x25519Decrypter");Im();var dd=o(({enumerable:t=!0,configurable:e=!1}={})=>({enumerable:t,configurable:e,writable:!1}),"readonly"),$1=o(function*(t,e){if(t!=null&&!(t instanceof Uint8Array))for(let[r,n]of Object.entries(t)){let i=[...e,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[a,c]of n.entries()){let u=[...i,a],m=We.asCID(c);m?yield[u.join("/"),m]:typeof c=="object"&&(yield*$1(c,u))}else{let a=We.asCID(n);a?yield[i.join("/"),a]:yield*$1(n,i)}}},"links"),F1=o(function*(t,e){if(t!=null)for(let[r,n]of Object.entries(t)){let i=[...e,r];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!We.asCID(n))if(Array.isArray(n))for(let[a,c]of n.entries()){let u=[...i,a];yield u.join("/"),typeof c=="object"&&!We.asCID(c)&&(yield*F1(c,u))}else yield*F1(n,i)}},"tree"),VN=o((t,e)=>{let r=t;for(let[n,i]of e.entries()){if(r=r[i],r==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let a=We.asCID(r);if(a)return{value:a,remaining:e.slice(n+1).join("/")}}return{value:r}},"get"),Du=class{constructor({cid:e,bytes:r,value:n}){if(!e||!r||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:dd(),bytes:dd(),value:dd(),asBlock:dd()})}links(){return $1(this.value,[])}tree(){return F1(this.value,[])}get(e="/"){return VN(this.value,e.split("/").filter(Boolean))}};o(Du,"Block");var Ua=o(async({value:t,codec:e,hasher:r})=>{if(typeof t>"u")throw new Error('Missing required argument "value"');if(!e||!r)throw new Error("Missing required argument: codec or hasher");let n=e.encode(t),i=await r.digest(n),a=We.create(1,e.code,i);return new Du({value:t,bytes:n,cid:a})},"encode"),Xx=o(async({bytes:t,codec:e,hasher:r})=>{if(!t)throw new Error('Missing required argument "bytes"');if(!e||!r)throw new Error("Missing required argument: codec or hasher");let n=e.decode(t),i=await r.digest(t),a=We.create(1,e.code,i);return new Du({value:n,bytes:t,cid:a})},"decode");Pi();lu();km();Sh();var Hi={};Jt(Hi,{code:()=>fc,decode:()=>X1,encode:()=>qa,name:()=>kP});var WN=["string","number","bigint","symbol"],JN=["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 Zx(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(WN.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(YN(t))return"Buffer";let r=XN(t);return r||"Object"}o(Zx,"is");function YN(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}o(YN,"isBuffer");function XN(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(JN.includes(e))return e}o(XN,"getObjectType");var _e=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,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 $e=class{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o($e,"Token");var rc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",ZN=new TextDecoder,QN=new TextEncoder;function pd(t){return rc&&globalThis.Buffer.isBuffer(t)}o(pd,"isBuffer");function H1(t){return t instanceof Uint8Array?pd(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}o(H1,"asU8A");var rw=rc?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):ew(t,e,r):(t,e,r)=>r-e>64?ZN.decode(t.subarray(e,r)):ew(t,e,r),nw=rc?t=>t.length>64?globalThis.Buffer.from(t):Qx(t):t=>t.length>64?QN.encode(t):Qx(t),ho=o(t=>Uint8Array.from(t),"fromArray"),nc=rc?(t,e,r)=>pd(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),iw=rc?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),H1(globalThis.Buffer.concat(t,e))):(t,e)=>{let r=new Uint8Array(e),n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},ow=rc?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function sw(t,e){if(pd(t)&&pd(e))return t.compare(e);for(let r=0;r<t.length;r++)if(t[r]!==e[r])return t[r]<e[r]?-1:1;return 0}o(sw,"compare");function Qx(t,e=1/0){let r,n=t.length,i=null,a=[];for(let c=0;c<n;++c){if(r=t.charCodeAt(c),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(c+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}o(Qx,"utf8ToBytes");function ew(t,e,r){let n=[];for(;e<r;){let i=t[e],a=null,c=i>239?4:i>223?3:i>191?2:1;if(e+c<=r){let u,m,v,x;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[e+1],(u&192)===128&&(x=(i&31)<<6|u&63,x>127&&(a=x));break;case 3:u=t[e+1],m=t[e+2],(u&192)===128&&(m&192)===128&&(x=(i&15)<<12|(u&63)<<6|m&63,x>2047&&(x<55296||x>57343)&&(a=x));break;case 4:u=t[e+1],m=t[e+2],v=t[e+3],(u&192)===128&&(m&192)===128&&(v&192)===128&&(x=(i&15)<<18|(u&63)<<12|(m&63)<<6|v&63,x>65535&&x<1114112&&(a=x))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),e+=c}return eP(n)}o(ew,"utf8Slice");var tw=4096;function eP(t){let e=t.length;if(e<=tw)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tw));return r}o(eP,"decodeCodePointsArray");var tP=256,ic=class{constructor(e=tP){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 r=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(e,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(r=ow(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=nc(n,0,this.cursor)}else r=iw(this.chunks,this.cursor);return e&&this.reset(),r}};o(ic,"Bl");var mt="CBOR decode error:",z1="CBOR encode error:",Ou=[];Ou[23]=1;Ou[24]=2;Ou[25]=3;Ou[26]=5;Ou[27]=9;function Xo(t,e,r){if(t.length-e<r)throw new Error(`${mt} not enough data for type`)}o(Xo,"assertEnoughData");var Cr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Bn(t,e,r){Xo(t,e,1);let n=t[e];if(r.strict===!0&&n<Cr[0])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Bn,"readUint8");function Un(t,e,r){Xo(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<Cr[1])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Un,"readUint16");function $n(t,e,r){Xo(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<Cr[2])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o($n,"readUint32");function Fn(t,e,r){Xo(t,e,8);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3],i=t[e+4]*16777216+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7],a=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&a<Cr[3])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);if(a<=Number.MAX_SAFE_INTEGER)return Number(a);if(r.allowBigInt===!0)return a;throw new Error(`${mt} integers outside of the safe integer range are not supported`)}o(Fn,"readUint64");function aw(t,e,r,n){return new $e(_e.uint,Bn(t,e+1,n),2)}o(aw,"decodeUint8");function fw(t,e,r,n){return new $e(_e.uint,Un(t,e+1,n),3)}o(fw,"decodeUint16");function cw(t,e,r,n){return new $e(_e.uint,$n(t,e+1,n),5)}o(cw,"decodeUint32");function uw(t,e,r,n){return new $e(_e.uint,Fn(t,e+1,n),9)}o(uw,"decodeUint64");function gi(t,e){return Ur(t,0,e.value)}o(gi,"encodeUint");function Ur(t,e,r){if(r<Cr[0]){let n=Number(r);t.push([e|n])}else if(r<Cr[1]){let n=Number(r);t.push([e|24,n])}else if(r<Cr[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<Cr[3]){let n=Number(r);t.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Cr[4]){let i=[e|27,0,0,0,0,0,0,0],a=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=c&255,c=c>>8,i[3]=c&255,c=c>>8,i[2]=c&255,c=c>>8,i[1]=c&255,t.push(i)}else throw new Error(`${mt} encountered BigInt larger than allowable range`)}}o(Ur,"encodeUintValue");gi.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");Ur.encodedSize=o(function(e){return e<Cr[0]?1:e<Cr[1]?2:e<Cr[2]?3:e<Cr[3]?5:9},"encodedSize");gi.compareTokens=o(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function lw(t,e,r,n){return new $e(_e.negint,-1-Bn(t,e+1,n),2)}o(lw,"decodeNegint8");function hw(t,e,r,n){return new $e(_e.negint,-1-Un(t,e+1,n),3)}o(hw,"decodeNegint16");function dw(t,e,r,n){return new $e(_e.negint,-1-$n(t,e+1,n),5)}o(dw,"decodeNegint32");var K1=BigInt(-1),pw=BigInt(1);function mw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i!="bigint"){let a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new $e(_e.negint,a,9)}if(n.allowBigInt!==!0)throw new Error(`${mt} integers outside of the safe integer range are not supported`);return new $e(_e.negint,K1-BigInt(i),9)}o(mw,"decodeNegint64");function md(t,e){let r=e.value,n=typeof r=="bigint"?r*K1-pw:r*-1-1;Ur(t,e.type.majorEncoded,n)}o(md,"encodeNegint");md.encodedSize=o(function(e){let r=e.value,n=typeof r=="bigint"?r*K1-pw:r*-1-1;return n<Cr[0]?1:n<Cr[1]?2:n<Cr[2]?3:n<Cr[3]?5:9},"encodedSize");md.compareTokens=o(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Ru(t,e,r,n){Xo(t,e,r+n);let i=nc(t,e+r,e+r+n);return new $e(_e.bytes,i,r+n)}o(Ru,"toToken");function bw(t,e,r,n){return Ru(t,e,1,r)}o(bw,"decodeBytesCompact");function gw(t,e,r,n){return Ru(t,e,2,Bn(t,e+1,n))}o(gw,"decodeBytes8");function vw(t,e,r,n){return Ru(t,e,3,Un(t,e+1,n))}o(vw,"decodeBytes16");function yw(t,e,r,n){return Ru(t,e,5,$n(t,e+1,n))}o(yw,"decodeBytes32");function xw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer bytes lengths not supported`);return Ru(t,e,9,i)}o(xw,"decodeBytes64");function bd(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===_e.string?nw(t.value):t.value),t.encodedBytes}o(bd,"tokenBytes");function oc(t,e){let r=bd(e);Ur(t,e.type.majorEncoded,r.length),t.push(r)}o(oc,"encodeBytes");oc.encodedSize=o(function(e){let r=bd(e);return Ur.encodedSize(r.length)+r.length},"encodedSize");oc.compareTokens=o(function(e,r){return nP(bd(e),bd(r))},"compareTokens");function nP(t,e){return t.length<e.length?-1:t.length>e.length?1:sw(t,e)}o(nP,"compareBytes");function Nu(t,e,r,n,i){let a=r+n;Xo(t,e,a);let c=new $e(_e.string,rw(t,e+r,e+a),a);return i.retainStringBytes===!0&&(c.byteValue=nc(t,e+r,e+a)),c}o(Nu,"toToken");function ww(t,e,r,n){return Nu(t,e,1,r,n)}o(ww,"decodeStringCompact");function _w(t,e,r,n){return Nu(t,e,2,Bn(t,e+1,n),n)}o(_w,"decodeString8");function Ew(t,e,r,n){return Nu(t,e,3,Un(t,e+1,n),n)}o(Ew,"decodeString16");function Aw(t,e,r,n){return Nu(t,e,5,$n(t,e+1,n),n)}o(Aw,"decodeString32");function Sw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer string lengths not supported`);return Nu(t,e,9,i,n)}o(Sw,"decodeString64");var Mw=oc;function sc(t,e,r,n){return new $e(_e.array,n,r)}o(sc,"toToken");function Tw(t,e,r,n){return sc(t,e,1,r)}o(Tw,"decodeArrayCompact");function Cw(t,e,r,n){return sc(t,e,2,Bn(t,e+1,n))}o(Cw,"decodeArray8");function kw(t,e,r,n){return sc(t,e,3,Un(t,e+1,n))}o(kw,"decodeArray16");function Iw(t,e,r,n){return sc(t,e,5,$n(t,e+1,n))}o(Iw,"decodeArray32");function Dw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer array lengths not supported`);return sc(t,e,9,i)}o(Dw,"decodeArray64");function Ow(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return sc(t,e,1,1/0)}o(Ow,"decodeArrayIndefinite");function gd(t,e){Ur(t,_e.array.majorEncoded,e.value)}o(gd,"encodeArray");gd.compareTokens=gi.compareTokens;gd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function ac(t,e,r,n){return new $e(_e.map,n,r)}o(ac,"toToken");function Rw(t,e,r,n){return ac(t,e,1,r)}o(Rw,"decodeMapCompact");function Nw(t,e,r,n){return ac(t,e,2,Bn(t,e+1,n))}o(Nw,"decodeMap8");function Pw(t,e,r,n){return ac(t,e,3,Un(t,e+1,n))}o(Pw,"decodeMap16");function Lw(t,e,r,n){return ac(t,e,5,$n(t,e+1,n))}o(Lw,"decodeMap32");function Bw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer map lengths not supported`);return ac(t,e,9,i)}o(Bw,"decodeMap64");function Uw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return ac(t,e,1,1/0)}o(Uw,"decodeMapIndefinite");function vd(t,e){Ur(t,_e.map.majorEncoded,e.value)}o(vd,"encodeMap");vd.compareTokens=gi.compareTokens;vd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function $w(t,e,r,n){return new $e(_e.tag,r,1)}o($w,"decodeTagCompact");function Fw(t,e,r,n){return new $e(_e.tag,Bn(t,e+1,n),2)}o(Fw,"decodeTag8");function qw(t,e,r,n){return new $e(_e.tag,Un(t,e+1,n),3)}o(qw,"decodeTag16");function Hw(t,e,r,n){return new $e(_e.tag,$n(t,e+1,n),5)}o(Hw,"decodeTag32");function zw(t,e,r,n){return new $e(_e.tag,Fn(t,e+1,n),9)}o(zw,"decodeTag64");function yd(t,e){Ur(t,_e.tag.majorEncoded,e.value)}o(yd,"encodeTag");yd.compareTokens=gi.compareTokens;yd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");var cP=20,uP=21,lP=22,hP=23;function Kw(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${mt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new $e(_e.null,null,1):new $e(_e.undefined,void 0,1)}o(Kw,"decodeUndefined");function jw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return new $e(_e.break,void 0,1)}o(jw,"decodeBreak");function j1(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${mt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${mt} Infinity values are not supported`)}return new $e(_e.float,t,e)}o(j1,"createToken");function Gw(t,e,r,n){return j1(G1(t,e+1),3,n)}o(Gw,"decodeFloat16");function Vw(t,e,r,n){return j1(V1(t,e+1),5,n)}o(Vw,"decodeFloat32");function Ww(t,e,r,n){return j1(Zw(t,e+1),9,n)}o(Ww,"decodeFloat64");function xd(t,e,r){let n=e.value;if(n===!1)t.push([_e.float.majorEncoded|cP]);else if(n===!0)t.push([_e.float.majorEncoded|uP]);else if(n===null)t.push([_e.float.majorEncoded|lP]);else if(n===void 0)t.push([_e.float.majorEncoded|hP]);else{let i,a=!1;(!r||r.float64!==!0)&&(Yw(n),i=G1(Fi,1),n===i||Number.isNaN(n)?(Fi[0]=249,t.push(Fi.slice(0,3)),a=!0):(Xw(n),i=V1(Fi,1),n===i&&(Fi[0]=250,t.push(Fi.slice(0,5)),a=!0))),a||(dP(n),i=Zw(Fi,1),Fi[0]=251,t.push(Fi.slice(0,9)))}}o(xd,"encodeFloat");xd.encodedSize=o(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Yw(n);let i=G1(Fi,1);if(n===i||Number.isNaN(n))return 3;if(Xw(n),i=V1(Fi,1),n===i)return 5}return 9},"encodedSize");var Jw=new ArrayBuffer(9),vi=new DataView(Jw,1),Fi=new Uint8Array(Jw,0);function Yw(t){if(t===1/0)vi.setUint16(0,31744,!1);else if(t===-1/0)vi.setUint16(0,64512,!1);else if(Number.isNaN(t))vi.setUint16(0,32256,!1);else{vi.setFloat32(0,t);let e=vi.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)vi.setUint16(0,31744,!1);else if(r===0)vi.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?vi.setUint16(0,0):i<-14?vi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):vi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(Yw,"encodeFloat16");function G1(t,e){if(t.length-e<2)throw new Error(`${mt} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,a;return n===0?a=i*2**-24:n!==31?a=(i+1024)*2**(n-25):a=i===0?1/0:NaN,r&32768?-a:a}o(G1,"readFloat16");function Xw(t){vi.setFloat32(0,t,!1)}o(Xw,"encodeFloat32");function V1(t,e){if(t.length-e<4)throw new Error(`${mt} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}o(V1,"readFloat32");function dP(t){vi.setFloat64(0,t,!1)}o(dP,"encodeFloat64");function Zw(t,e){if(t.length-e<8)throw new Error(`${mt} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}o(Zw,"readFloat64");xd.compareTokens=gi.compareTokens;function $t(t,e,r){throw new Error(`${mt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}o($t,"invalidMinor");function wd(t){return()=>{throw new Error(`${mt} ${t}`)}}o(wd,"errorer");var Pe=[];for(let t=0;t<=23;t++)Pe[t]=$t;Pe[24]=aw;Pe[25]=fw;Pe[26]=cw;Pe[27]=uw;Pe[28]=$t;Pe[29]=$t;Pe[30]=$t;Pe[31]=$t;for(let t=32;t<=55;t++)Pe[t]=$t;Pe[56]=lw;Pe[57]=hw;Pe[58]=dw;Pe[59]=mw;Pe[60]=$t;Pe[61]=$t;Pe[62]=$t;Pe[63]=$t;for(let t=64;t<=87;t++)Pe[t]=bw;Pe[88]=gw;Pe[89]=vw;Pe[90]=yw;Pe[91]=xw;Pe[92]=$t;Pe[93]=$t;Pe[94]=$t;Pe[95]=wd("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Pe[t]=ww;Pe[120]=_w;Pe[121]=Ew;Pe[122]=Aw;Pe[123]=Sw;Pe[124]=$t;Pe[125]=$t;Pe[126]=$t;Pe[127]=wd("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Pe[t]=Tw;Pe[152]=Cw;Pe[153]=kw;Pe[154]=Iw;Pe[155]=Dw;Pe[156]=$t;Pe[157]=$t;Pe[158]=$t;Pe[159]=Ow;for(let t=160;t<=183;t++)Pe[t]=Rw;Pe[184]=Nw;Pe[185]=Pw;Pe[186]=Lw;Pe[187]=Bw;Pe[188]=$t;Pe[189]=$t;Pe[190]=$t;Pe[191]=Uw;for(let t=192;t<=215;t++)Pe[t]=$w;Pe[216]=Fw;Pe[217]=qw;Pe[218]=Hw;Pe[219]=zw;Pe[220]=$t;Pe[221]=$t;Pe[222]=$t;Pe[223]=$t;for(let t=224;t<=243;t++)Pe[t]=wd("simple values are not supported");Pe[244]=$t;Pe[245]=$t;Pe[246]=$t;Pe[247]=Kw;Pe[248]=wd("simple values are not supported");Pe[249]=Gw;Pe[250]=Vw;Pe[251]=Ww;Pe[252]=$t;Pe[253]=$t;Pe[254]=$t;Pe[255]=jw;var qi=[];for(let t=0;t<24;t++)qi[t]=new $e(_e.uint,t,1);for(let t=-1;t>=-24;t--)qi[31-t]=new $e(_e.negint,t,1);qi[64]=new $e(_e.bytes,new Uint8Array(0),1);qi[96]=new $e(_e.string,"",1);qi[128]=new $e(_e.array,0,1);qi[160]=new $e(_e.map,0,1);qi[244]=new $e(_e.false,!1,1);qi[245]=new $e(_e.true,!0,1);qi[246]=new $e(_e.null,null,1);function Qw(t){switch(t.type){case _e.false:return ho([244]);case _e.true:return ho([245]);case _e.null:return ho([246]);case _e.bytes:return t.value.length?void 0:ho([64]);case _e.string:return t.value===""?ho([96]):void 0;case _e.array:return t.value===0?ho([128]):void 0;case _e.map:return t.value===0?ho([160]):void 0;case _e.uint:return t.value<24?ho([Number(t.value)]):void 0;case _e.negint:if(t.value>=-24)return ho([31-Number(t.value)])}}o(Qw,"quickEncodeToken");var mP={float64:!1,mapSorter:vP,quickEncodeToken:Qw};function bP(){let t=[];return t[_e.uint.major]=gi,t[_e.negint.major]=md,t[_e.bytes.major]=oc,t[_e.string.major]=Mw,t[_e.array.major]=gd,t[_e.map.major]=vd,t[_e.tag.major]=yd,t[_e.float.major]=xd,t}o(bP,"makeCborEncoders");var e4=bP(),W1=new ic,Fa=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${z1} object contains circular references`);return new Fa(r,e)}};o(Fa,"Ref");var Bs={null:new $e(_e.null,null),undefined:new $e(_e.undefined,void 0),true:new $e(_e.true,!0),false:new $e(_e.false,!1),emptyArray:new $e(_e.array,0),emptyMap:new $e(_e.map,0)},Us={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new $e(_e.float,t):t>=0?new $e(_e.uint,t):new $e(_e.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new $e(_e.uint,t):new $e(_e.negint,t)},Uint8Array(t,e,r,n){return new $e(_e.bytes,t)},string(t,e,r,n){return new $e(_e.string,t)},boolean(t,e,r,n){return t?Bs.true:Bs.false},null(t,e,r,n){return Bs.null},undefined(t,e,r,n){return Bs.undefined},ArrayBuffer(t,e,r,n){return new $e(_e.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new $e(_e.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Bs.emptyArray,new $e(_e.break)]:Bs.emptyArray;n=Fa.createCheck(n,t);let i=[],a=0;for(let c of t)i[a++]=_d(c,r,n);return r.addBreakTokens?[new $e(_e.array,t.length),i,new $e(_e.break)]:[new $e(_e.array,t.length),i]},Object(t,e,r,n){let i=e!=="Object",a=i?t.keys():Object.keys(t),c=i?t.size:a.length;if(!c)return r.addBreakTokens===!0?[Bs.emptyMap,new $e(_e.break)]:Bs.emptyMap;n=Fa.createCheck(n,t);let u=[],m=0;for(let v of a)u[m++]=[_d(v,r,n),_d(i?t.get(v):t[v],r,n)];return gP(u,r),r.addBreakTokens?[new $e(_e.map,c),u,new $e(_e.break)]:[new $e(_e.map,c),u]}};Us.Map=Us.Object;Us.Buffer=Us.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Us[`${t}Array`]=Us.DataView;function _d(t,e={},r){let n=Zx(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Us[n];if(typeof i=="function"){let c=i(t,n,e,r);if(c!=null)return c}let a=Us[n];if(!a)throw new Error(`${z1} unsupported type: ${n}`);return a(t,n,e,r)}o(_d,"objectToTokens");function gP(t,e){e.mapSorter&&t.sort(e.mapSorter)}o(gP,"sortMapEntries");function vP(t,e){let r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);let i=r.type.major,a=e4[i].compareTokens(r,n);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}o(vP,"mapSorter");function t4(t,e,r,n){if(Array.isArray(e))for(let i of e)t4(t,i,r,n);else r[e.type.major](t,e,n)}o(t4,"tokensToEncoded");function yP(t,e,r){let n=_d(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let a=e[n.type.major];if(a.encodedSize){let c=a.encodedSize(n,r),u=new ic(c);if(a(u,n,r),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return H1(u.chunks[0])}}return W1.reset(),t4(W1,n,e,r),W1.toBytes(!0)}o(yP,"encodeCustom");function J1(t,e){return e=Object.assign({},mP,e),yP(t,e4,e)}o(J1,"encode");var xP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ed=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=qi[e];if(r===void 0){let n=Pe[e];if(!n)throw new Error(`${mt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}};o(Ed,"Tokeniser");var Pu=Symbol.for("DONE"),Ad=Symbol.for("BREAK");function wP(t,e,r){let n=[];for(let i=0;i<t.value;i++){let a=Lu(e,r);if(a===Ad){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed array`)}if(a===Pu)throw new Error(`${mt} found array but not enough entries (got ${i}, expected ${t.value})`);n[i]=a}return n}o(wP,"tokenToArray");function _P(t,e,r){let n=r.useMaps===!0,i=n?void 0:{},a=n?new Map:void 0;for(let c=0;c<t.value;c++){let u=Lu(e,r);if(u===Ad){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed map`)}if(u===Pu)throw new Error(`${mt} found map but not enough entries (got ${c} [no key], expected ${t.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${mt} non-string keys not supported (got ${typeof u})`);if(r.rejectDuplicateMapKeys===!0&&(n&&a.has(u)||!n&&u in i))throw new Error(`${mt} found repeat map key "${u}"`);let m=Lu(e,r);if(m===Pu)throw new Error(`${mt} found map but not enough entries (got ${c} [no value], expected ${t.value})`);n?a.set(u,m):i[u]=m}return n?a:i}o(_P,"tokenToMap");function Lu(t,e){if(t.done())return Pu;let r=t.next();if(r.type===_e.break)return Ad;if(r.type.terminal)return r.value;if(r.type===_e.array)return wP(r,t,e);if(r.type===_e.map)return _P(r,t,e);if(r.type===_e.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=Lu(t,e);return e.tags[r.value](n)}throw new Error(`${mt} tag not supported (${r.value})`)}throw new Error("unsupported")}o(Lu,"tokensToObject");function Y1(t,e){if(!(t instanceof Uint8Array))throw new Error(`${mt} data to decode must be a Uint8Array`);e=Object.assign({},xP,e);let r=e.tokenizer||new Ed(t,e),n=Lu(r,e);if(n===Pu)throw new Error(`${mt} did not find any content to decode`);if(n===Ad)throw new Error(`${mt} got unexpected break`);if(!r.done())throw new Error(`${mt} too many terminals, data makes no sense`);return n}o(Y1,"decode");Pi();var r4=42;function AP(t){if(t.asCID!==t)return null;let e=We.asCID(t);if(!e)return null;let r=new Uint8Array(e.bytes.byteLength+1);return r.set(e.bytes,1),[new $e(_e.tag,r4),new $e(_e.bytes,r)]}o(AP,"cidEncoder");function SP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(SP,"undefinedEncoder");function MP(t){if(Number.isNaN(t))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(t===1/0||t===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(MP,"numberEncoder");var TP={float64:!0,typeEncoders:{Object:AP,undefined:SP,number:MP}};function CP(t){if(t[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return We.decode(t.subarray(1))}o(CP,"cidDecoder");var n4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};n4.tags[r4]=CP;var kP="dag-cbor",fc=113,qa=o(t=>J1(t,TP),"encode"),X1=o(t=>Y1(t,n4),"decode");var IP=24;async function i4(t){let e=await Ua({value:t,codec:Hi,hasher:Ss});return{cid:e.cid,linkedBlock:e.bytes}}o(i4,"encodePayload");function DP(t,e=IP){let r=(e-t.length%e)%e,n=new Uint8Array(t.length+r);return n.set(t,0),n}o(DP,"pad");async function OP(t){return(await Ua({value:t,codec:Hi,hasher:Ih})).cid}o(OP,"encodeIdentityCID");function RP(t){if(t=We.asCID(t),t.code!==fc)throw new Error("CID codec must be dag-cbor");if(t.multihash.code!==Ih.code)throw new Error("CID must use identity multihash");return X1(t.multihash.digest)}o(RP,"decodeIdentityCID");async function o4(t,e){return DP((await OP(t)).bytes,e)}o(o4,"prepareCleartext");function s4(t){return RP(We.decodeFirst(t)[0])}o(s4,"decodeCleartext");var a4=Symbol("abortable"),Sd=Symbol("aborted");function f4(t,e){if(e.aborted)return Promise.reject(Sd);let r,n=new Promise((i,a)=>{r=a});return e.addEventListener("abort",()=>{r(Sd)}),Promise.race([t,n])}o(f4,"abortable");var c4=o((t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),""),"nanoid");var Md="utils_abort_request";var an;(function(t){t[t.PARSE_ERROR=-32700]="PARSE_ERROR",t[t.INVALID_REQUEST=-32600]="INVALID_REQUEST",t[t.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",t[t.INVALID_PARAMS=-32602]="INVALID_PARAMS",t[t.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(an||(an={}));var u4={[an.PARSE_ERROR]:"Parse error",[an.INVALID_REQUEST]:"Invalid request",[an.METHOD_NOT_FOUND]:"Method not found",[an.INVALID_PARAMS]:"Invalid params",[an.INTERNAL_ERROR]:"Internal error"};function NP(t){return-32e3>=t&&t>=-32099}o(NP,"isServerError");function Td(t){return u4[t.toString()]??(NP(t)?"Server error":"Application error")}o(Td,"getErrorMessage");var wn=class extends Error{static fromObject(e){return new wn(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,r,n){super(),Object.setPrototypeOf(this,wn.prototype),this.code=e,this.data=n,this.message=r??Td(e)}};o(wn,"RPCError");function Bu(t){let e=u4[t];return o(function(n){return new wn(t,e,n)},"createError")}o(Bu,"createErrorFactory");var PP=Bu(an.PARSE_ERROR),gG=Bu(an.INVALID_REQUEST),vG=Bu(an.METHOD_NOT_FOUND),yG=Bu(an.INVALID_PARAMS),xG=Bu(an.INTERNAL_ERROR);function LP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(LP,"_checkPrivateRedeclaration");function BP(t,e){return e.get?e.get.call(t):e.value}o(BP,"_classApplyDescriptorGet");function UP(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}o(UP,"_classApplyDescriptorSet");function l4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(l4,"_classExtractFieldDescriptor");function Z1(t,e){var r=l4(t,e,"get");return BP(t,r)}o(Z1,"_classPrivateFieldGet");function $P(t,e,r){LP(t,e),e.set(t,r)}o($P,"_classPrivateFieldInit");function FP(t,e,r){var n=l4(t,e,"set");return UP(t,n,r),r}o(FP,"_classPrivateFieldSet");var Uu=new WeakMap,cc=class{get connection(){return Z1(this,Uu)}createID(){return c4()}request(e,r=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Sd);let a=this.createID(),c=Z1(this,Uu).send({jsonrpc:"2.0",id:a,method:e,params:r}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw wn.fromObject(u.error);return u.result});return i==null?c:(i.addEventListener("abort",()=>{this.notify(Md,{id:a})}),f4(c,i))}async notify(e,r=void 0){await Z1(this,Uu).send({jsonrpc:"2.0",method:e,params:r})}constructor(e){$P(this,Uu,{writable:!0,value:void 0}),FP(this,Uu,e)}};o(cc,"RPCClient");function h4(t,e){return{jsonrpc:"2.0",id:t,error:{code:e,message:Td(e)}}}o(h4,"createErrorResponse");function qP(t,e,r){console.warn("Unhandled handler error",e,r)}o(qP,"fallbackOnHandlerError");function HP(t,e){console.warn("Unhandled invalid message",e)}o(HP,"fallbackOnInvalidMessage");function zP(t,e){console.warn("Unhandled notification",e)}o(zP,"fallbackOnNotification");function d4(t,e={}){let r=e.onHandlerError??qP,n=e.onInvalidMessage??HP,i=e.onNotification??zP,a={};function c(u,m){if(m.method===Md){let v=m.params?.id;v!=null&&a[v]?.abort()}else i(u,m)}return o(c,"handleNotification"),o(async function(m,v){let x=v.id;if(v.jsonrpc!=="2.0"||v.method==null)return x==null?(n(m,v),null):h4(x,an.INVALID_REQUEST);let S=t[v.method];if(S==null)return x==null?(c(m,v),null):h4(x,an.METHOD_NOT_FOUND);try{let O;if(x!=null&&S[a4]){let D=new AbortController;a[x]=D,O=S(m,v.params,{signal:D.signal})}else O=S(m,v.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return x==null||a[x]?.signal.aborted?null:{jsonrpc:"2.0",id:x,result:R}}catch(O){if(x==null||a[x]?.signal.aborted)return r(m,v,O),null;let R;if(O instanceof wn)R=O.toObject();else{r(m,v,O);let D=O.code??-32e3;R={code:D,message:O.message||Td(D)}}return{jsonrpc:"2.0",id:x,error:R}}finally{x!=null&&delete a[x]}},"handleRequest")}o(d4,"createHandler");Pi();var H5=Lt(i5(),1),Zr=Lt(Ka(),1);function ab(){return ab=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ab.apply(this,arguments)}o(ab,"_extends");var fb={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},fL={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},cb={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},cL={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:fb,1:cb}}},uL={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:fb,1:cb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},zu={"2":fb,"10":fL,"19":{assetName:cb,assetType:cL,assetId:uL}};function o5(t,e){return t.split(e.parameters.delimiter)}o(o5,"splitParams");function Ku(t,e){var r=o5(t,e),n={};return r.forEach(function(i,a){n[e.parameters.values[a].name]=i}),n}o(Ku,"getParams");function pc(t,e){return Object.values(e.parameters.values).map(function(r){var n=t[r.name];return typeof n=="string"?n:pc(n,r)}).join(e.parameters.delimiter)}o(pc,"joinParams");function ju(t,e){if(!new RegExp(e.regex).test(t))return!1;var r=o5(t,e);if(r.length!==Object.keys(e.parameters.values).length)return!1;var n=r.map(function(i,a){return new RegExp(e.parameters.values[a].regex).test(i)}).filter(function(i){return!!i});return n.length===r.length}o(ju,"isValidId");var Hs=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.namespace=r.namespace,this.reference=r.reference}o(t,"ChainId"),t.parse=o(function(n){if(!ju(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Ku(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return pc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();Hs.spec=zu["2"];var zs=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.address=r.address}o(t,"AccountId"),t.parse=o(function(n){if(!ju(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=Ku(n,this.spec),a=i.namespace,c=i.reference,u=i.address,m=new Hs({namespace:a,reference:c});return new t({chainId:m,address:u}).toJSON()},"parse"),t.format=o(function(n){var i=new Hs(n.chainId),a=ab({},i.toJSON(),{address:n.address});return pc(a,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),t}();zs.spec=zu["10"];var ub=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.namespace=r.namespace,this.reference=r.reference}o(t,"AssetName"),t.parse=o(function(n){if(!ju(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Ku(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return pc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();ub.spec=zu["19"].assetName;var lL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.assetName=new ub(r.assetName)}o(t,"AssetType"),t.parse=o(function(n){if(!ju(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Ku(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return pc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),t}();lL.spec=zu["19"].assetType;var hL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.assetName=new ub(r.assetName),this.tokenId=r.tokenId}o(t,"AssetId"),t.parse=o(function(n){if(!ju(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Ku(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return pc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),t}();hL.spec=zu["19"].assetId;var s5="logger/5.7.0";var a5=!1,f5=!1,Rd={debug:1,default:2,info:2,warning:3,error:4,off:5},c5=Rd.default,lb=null;function dL(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}o(dL,"_checkNormalize");var u5=dL(),hb;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(hb||(hb={}));var Ki;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ki||(Ki={}));var l5="0123456789abcdef",Et=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let n=e.toLowerCase();Rd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(c5>Rd[n])&&console.log.apply(console,r)}debug(...e){this._log(Et.levels.DEBUG,e)}info(...e){this._log(Et.levels.INFO,e)}warn(...e){this._log(Et.levels.WARNING,e)}makeError(e,r,n){if(f5)return this.makeError("censored error",r,{});r||(r=Et.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(m=>{let v=n[m];try{if(v instanceof Uint8Array){let x="";for(let S=0;S<v.length;S++)x+=l5[v[S]>>4],x+=l5[v[S]&15];i.push(m+"=Uint8Array(0x"+x+")")}else i.push(m+"="+JSON.stringify(v))}catch{i.push(m+"="+JSON.stringify(n[m].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let a=e,c="";switch(r){case Ki.NUMERIC_FAULT:{c="NUMERIC_FAULT";let m=e;switch(m){case"overflow":case"underflow":case"division-by-zero":c+="-"+m;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Ki.CALL_EXCEPTION:case Ki.INSUFFICIENT_FUNDS:case Ki.MISSING_NEW:case Ki.NONCE_EXPIRED:case Ki.REPLACEMENT_UNDERPRICED:case Ki.TRANSACTION_REPLACED:case Ki.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let u=new Error(e);return u.reason=a,u.code=r,Object.keys(n).forEach(function(m){u[m]=n[m]}),u}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Et.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),u5&&this.throwError("platform missing String.prototype.normalize",Et.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u5})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,Et.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,Et.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Et.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return lb||(lb=new Et(s5)),lb}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a5){if(!e)return;this.globalLogger().throwError("error censorship permanent",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}f5=!!e,a5=!!r}static setLogLevel(e){let r=Rd[e.toLowerCase()];if(r==null){Et.globalLogger().warn("invalid log level - "+e);return}c5=r}static from(e){return new Et(e)}};o(Et,"Logger");Et.errors=Ki;Et.levels=hb;var h5="bytes/5.7.0";var gr=new Et(h5);function p5(t){return!!t.toHexString}o(p5,"isHexable");function mc(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return mc(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}o(mc,"addSlice");function m5(t){return ji(t)&&!(t.length%2)||pb(t)}o(m5,"isBytesLike");function d5(t){return typeof t=="number"&&t==t&&t%1===0}o(d5,"isInteger");function pb(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!d5(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!d5(r)||r<0||r>=256)return!1}return!0}o(pb,"isBytes");function or(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),mc(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),p5(t)&&(t=t.toHexString()),ji(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":gr.throwArgumentError("hex data is odd-length","value",t));let n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return mc(new Uint8Array(n))}return pb(t)?mc(new Uint8Array(t)):gr.throwArgumentError("invalid arrayify value","value",t)}o(or,"arrayify");function mb(t){let e=t.map(i=>or(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),mc(n)}o(mb,"concat");function pL(t,e){t=or(t),t.length>e&&gr.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),mc(r)}o(pL,"zeroPad");function ji(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}o(ji,"isHexString");var db="0123456789abcdef";function Yr(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=db[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),p5(t))return t.toHexString();if(ji(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":gr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(pb(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=db[(i&240)>>4]+db[i&15]}return r}return gr.throwArgumentError("invalid hexlify value","value",t)}o(Yr,"hexlify");function Nd(t){if(typeof t!="string")t=Yr(t);else if(!ji(t)||t.length%2)return null;return(t.length-2)/2}o(Nd,"hexDataLength");function Pd(t,e,r){return typeof t!="string"?t=Yr(t):(!ji(t)||t.length%2)&&gr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}o(Pd,"hexDataSlice");function Ks(t,e){for(typeof t!="string"?t=Yr(t):ji(t)||gr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&gr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}o(Ks,"hexZeroPad");function Ld(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(m5(t)){let r=or(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Yr(r.slice(0,32)),e.s=Yr(r.slice(32,64))):r.length===65?(e.r=Yr(r.slice(0,32)),e.s=Yr(r.slice(32,64)),e.v=r[64]):gr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:gr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Yr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=pL(or(e._vs),32);e._vs=Yr(i);let a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&gr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=Yr(i);e.s==null?e.s=c:e.s!==c&&gr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?gr.throwArgumentError("signature missing v and recoveryParam","signature",t):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&&gr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!ji(e.r)?gr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ks(e.r,32),e.s==null||!ji(e.s)?gr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ks(e.s,32);let r=or(e.s);r[0]>=128&&gr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let n=Yr(r);e._vs&&(ji(e._vs)||gr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ks(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&gr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(Ld,"splitSignature");var v5=Lt(gb());var g5="bignumber/5.7.0";var mL=v5.default.BN,hV=new Et(g5);function vb(t){return new mL(t,36).toString(16)}o(vb,"_base36To16");var y5=Lt(Fm());function bc(t){return"0x"+y5.default.keccak_256(or(t))}o(bc,"keccak256");var x5="address/5.7.0";var Gu=new Et(x5);function w5(t){ji(t,20)||Gu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let n=or(bc(r));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(w5,"getChecksumAddress");var vL=9007199254740991;function yL(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}o(yL,"log10");var yb={};for(let t=0;t<10;t++)yb[String(t)]=String(t);for(let t=0;t<26;t++)yb[String.fromCharCode(65+t)]=String(10+t);var _5=Math.floor(yL(vL));function xL(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>yb[n]).join("");for(;e.length>=_5;){let n=e.substring(0,_5);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}o(xL,"ibanChecksum");function E5(t){let e=null;if(typeof t!="string"&&Gu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=w5(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Gu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==xL(t)&&Gu.throwArgumentError("bad icap checksum","address",t),e=vb(t.substring(4));e.length<40;)e="0"+e;e=w5("0x"+e)}else Gu.throwArgumentError("invalid address","address",t);return e}o(E5,"getAddress");var A5="properties/5.7.0";var kV=new Et(A5);function gc(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}o(gc,"defineReadOnly");var S5="strings/5.7.0";var M5=new Et(S5),Vu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Vu||(Vu={}));var ja;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(ja||(ja={}));function wL(t,e,r,n,i){return M5.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}o(wL,"errorFunc");function T5(t,e,r,n,i){if(t===ja.BAD_PREFIX||t===ja.UNEXPECTED_CONTINUE){let a=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)a++;return a}return t===ja.OVERRUN?r.length-e-1:0}o(T5,"ignoreFunc");function _L(t,e,r,n,i){return t===ja.OVERLONG?(n.push(i),0):(n.push(65533),T5(t,e,r,n,i))}o(_L,"replaceFunc");var EL=Object.freeze({error:wL,ignore:T5,replace:_L});function Wu(t,e=Vu.current){e!=Vu.current&&(M5.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;let a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(a&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return or(r)}o(Wu,"toUtf8Bytes");var C5=`Ethereum Signed Message:
|
|
652
|
-
`;function xb(t){return typeof t=="string"&&(t=Wu(t)),bc(mb([Wu(C5),Wu(String(t.length)),t]))}o(xb,"hashMessage");var yt=Lt(gb()),bo=Lt(xu());function vc(t,e,r){return r={path:e,exports:{},require:function(n,i){return AL(n,i??r.path)}},t(r,r.exports),r.exports}o(vc,"createCommonjsModule");function AL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(AL,"commonjsRequire");var Ab=I5;function I5(t,e){if(!t)throw new Error(e||"Assertion failed")}o(I5,"assert");I5.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual");var Gi=vc(function(t,e){"use strict";var r=e;function n(c,u){if(Array.isArray(c))return c.slice();if(!c)return[];var m=[];if(typeof c!="string"){for(var v=0;v<c.length;v++)m[v]=c[v]|0;return m}if(u==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var v=0;v<c.length;v+=2)m.push(parseInt(c[v]+c[v+1],16))}else for(var v=0;v<c.length;v++){var x=c.charCodeAt(v),S=x>>8,O=x&255;S?m.push(S,O):m.push(O)}return m}o(n,"toArray"),r.toArray=n;function i(c){return c.length===1?"0"+c:c}o(i,"zero2"),r.zero2=i;function a(c){for(var u="",m=0;m<c.length;m++)u+=i(c[m].toString(16));return u}o(a,"toHex"),r.toHex=a,r.encode=o(function(u,m){return m==="hex"?a(u):u},"encode")}),Hn=vc(function(t,e){"use strict";var r=e;r.assert=Ab,r.toArray=Gi.toArray,r.zero2=Gi.zero2,r.toHex=Gi.toHex,r.encode=Gi.encode;function n(m,v,x){var S=new Array(Math.max(m.bitLength(),x)+1);S.fill(0);for(var O=1<<v+1,R=m.clone(),D=0;D<S.length;D++){var P,J=R.andln(O-1);R.isOdd()?(J>(O>>1)-1?P=(O>>1)-J:P=J,R.isubn(P)):P=0,S[D]=P,R.iushrn(1)}return S}o(n,"getNAF"),r.getNAF=n;function i(m,v){var x=[[],[]];m=m.clone(),v=v.clone();for(var S=0,O=0,R;m.cmpn(-S)>0||v.cmpn(-O)>0;){var D=m.andln(3)+S&3,P=v.andln(3)+O&3;D===3&&(D=-1),P===3&&(P=-1);var J;(D&1)===0?J=0:(R=m.andln(7)+S&7,(R===3||R===5)&&P===2?J=-D:J=D),x[0].push(J);var L;(P&1)===0?L=0:(R=v.andln(7)+O&7,(R===3||R===5)&&D===2?L=-P:L=P),x[1].push(L),2*S===J+1&&(S=1-S),2*O===L+1&&(O=1-O),m.iushrn(1),v.iushrn(1)}return x}o(i,"getJSF"),r.getJSF=i;function a(m,v,x){var S="_"+v;m.prototype[v]=o(function(){return this[S]!==void 0?this[S]:this[S]=x.call(this)},"cachedProperty")}o(a,"cachedProperty"),r.cachedProperty=a;function c(m){return typeof m=="string"?r.toArray(m,"hex"):m}o(c,"parseBytes"),r.parseBytes=c;function u(m){return new yt.default(m,"hex","le")}o(u,"intFromLE"),r.intFromLE=u}),$d=Hn.getNAF,SL=Hn.getJSF,Fd=Hn.assert;function Gs(t,e){this.type=t,this.p=new yt.default(e.p,16),this.red=e.prime?yt.default.red(e.prime):yt.default.mont(this.p),this.zero=new yt.default(0).toRed(this.red),this.one=new yt.default(1).toRed(this.red),this.two=new yt.default(2).toRed(this.red),this.n=e.n&&new yt.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Gs,"BaseCurve");var Ga=Gs;Gs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Gs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Gs.prototype._fixedNafMul=o(function(e,r){Fd(e.precomputed);var n=e._getDoubles(),i=$d(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],u,m;for(u=0;u<i.length;u+=n.step){m=0;for(var v=u+n.step-1;v>=u;v--)m=(m<<1)+i[v];c.push(m)}for(var x=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)m=c[u],m===O?S=S.mixedAdd(n.points[u]):m===-O&&(S=S.mixedAdd(n.points[u].neg()));x=x.add(S)}return x.toP()},"_fixedNafMul");Gs.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=$d(r,n,this._bitLength),u=this.jpoint(null,null,null),m=c.length-1;m>=0;m--){for(var v=0;m>=0&&c[m]===0;m--)v++;if(m>=0&&v++,u=u.dblp(v),m<0)break;var x=c[m];Fd(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(a[x-1>>1]):u=u.mixedAdd(a[-x-1>>1].neg()):x>0?u=u.add(a[x-1>>1]):u=u.add(a[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Gs.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,m=this._wnafT3,v=0,x,S,O;for(x=0;x<i;x++){O=r[x];var R=O._getNAFPoints(e);c[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var D=x-1,P=x;if(c[D]!==1||c[P]!==1){m[D]=$d(n[D],c[D],this._bitLength),m[P]=$d(n[P],c[P],this._bitLength),v=Math.max(m[D].length,v),v=Math.max(m[P].length,v);continue}var J=[r[D],null,null,r[P]];r[D].y.cmp(r[P].y)===0?(J[1]=r[D].add(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg())):r[D].y.cmp(r[P].y.redNeg())===0?(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].add(r[P].neg())):(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],W=SL(n[D],n[P]);for(v=Math.max(W[0].length,v),m[D]=new Array(v),m[P]=new Array(v),S=0;S<v;S++){var Q=W[0][S]|0,Y=W[1][S]|0;m[D][S]=L[(Q+1)*3+(Y+1)],m[P][S]=0,u[D]=J}}var oe=this.jpoint(null,null,null),j=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var G=!0;for(S=0;S<i;S++)j[S]=m[S][x]|0,j[S]!==0&&(G=!1);if(!G)break;H++,x--}if(x>=0&&H++,oe=oe.dblp(H),x<0)break;for(S=0;S<i;S++){var le=j[S];le!==0&&(le>0?O=u[S][le-1>>1]:le<0&&(O=u[S][-le-1>>1].neg()),O.type==="affine"?oe=oe.mixedAdd(O):oe=oe.add(O))}}for(x=0;x<i;x++)u[x]=null;return a?oe:oe.toP()},"_wnafMulAdd");function wi(t,e){this.curve=t,this.type=e,this.precomputed=null}o(wi,"BasePoint");Gs.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Gs.prototype.decodePoint=o(function(e,r){e=Hn.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Fd(e[e.length-1]%2===0):e[0]===7&&Fd(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 r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode");wi.prototype.encode=o(function(e,r){return Hn.encode(this._encode(r),e)},"encode");wi.prototype.precompute=o(function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},"precompute");wi.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},"_hasDoubles");wi.prototype._getDoubles=o(function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=e){for(var c=0;c<e;c++)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 r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:e,points:r}},"_getNAFPoints");wi.prototype._getBeta=o(function(){return null},"_getBeta");wi.prototype.dblp=o(function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r},"dblp");var Sb=vc(function(t){typeof Object.create=="function"?t.exports=o(function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):t.exports=o(function(r,n){if(n){r.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}},"inherits")}),ML=Hn.assert;function _i(t){Ga.call(this,"short",t),this.a=new yt.default(t.a,16).toRed(this.red),this.b=new yt.default(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(_i,"ShortCurve");Sb(_i,Ga);var TL=_i;_i.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new yt.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new yt.default(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],ML(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new yt.default(u.a,16),b:new yt.default(u.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism");_i.prototype._getEndoRoots=o(function(e){var r=e===this.p?this.red:yt.default.mont(e),n=new yt.default(2).toRed(r).redInvm(),i=n.redNeg(),a=new yt.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=i.redAdd(a).fromRed(),u=i.redSub(a).fromRed();return[c,u]},"_getEndoRoots");_i.prototype._getEndoBasis=o(function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),a=new yt.default(1),c=new yt.default(0),u=new yt.default(0),m=new yt.default(1),v,x,S,O,R,D,P,J=0,L,W;n.cmpn(0)!==0;){var Q=i.div(n);L=i.sub(Q.mul(n)),W=u.sub(Q.mul(a));var Y=m.sub(Q.mul(c));if(!S&&L.cmp(r)<0)v=P.neg(),x=a,S=L.neg(),O=W;else if(S&&++J===2)break;P=L,i=n,n=L,u=a,a=W,m=c,c=Y}R=L.neg(),D=W;var oe=S.sqr().add(O.sqr()),j=R.sqr().add(D.sqr());return j.cmp(oe)>=0&&(R=v,D=x),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),D=D.neg()),[{a:S,b:O},{a:R,b:D}]},"_getEndoBasis");_i.prototype._endoSplit=o(function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),c=n.b.neg().mul(e).divRound(this.n),u=a.mul(n.a),m=c.mul(i.a),v=a.mul(n.b),x=c.mul(i.b),S=e.sub(u).sub(m),O=v.add(x).neg();return{k1:S,k2:O}},"_endoSplit");_i.prototype.pointFromX=o(function(e,r){e=new yt.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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");_i.prototype.validate=o(function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},"validate");_i.prototype._endoWnafMulAdd=o(function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var u=this._endoSplit(r[c]),m=e[c],v=m._getBeta();u.k1.negative&&(u.k1.ineg(),m=m.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=m,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return x},"_endoWnafMulAdd");function Ir(t,e,r,n){Ga.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new yt.default(e,16),this.y=new yt.default(r,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");Sb(Ir,Ga.BasePoint);_i.prototype.point=o(function(e,r,n){return new Ir(this,e,r,n)},"point");_i.prototype.pointFromJSON=o(function(e,r){return Ir.fromJSON(this,e,r)},"pointFromJSON");Ir.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(a){return n.point(a.x.redMul(n.endo.beta),a.y)},"endoMul");e.beta=r,r.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 r}},"_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,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function a(u){return e.point(u[0],u[1],n)}o(a,"obj2point");var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(a))}},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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),c=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,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 yt.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");Ir.prototype.mulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},"mulAdd");Ir.prototype.jmulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,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 r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(a){return a.neg()},"negate");r.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 r},"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 Fr(t,e,r,n){Ga.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yt.default(0)):(this.x=new yt.default(e,16),this.y=new yt.default(r,16),this.z=new yt.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(Fr,"JPoint");Sb(Fr,Ga.BasePoint);_i.prototype.jpoint=o(function(e,r,n){return new Fr(this,e,r,n)},"jpoint");Fr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)},"toP");Fr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Fr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),m=i.redSub(a),v=c.redSub(u);if(m.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=m.redSqr(),S=x.redMul(m),O=i.redMul(x),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),D=v.redMul(O.redISub(R)).redISub(c.redMul(S)),P=this.z.redMul(e.z).redMul(m);return this.curve.jpoint(R,D,P)},"add");Fr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,c=e.y.redMul(r).redMul(this.z),u=n.redSub(i),m=a.redSub(c);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),x=v.redMul(u),S=n.redMul(v),O=m.redSqr().redIAdd(x).redISub(S).redISub(S),R=m.redMul(S.redISub(O)).redISub(a.redMul(x)),D=this.z.redMul(u);return this.curve.jpoint(O,R,D)},"mixedAdd");Fr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,c=this.x,u=this.y,m=this.z,v=m.redSqr().redSqr(),x=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=x.redSqr(),R=O.redSqr(),D=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),P=c.redMul(O),J=D.redSqr().redISub(P.redAdd(P)),L=P.redISub(J),W=D.redMul(L);W=W.redIAdd(W).redISub(R);var Q=x.redMul(m);r+1<e&&(v=v.redMul(R)),c=J,m=Q,x=W}return this.curve.jpoint(c,x.redMul(a),m)},"dblp");Fr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Fr.prototype._zeroDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i),v=m.redSqr().redISub(u).redISub(u),x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),e=v,r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),D=this.x.redAdd(O).redSqr().redISub(S).redISub(R);D=D.redIAdd(D);var P=S.redAdd(S).redIAdd(S),J=P.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=J.redISub(D).redISub(D),r=P.redMul(D.redISub(e)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)},"_zeroDbl");Fr.prototype._threeDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),v=m.redSqr().redISub(u).redISub(u);e=v;var x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),D=this.x.redSub(S).redMul(this.x.redAdd(S));D=D.redAdd(D).redIAdd(D);var P=R.redIAdd(R);P=P.redIAdd(P);var J=P.redAdd(P);e=D.redSqr().redISub(J),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(S);var L=O.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),r=D.redMul(P.redISub(e)).redISub(L)}return this.curve.jpoint(e,r,n)},"_threeDbl");Fr.prototype._dbl=o(function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),c=r.redSqr(),u=n.redSqr(),m=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var x=v.redMul(u),S=m.redSqr().redISub(x.redAdd(x)),O=x.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=m.redMul(O).redISub(R),P=n.redAdd(n).redMul(i);return this.curve.jpoint(S,D,P)},"_dbl");Fr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(c);var m=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=a.redIAdd(u).redSqr().redISub(c).redISub(m).redISub(v),S=r.redMul(x);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(m).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(x.redMul(v.redISub(x)).redISub(u.redMul(m)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=this.z.redAdd(u).redSqr().redISub(n).redISub(m);return this.curve.jpoint(O,R,D)},"trpl");Fr.prototype.mul=o(function(e,r){return e=new yt.default(e,r),this.curve._wnafMul(this,e)},"mul");Fr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Fr.prototype.eqXToP=o(function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},"eqXToP");Fr.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");Fr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var Bd=vc(function(t,e){"use strict";var r=e;r.base=Ga,r.short=TL,r.mont=null,r.edwards=null}),Ud=vc(function(t,e){"use strict";var r=e,n=Hn.assert;function i(u){u.type==="short"?this.curve=new Bd.short(u):u.type==="edwards"?this.curve=new Bd.edwards(u):this.curve=new Bd.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"),r.PresetCurve=i;function a(u,m){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var v=new i(m);return Object.defineProperty(r,u,{configurable:!0,enumerable:!0,value:v}),v}})}o(a,"defineCurve"),a("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:bo.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:bo.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:bo.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:bo.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"]}),a("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:bo.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bo.default.sha256,gRed:!1,g:["9"]}),a("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:bo.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}a("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:bo.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function js(t){if(!(this instanceof js))return new js(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Gi.toArray(t.entropy,t.entropyEnc||"hex"),r=Gi.toArray(t.nonce,t.nonceEnc||"hex"),n=Gi.toArray(t.pers,t.persEnc||"hex");Ab(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(js,"HmacDRBG");var D5=js;js.prototype._init=o(function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");js.prototype._hmac=o(function(){return new bo.default.hmac(this.hash,this.K)},"hmac");js.prototype._update=o(function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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");js.prototype.reseed=o(function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Gi.toArray(e,r),n=Gi.toArray(n,i),Ab(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");js.prototype.generate=o(function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Gi.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(n),this._reseed++,Gi.encode(c,r)},"generate");var Eb=Hn.assert;function Xr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(Xr,"KeyPair");var Mb=Xr;Xr.fromPublic=o(function(e,r,n){return r instanceof Xr?r:new Xr(e,{pub:r,pubEnc:n})},"fromPublic");Xr.fromPrivate=o(function(e,r,n){return r instanceof Xr?r:new Xr(e,{priv:r,privEnc:n})},"fromPrivate");Xr.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");Xr.prototype.getPublic=o(function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},"getPublic");Xr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Xr.prototype._importPrivate=o(function(e,r){this.priv=new yt.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Xr.prototype._importPublic=o(function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?Eb(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Eb(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,r)},"_importPublic");Xr.prototype.derive=o(function(e){return e.validate()||Eb(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Xr.prototype.sign=o(function(e,r,n){return this.ec.sign(e,this,r,n)},"sign");Xr.prototype.verify=o(function(e,r){return this.ec.verify(e,r,this)},"verify");Xr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var CL=Hn.assert;function qd(t,e){if(t instanceof qd)return t;this._importDER(t,e)||(CL(t.r&&t.s,"Signature without r or s"),this.r=new yt.default(t.r,16),this.s=new yt.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(qd,"Signature");var Hd=qd;function kL(){this.place=0}o(kL,"Position");function wb(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,c=e.place;a<n;a++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}o(wb,"getLength");function k5(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}o(k5,"rmPadding");qd.prototype._importDER=o(function(e,r){e=Hn.toArray(e,r);var n=new kL;if(e[n.place++]!==48)return!1;var i=wb(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=wb(e,n);if(a===!1)return!1;var c=e.slice(n.place,a+n.place);if(n.place+=a,e[n.place++]!==2)return!1;var u=wb(e,n);if(u===!1||e.length!==u+n.place)return!1;var m=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(m[0]===0)if(m[1]&128)m=m.slice(1);else return!1;return this.r=new yt.default(c),this.s=new yt.default(m),this.recoveryParam=null,!0},"_importDER");function _b(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}o(_b,"constructLength");qd.prototype.toDER=o(function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=k5(r),n=k5(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];_b(i,r.length),i=i.concat(r),i.push(2),_b(i,n.length);var a=i.concat(n),c=[48];return _b(c,a.length),c=c.concat(a),Hn.encode(c,e)},"toDER");var IL=o(function(){throw new Error("unsupported")},"rand"),O5=Hn.assert;function xi(t){if(!(this instanceof xi))return new xi(t);typeof t=="string"&&(O5(Object.prototype.hasOwnProperty.call(Ud,t),"Unknown curve "+t),t=Ud[t]),t instanceof Ud.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}o(xi,"EC");var DL=xi;xi.prototype.keyPair=o(function(e){return new Mb(this,e)},"keyPair");xi.prototype.keyFromPrivate=o(function(e,r){return Mb.fromPrivate(this,e,r)},"keyFromPrivate");xi.prototype.keyFromPublic=o(function(e,r){return Mb.fromPublic(this,e,r)},"keyFromPublic");xi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new D5({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||IL(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yt.default(2));;){var a=new yt.default(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},"genKeyPair");xi.prototype._truncateToN=o(function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");xi.prototype.sign=o(function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yt.default(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),m=new D5({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new yt.default(1)),x=0;;x++){var S=i.k?i.k(x):new yt.default(m.generate(this.n.byteLength()));if(S=this._truncateToN(S,!0),!(S.cmpn(1)<=0||S.cmp(v)>=0)){var O=this.g.mul(S);if(!O.isInfinity()){var R=O.getX(),D=R.umod(this.n);if(D.cmpn(0)!==0){var P=S.invm(this.n).mul(D.mul(r.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(D)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),J^=1),new Hd({r:D,s:P,recoveryParam:J})}}}}}},"sign");xi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new yt.default(e,16)),n=this.keyFromPublic(n,i),r=new Hd(r,"hex");var a=r.r,c=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),m=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),x;return this.curve._maxwellTrick?(x=this.g.jmulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.eqXToP(a)):(x=this.g.mulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.getX().umod(this.n).cmp(a)===0)},"verify");xi.prototype.recoverPubKey=function(t,e,r,n){O5((3&r)===r,"The recovery param is more than two bits"),e=new Hd(e,n);var i=this.n,a=new yt.default(t),c=e.r,u=e.s,m=r&1,v=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?c=this.curve.pointFromX(c.add(this.curve.n),m):c=this.curve.pointFromX(c,m);var x=e.r.invm(i),S=i.sub(a).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(S,c,O)};xi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Hd(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var OL=vc(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=Hn,r.rand=function(){throw new Error("unsupported")},r.curve=Bd,r.curves=Ud,r.ec=DL,r.eddsa=null}),R5=OL.ec;var N5="signing-key/5.7.0";var Cb=new Et(N5),Tb=null;function go(){return Tb||(Tb=new R5("secp256k1")),Tb}o(go,"getCurve");var zd=class{constructor(e){gc(this,"curve","secp256k1"),gc(this,"privateKey",Yr(e)),Nd(this.privateKey)!==32&&Cb.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=go().keyFromPrivate(or(this.privateKey));gc(this,"publicKey","0x"+r.getPublic(!1,"hex")),gc(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),gc(this,"_isSigningKey",!0)}_addPoint(e){let r=go().keyFromPublic(or(this.publicKey)),n=go().keyFromPublic(or(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let r=go().keyFromPrivate(or(this.privateKey)),n=or(e);n.length!==32&&Cb.throwArgumentError("bad digest length","digest",e);let i=r.sign(n,{canonical:!0});return Ld({recoveryParam:i.recoveryParam,r:Ks("0x"+i.r.toString(16),32),s:Ks("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=go().keyFromPrivate(or(this.privateKey)),n=go().keyFromPublic(or(kb(e)));return Ks("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(zd,"SigningKey");function P5(t,e){let r=Ld(e),n={r:or(r.r),s:or(r.s)};return"0x"+go().recoverPubKey(or(t),n,r.recoveryParam).encode("hex",!1)}o(P5,"recoverPublicKey");function kb(t,e){let r=or(t);if(r.length===32){let n=new zd(r);return e?"0x"+go().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?Yr(r):"0x"+go().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+go().keyFromPublic(r).getPublic(!0,"hex"):Yr(r)}return Cb.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(kb,"computePublicKey");var L5="transactions/5.7.0";var cW=new Et(L5),B5;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(B5||(B5={}));function U5(t){let e=kb(t);return E5(Pd(bc(Pd(e,1)),12))}o(U5,"computeAddress");function $5(t,e){return U5(P5(or(t),e))}o($5,"recoverAddress");var F5="wallet/5.7.0";var vW=new Et(F5);function Ib(t,e){return $5(xb(t),e)}o(Ib,"verifyMessage");var z5=Lt(Au(),1);lu();pu();var RL=`
|
|
651
|
+
`+String(n)));Ug(e);for(var i=0;i<e.callbacks.length;i++){var a=n[i];a instanceof Error?e.callbacks[i].reject(a):e.callbacks[i].resolve(a)}}).catch(function(n){Bg(t,e,n)})}o(X$,"dispatchBatch");function Bg(t,e,r){Ug(e);for(var n=0;n<e.keys.length;n++)t.clear(e.keys[n]),e.callbacks[n].reject(r)}o(Bg,"failedDispatch");function Ug(t){if(t.cacheHits)for(var e=0;e<t.cacheHits.length;e++)t.cacheHits[e]()}o(Ug,"resolveCacheHits");function Z$(t){var e=!t||t.batch!==!1;if(!e)return 1;var r=t&&t.maxBatchSize;if(r===void 0)return 1/0;if(typeof r!="number"||r<1)throw new TypeError("maxBatchSize must be a positive number: "+r);return r}o(Z$,"getValidMaxBatchSize");function Q$(t){var e=t&&t.batchScheduleFn;if(e===void 0)return J$;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(Q$,"getValidBatchScheduleFn");function eF(t){var e=t&&t.cacheKeyFn;if(e===void 0)return function(r){return r};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(eF,"getValidCacheKeyFn");function tF(t){var e=!t||t.cache!==!1;if(!e)return null;var r=t&&t.cacheMap;if(r===void 0)return new Map;if(r!==null){var n=["get","set","delete","clear"],i=n.filter(function(a){return r&&typeof r[a]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return r}o(tF,"getValidCacheMap");function rF(t){return t&&t.name?t.name:null}o(rF,"getValidName");function vE(t){return typeof t=="object"&&t!==null&&typeof t.length=="number"&&(t.length===0||t.length>0&&Object.prototype.hasOwnProperty.call(t,t.length-1))}o(vE,"isArrayLike");yE.exports=W$});var PE=De((ate,NE)=>{"use strict";function xF(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),a=i.charCodeAt(0);if(e[a]!==255)throw new TypeError(i+" is ambiguous");e[a]=n}var c=t.length,u=t.charAt(0),m=Math.log(c)/Math.log(256),v=Math.log(256)/Math.log(c);function x(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 D=0,P=0,J=0,B=R.length;J!==B&&R[J]===0;)J++,D++;for(var W=(B-J)*v+1>>>0,Q=new Uint8Array(W);J!==B;){for(var Y=R[J],oe=0,j=W-1;(Y!==0||oe<P)&&j!==-1;j--,oe++)Y+=256*Q[j]>>>0,Q[j]=Y%c>>>0,Y=Y/c>>>0;if(Y!==0)throw new Error("Non-zero carry");P=oe,J++}for(var H=W-P;H!==W&&Q[H]===0;)H++;for(var G=u.repeat(D);H<W;++H)G+=t.charAt(Q[H]);return G}o(x,"encode");function S(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var D=0;if(R[D]!==" "){for(var P=0,J=0;R[D]===u;)P++,D++;for(var B=(R.length-D)*m+1>>>0,W=new Uint8Array(B);R[D];){var Q=e[R.charCodeAt(D)];if(Q===255)return;for(var Y=0,oe=B-1;(Q!==0||Y<J)&&oe!==-1;oe--,Y++)Q+=c*W[oe]>>>0,W[oe]=Q%256>>>0,Q=Q/256>>>0;if(Q!==0)throw new Error("Non-zero carry");J=Y,D++}if(R[D]!==" "){for(var j=B-J;j!==B&&W[j]===0;)j++;for(var H=new Uint8Array(P+(B-j)),G=P;j!==B;)H[G++]=W[j++];return H}}}o(S,"decodeUnsafe");function O(R){var D=S(R);if(D)return D;throw new Error("Non-base"+c+" character")}return o(O,"decode"),{encode:x,decodeUnsafe:S,decode:O}}o(xF,"base");NE.exports=xF});var q0=De((fte,LE)=>{"use strict";var wF=new TextDecoder,_F=o(t=>wF.decode(t),"decodeText"),EF=new TextEncoder,AF=o(t=>EF.encode(t),"encodeText");function SF(t,e){let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(SF,"concat");LE.exports={decodeText:_F,encodeText:AF,concat:SF}});var UE=De((cte,BE)=>{"use strict";var{encodeText:MF}=q0(),H0=class{constructor(e,r,n,i){this.name=e,this.code=r,this.codeBuf=MF(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let r of e)if(this.alphabet&&this.alphabet.indexOf(r)<0)throw new Error(`invalid character '${r}' in '${e}'`);return this.codec.decode(e)}};o(H0,"Base");BE.exports=H0});var FE=De((ute,$E)=>{"use strict";var TF=o((t,e,r)=>{let n={};for(let v=0;v<e.length;++v)n[e[v]]=v;let i=t.length;for(;t[i-1]==="=";)--i;let a=new Uint8Array(i*r/8|0),c=0,u=0,m=0;for(let v=0;v<i;++v){let x=n[t[v]];if(x===void 0)throw new SyntaxError("Invalid character "+t[v]);u=u<<r|x,c+=r,c>=8&&(c-=8,a[m++]=255&u>>c)}if(c>=r||255&u<<8-c)throw new SyntaxError("Unexpected end of data");return a},"decode"),CF=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let m=0;m<t.length;++m)for(u=u<<8|t[m],c+=8;c>r;)c-=r,a+=e[i&u>>c];if(c&&(a+=e[i&u<<r-c]),n)for(;a.length*r&7;)a+="=";return a},"encode"),kF=o(t=>e=>({encode(r){return CF(r,e,t)},decode(r){return TF(r,e,t)}}),"rfc4648");$E.exports={rfc4648:kF}});var KE=De((lte,zE)=>{"use strict";var _l=PE(),IF=UE(),{rfc4648:zr}=FE(),{decodeText:DF,encodeText:OF}=q0(),RF=o(()=>({encode:DF,decode:OF}),"identity"),qE=[["identity","\0",RF,""],["base2","0",zr(1),"01"],["base8","7",zr(3),"01234567"],["base10","9",_l,"0123456789"],["base16","f",zr(4),"0123456789abcdef"],["base16upper","F",zr(4),"0123456789ABCDEF"],["base32hex","v",zr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",zr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",zr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",zr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",zr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",zr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",zr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",zr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",zr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",_l,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",_l,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",_l,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",_l,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],HE=qE.reduce((t,e)=>(t[e[0]]=new IF(e[0],e[1],e[2],e[3]),t),{}),NF=qE.reduce((t,e)=>(t[e[1]]=HE[e[0]],t),{});zE.exports={names:HE,codes:NF}});var VE=De((us,GE)=>{"use strict";var Uc=KE(),{encodeText:PF,decodeText:z0,concat:jE}=q0();function LF(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=cf(t);return FF(r,e),jE([n,e],n.length+e.length)}o(LF,"multibase");function BF(t,e){let r=cf(t),n=PF(r.encode(e));return jE([r.codeBuf,n],r.codeBuf.length+n.length)}o(BF,"encode");function UF(t){t instanceof Uint8Array&&(t=z0(t));let e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),cf(t[0]).decode(t.substring(1))}o(UF,"decode");function $F(t){if(t instanceof Uint8Array&&(t=z0(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return cf(t[0]).name}catch{return!1}}o($F,"isEncoded");function FF(t,e){cf(t).decode(z0(e))}o(FF,"validEncode");function cf(t){if(Object.prototype.hasOwnProperty.call(Uc.names,t))return Uc.names[t];if(Object.prototype.hasOwnProperty.call(Uc.codes,t))return Uc.codes[t];throw new Error(`Unsupported encoding: ${t}`)}o(cf,"encoding");function qF(t){return t instanceof Uint8Array&&(t=z0(t)),cf(t[0])}o(qF,"encodingFromData");us=GE.exports=LF;us.encode=BF;us.decode=UF;us.isEncoded=$F;us.encoding=cf;us.encodingFromData=qF;var HF=Object.freeze(Uc.names),zF=Object.freeze(Uc.codes);us.names=HF;us.codes=zF});var XE=De((hte,YE)=>{YE.exports=JE;var WE=128,KF=127,jF=~KF,GF=Math.pow(2,31);function JE(t,e,r){e=e||[],r=r||0;for(var n=r;t>=GF;)e[r++]=t&255|WE,t/=128;for(;t&jF;)e[r++]=t&255|WE,t>>>=7;return e[r]=t|0,JE.bytes=r-n+1,e}o(JE,"encode")});var e9=De((dte,QE)=>{QE.exports=Wg;var VF=128,ZE=127;function Wg(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Wg.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&ZE)<<i:(c&ZE)*Math.pow(2,i),i+=7}while(c>=VF);return Wg.bytes=a-n,r}o(Wg,"read")});var r9=De((pte,t9)=>{var WF=Math.pow(2,7),JF=Math.pow(2,14),YF=Math.pow(2,21),XF=Math.pow(2,28),ZF=Math.pow(2,35),QF=Math.pow(2,42),eq=Math.pow(2,49),tq=Math.pow(2,56),rq=Math.pow(2,63);t9.exports=function(t){return t<WF?1:t<JF?2:t<YF?3:t<XF?4:t<ZF?5:t<QF?6:t<eq?7:t<tq?8:t<rq?9:10}});var i9=De((mte,n9)=>{n9.exports={encode:XE(),decode:e9(),encodingLength:r9()}});var s9=De((bte,o9)=>{"use strict";var nq=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});o9.exports={names:nq}});var d9=De((gte,h9)=>{"use strict";var a9=VE(),$c=i9(),{names:El}=s9(),{toString:K0}=(qf(),vh(n3)),{fromString:iq}=(mu(),vh(r3)),{concat:oq}=(dm(),vh(Ty)),Fc={};for(let t in El){let e=t;Fc[El[e]]=e}Object.freeze(Fc);function sq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return K0(t,"base16")}o(sq,"toHexString");function aq(t){return iq(t,"base16")}o(aq,"fromHexString");function fq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return K0(a9.encode("base58btc",t)).slice(1)}o(fq,"toB58String");function cq(t){let e=t instanceof Uint8Array?K0(t):t;return a9.decode("z"+e)}o(cq,"fromB58String");function f9(t){if(!(t instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=$c.decode(t);if(!u9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);t=t.slice($c.decode.bytes);let r=$c.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice($c.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${K0(t,"base16")}`);return{code:e,name:Fc[e],length:r,digest:t}}o(f9,"decode");function uq(t,e,r){if(!t||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=c9(e);if(!(t instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(r==null&&(r=t.length),r&&t.length!==r)throw new Error("digest length should be equal to specified length.");let i=$c.encode(n),a=$c.encode(r);return oq([i,a,t],i.length+a.length+t.length)}o(uq,"encode");function c9(t){let e=t;if(typeof t=="string"){if(El[t]===void 0)throw new Error(`Unrecognized hash function named: ${t}`);e=El[t]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Fc[e]===void 0&&!Jg(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(c9,"coerceCode");function Jg(t){return t>0&&t<16}o(Jg,"isAppCode");function u9(t){return!!(Jg(t)||Fc[t])}o(u9,"isValidCode");function l9(t){f9(t)}o(l9,"validate");function lq(t){return l9(t),t.subarray(0,2)}o(lq,"prefix");h9.exports={names:El,codes:Fc,toHexString:sq,fromHexString:aq,toB58String:fq,fromB58String:cq,decode:f9,encode:uq,coerceCode:c9,isAppCode:Jg,validate:l9,prefix:lq,isValidCode:u9}});var ez={};Jt(ez,{CeramicURIValidator:()=>n2,default:()=>QH,getCeramicPlugin:()=>rp,streamIdToCeramicURI:()=>tp});module.exports=vh(ez);var $9=Lt(Ay());function jk(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}o(jk,"_catch");function Gk(){let t=new Map;return function(e,r){try{let i=function(c){if(n)return c;let u=t.get(e.didUrl);return u!==void 0?u:Promise.resolve(r()).then(function(m){var v;return((v=m.didResolutionMetadata)==null?void 0:v.error)!=="notFound"&&t.set(e.didUrl,m),m})};o(i,"_temp2");let n,a=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(r()).then(function(c){return n=1,c})}();return Promise.resolve(a&&a.then?a.then(i):i(a))}catch(n){return Promise.reject(n)}}}o(Gk,"inMemoryCache");function Vk(t,e){return e()}o(Vk,"noCache");var Wk="(?:%[0-9a-fA-F]{2})",Sy=`(?:[a-zA-Z0-9._-]|${Wk})`,Jk="([a-z0-9]+)",Yk=`((?:${Sy}*:)*(${Sy}+))`,My="[a-zA-Z0-9_.:%-]",Xk=`;${My}+=${My}*`,Zk=`((${Xk})*)`,Qk="(/[^#?]*)?",eI="([?][^#]*)?",tI="(#.*)?",rI=new RegExp(`^did:${Jk}:${Yk}${Zk}${Qk}${eI}${tI}$`);function nI(t){if(t===""||!t)return null;let e=t.match(rI);if(e){let r={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:t};if(e[4]){let n=e[4].slice(1).split(";");r.params={};for(let i of n){let a=i.split("=");r.params[a[0]]=a[1]}}return e[6]&&(r.path=e[6]),e[7]&&(r.query=e[7].slice(1)),e[8]&&(r.fragment=e[8].slice(1)),r}return null}o(nI,"parse");var yh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function iI(t){return function(e,r,n){try{return Promise.resolve(jk(function(){return Promise.resolve(t(e,r,n)).then(function(i){return{...yh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...yh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(iI,"wrapLegacyResolver");var su=class{constructor(e={},r={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=r.cache===!0?Gk():r.cache||Vk,r.legacyResolvers&&Object.keys(r.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=iI(r.legacyResolvers[n]))})}resolve(e,r={}){try{let n=this,i=nI(e);if(i===null)return Promise.resolve({...yh,didResolutionMetadata:{error:"invalidDid"}});let a=n.registry[i.method];return a?Promise.resolve(n.cache(i,()=>a(i.did,i,n,r))):Promise.resolve({...yh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(su,"Resolver");dm();mu();qf();xh();au();Rm();var N1=Lt(l3()),Px=Lt(Hm()),P1=Lt(U6()),dd=Lt(Su()),Lx=Lt(cx()),Du=Lt(dx()),L1=Lt(Tx()),B1=Lt(Oa());function bi(t){return kt(t,"base64url")}o(bi,"bytesToBase64url");function xn(t){let e=t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Ot(e,"base64url")}o(xn,"base64ToBytes");function U1(t){return Ot(t,"base58btc")}o(U1,"base58ToBytes");function D1(t){let e=t.startsWith("0x")?t.substring(2):t;return Ot(e.toLowerCase(),"base16")}o(D1,"hexToBytes");function O1(t){return bi(Ot(t))}o(O1,"encodeBase64url");function Bx(t){return kt(xn(t))}o(Bx,"decodeBase64url");function La(t){return kt(t,"base16")}o(La,"bytesToHex");function Ux(t){return Ot(t)}o(Ux,"stringToBytes");function kN({r:t,s:e,recoveryParam:r},n){let i=new Uint8Array(n?65:64);if(i.set(Ot(t,"base16"),0),i.set(Ot(e,"base16"),32),n){if(typeof r>"u")throw new Error("Signer did not return a recoveryParam");i[64]=r}return bi(i)}o(kN,"toJose");function IN(t){let e=xn(t);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let r=La(e.slice(0,32)),n=La(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r,s:n,recoveryParam:i}}o(IN,"fromJose");function $x(t,e){return Oi([xn(t),xn(e)])}o($x,"toSealed");var DN=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,ON=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,RN=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function NN(t){if(typeof t=="string"){if(DN.test(t))return D1(t);if(ON.test(t))return U1(t);if(RN.test(t))return xn(t);throw TypeError("bad_key: Invalid private key format")}else{if(t instanceof Uint8Array)return t;throw TypeError("bad_key: Invalid private key format")}}o(NN,"parseKey");function Fx(t){let e=typeof t=="string"?Ot(t):t;return(0,N1.hash)(e)}o(Fx,"sha256");function PN(t){return new Uint8Array(Px.keccak_256.arrayBuffer(t))}o(PN,"keccak");function LN(t){let e=Ot(t.slice(2),"base16");return`0x${kt(PN(e).slice(-20),"base16")}`}o(LN,"toEthereumAddress");function R1(t,e=new Uint8Array(4)){let r=Ot(t.toString(),"base10");return e.set(r,4-r.length),e}o(R1,"writeUint32BE");var I1=o(t=>Oi([R1(t.length),t]),"lengthAndInput");function qx(t,e,r,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let a=Oi([I1(Ot(r)),I1(typeof n>"u"?new Uint8Array(0):n),I1(typeof i>"u"?new Uint8Array(0):i),R1(e)]);return(0,N1.hash)(Oi([R1(1),t,a]))}o(qx,"concatKDF");var fj=new P1.ec("secp256k1");function Hx(t){let e=NN(t);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(r){try{let n=typeof r=="string"?Ux(r):r,i=(0,dd.sign)(e,n);return Promise.resolve(bi(i))}catch(n){return Promise.reject(n)}}}o(Hx,"EdDSASigner");function zx(t){return typeof t=="object"&&"r"in t&&"s"in t}o(zx,"instanceOfEcdsaSignature");function Cx(t){return o(function(r,n){try{return Promise.resolve(n(r)).then(function(i){if(zx(i))return kN(i,t);if(t&&typeof IN(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(Cx,"ES256KSignerAlg");function kx(){return o(function(e,r){try{return Promise.resolve(r(e)).then(function(n){if(zx(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(kx,"Ed25519SignerAlg");var BN={ES256K:Cx(),"ES256K-R":Cx(!0),Ed25519:kx(),EdDSA:kx()};function UN(t){let e=BN[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(UN,"SignerAlg");var $1=new P1.ec("secp256k1");function hd(t,e=!1){let r=xn(t);if(r.length!==(e?65:64))throw new Error("wrong signature length");let n=La(r.slice(0,32)),i=La(r.slice(32,64)),a={r:n,s:i};return e&&(a.recoveryParam=r[64]),a}o(hd,"toSignatureObject");function F1(t){if(t.publicKeyBase58)return U1(t.publicKeyBase58);if(t.publicKeyBase64)return xn(t.publicKeyBase64);if(t.publicKeyHex)return D1(t.publicKeyHex);if(t.publicKeyJwk&&t.publicKeyJwk.crv==="secp256k1"&&t.publicKeyJwk.x&&t.publicKeyJwk.y)return D1($1.keyFromPublic({x:La(xn(t.publicKeyJwk.x)),y:La(xn(t.publicKeyJwk.y))}).getPublic("hex"));if(t.publicKeyMultibase){let{base16:e,base58btc:r,base64:n,base64url:i}=pu;return e.decoder.or(r.decoder.or(n.decoder.or(i.decoder))).decode(t.publicKeyMultibase)}return new Uint8Array}o(F1,"extractPublicKeyBytes");function $N(t,e,r){let n=Fx(t),i=hd(e),a=r.filter(({ethereumAddress:m,blockchainAccountId:v})=>typeof m>"u"&&typeof v>"u"),c=r.filter(({ethereumAddress:m,blockchainAccountId:v})=>typeof m<"u"||typeof v!==void 0),u=a.find(m=>{try{let v=F1(m);return $1.keyFromPublic(v).verify(n,i)}catch{return!1}});if(!u&&c.length>0&&(u=Kx(t,e,c)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o($N,"verifyES256K");function Kx(t,e,r){let n;if(e.length>86)n=[hd(e,!0)];else{let c=hd(e,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let i=o(c=>{let u=Fx(t),m=$1.recoverPubKey(u,c,c.recoveryParam),v=m.encode("hex"),x=m.encode("hex",!0),S=LN(v);return r.find(R=>{var D,P,J;let B=La(F1(R));return B===v||B===x||((D=R.ethereumAddress)==null?void 0:D.toLowerCase())===S||((P=R.blockchainAccountId)==null||(J=P.split("@eip155"))==null?void 0:J[0].toLowerCase())===S})},"checkSignatureAgainstSigner"),a=n.map(i).filter(c=>typeof c<"u");if(a.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return a[0]}o(Kx,"verifyRecoverableES256K");function Ix(t,e,r){let n=Ux(t),i=xn(e),a=r.find(c=>(0,dd.verify)(F1(c),n,i));if(!a)throw new Error("invalid_signature: Signature invalid for JWT");return a}o(Ix,"verifyEd25519");var FN={ES256K:$N,"ES256K-R":Kx,Ed25519:Ix,EdDSA:Ix};function jx(t){let e=FN[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(jx,"VerifierAlgorithm");jx.toSignatureObject=hd;var Gx=o(function(t,e,r={},n={}){try{r.alg||(r.alg=qN);let i=typeof t=="string"?t:Dx(t,n.canonicalize),a=[Dx(r,n.canonicalize),i].join("."),c=UN(r.alg);return Promise.resolve(c(a,e)).then(function(u){return[a,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var qN="ES256K";function Dx(t,e=!1){return O1(e?(0,Lx.default)(t):JSON.stringify(t))}o(Dx,"encodeSection");function HN(t){let e=t.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Bx(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(HN,"decodeJWS");function zN({header:t,data:e,signature:r},n){return Array.isArray(n)||(n=[n]),jx(t.alg)(e,r,n)}o(zN,"verifyJWSDecoded");function Vx(t,e){let r=HN(t);return zN(r,e)}o(Vx,"verifyJWS");function KN(t,e,r){for(var n;;){var i=t();if(Bs(i)&&(i=i.v),!i)return a;if(i.then){n=0;break}var a=r();if(a&&a.then)if(Bs(a))a=a.s;else{n=1;break}if(e){var c=e();if(c&&c.then&&!Bs(c)){n=2;break}}}var u=new Ba,m=_r.bind(null,u,2);return(n===0?i.then(x):n===1?a.then(v):c.then(S)).then(void 0,m),u;function v(O){a=O;do{if(e&&(c=e(),c&&c.then&&!Bs(c))){c.then(S).then(void 0,m);return}if(i=t(),!i||Bs(i)&&!i.v){_r(u,1,a);return}if(i.then){i.then(x).then(void 0,m);return}a=r(),Bs(a)&&(a=a.v)}while(!a||!a.then);a.then(v).then(void 0,m)}o(v,"_resumeAfterBody");function x(O){O?(a=r(),a&&a.then?a.then(v).then(void 0,m):v(a)):_r(u,1,a)}o(x,"_resumeAfterTest");function S(){(i=t())?i.then?i.then(x).then(void 0,m):x(i):_r(u,1,a)}o(S,"_resumeAfterUpdate")}o(KN,"_for");var Wx=o(function(t,e){try{let n=function(v){if(u===null)throw new Error("failure: Failed to decrypt");return u};o(n,"_temp5");let r;VN(t);let i=JSON.parse(Bx(t.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let a=$x(t.ciphertext,t.tag),c=new Uint8Array(Buffer.from(t.aad?`${t.protected}.${t.aad}`:t.protected)),u=null,m=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(a,xn(t.iv),c)).then(function(v){u=v}):function(){if(!t.recipients||t.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let v=0;return KN(function(){return!u&&v<t.recipients.length},function(){return v++},function(){let x=t.recipients[v];Object.assign(x.header,i);let S=function(){if(x.header.alg===e.alg)return Promise.resolve(e.decrypt(a,xn(t.iv),c,x)).then(function(O){u=O})}();if(S&&S.then)return S.then(function(){})})}}()}();return Promise.resolve(m&&m.then?m.then(n):n(m))}catch(r){return Promise.reject(r)}},"decryptJWE"),Ox=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function _r(t,e,r){if(!t.s){if(r instanceof Ba)if(r.s)e&1&&(e=r.s),r=r.v;else{r.o=_r.bind(null,t,e);return}if(r&&r.then){r.then(_r.bind(null,t,e),_r.bind(null,t,2));return}t.s=e,t.v=r;let n=t.o;n&&n(t)}}o(_r,"_settle");var Ba=function(){function t(){}return o(t,"_Pact"),t.prototype.then=function(e,r){let n=new t,i=this.s;if(i){let a=i&1?e:r;if(a){try{_r(n,1,a(this.v))}catch(c){_r(n,2,c)}return n}else return this}return this.o=function(a){try{let c=a.v;a.s&1?_r(n,1,e?e(c):c):r?_r(n,1,r(c)):_r(n,2,c)}catch(c){_r(n,2,c)}},n},t}();function Bs(t){return t instanceof Ba&&t.s&1}o(Bs,"_isSettledPact");function jN(t,e,r){var n=-1,i,a;function c(u){try{for(;++n<t.length&&(!r||!r());)if(u=e(n),u&&u.then)if(Bs(u))u=u.v;else{u.then(c,a||(a=_r.bind(null,i=new Ba,2)));return}i?_r(i,1,u):i=u}catch(m){_r(i||(i=new Ba),2,m)}}return o(c,"_cycle"),c(),i}o(jN,"_forTo");function GN(t,e,r){if(typeof t[Ox]=="function"){let x=function(S){try{for(;!(i=n.next()).done&&(!r||!r());)if(S=e(i.value),S&&S.then)if(Bs(S))S=S.v;else{S.then(x,c||(c=_r.bind(null,a=new Ba,2)));return}a?_r(a,1,S):a=S}catch(O){_r(a||(a=new Ba),2,O)}};o(x,"_cycle");var n=t[Ox](),i,a,c;if(x(),n.return){var u=o(function(S){try{i.done||n.return()}catch{}return S},"_fixup");if(a&&a.then)return a.then(u,function(S){throw u(S)});u()}return a}if(!("length"in t))throw new TypeError("Object is not iterable");for(var m=[],v=0;v<t.length;v++)m.push(t[v]);return jN(m,function(x){return e(m[x])},r)}o(GN,"_forOf");function VN(t){if(!(t.protected&&t.iv&&t.ciphertext&&t.tag))throw new Error("bad_jwe: missing properties");t.recipients&&t.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(VN,"validateJWE");function Rx({ciphertext:t,tag:e,iv:r,protectedHeader:n,recipient:i},a){let c={protected:n,iv:bi(r),ciphertext:bi(t),tag:bi(e)};return a&&(c.aad=bi(a)),i&&(c.recipients=[i]),c}o(Rx,"encodeJWE");var Jx=o(function(t,e,r={},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(t,r,n)).then(function(i){return Rx(i,n)})}else{let i=e[0].enc;if(!e.reduce((m,v)=>m&&v.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let a,c,u=GN(e,function(m){let v=function(){return a?Promise.resolve(m.encryptCek==null?void 0:m.encryptCek(a)).then(function(x){if(x){var S,O;(S=c)==null||(O=S.recipients)==null||O.push(x)}}):Promise.resolve(m.encrypt(t,r,n)).then(function(x){a=x.cek,c=Rx(x,n)})}();if(v&&v.then)return v.then(function(){})});return Promise.resolve(u&&u.then?u.then(function(){return c}):c)}}catch(i){return Promise.reject(i)}},"createJWE");var Yx=o(function(t,e){try{let r=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:a,didDocument:c}){var u;if(a!=null&&a.error||c==null)throw new Error(`resolver_error: Could not resolve ${i}: ${a.error}, ${a.message}`);if(!c.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let v=((u=c.keyAgreement)==null?void 0:u.map(x=>typeof x=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(S=>S.id===x):x).filter(x=>typeof x<"u")).filter(x=>x.type==="X25519KeyAgreementKey2019"&&Boolean(x.publicKeyBase58));if(!v.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return v.map(x=>JN(U1(x.publicKeyBase58),x.id))})}catch(a){return Promise.reject(a)}},"encryptersForDID"),n=t.map(i=>r(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(r){return Promise.reject(r)}},"resolveX25519Encrypters");function Xx(t){let e=new L1.XChaCha20Poly1305(t);return(r,n)=>{let i=(0,B1.randomBytes)(e.nonceLength),a=e.seal(i,r,n);return{ciphertext:a.subarray(0,a.length-e.tagLength),tag:a.subarray(a.length-e.tagLength),iv:i}}}o(Xx,"xc20pEncrypter");function WN(t){let e=o(function(a,c={},u){try{let m=O1(JSON.stringify(Object.assign({alg:i},c,{enc:n}))),v=new Uint8Array(Buffer.from(u?`${m}.${bi(u)}`:m));return Promise.resolve({...r(a,v),protectedHeader:m})}catch(m){return Promise.reject(m)}},"encrypt"),r=Xx(t),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(WN,"xc20pDirEncrypter");function Nx(t){let e=o(function(n,i,a){try{return Promise.resolve(r.open(i,n,a))}catch(c){return Promise.reject(c)}},"decrypt"),r=new L1.XChaCha20Poly1305(t);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Nx,"xc20pDirDecrypter");function JN(t,e){let r=o(function(u,m={},v){try{Object.assign(m,{alg:void 0});let x=(0,B1.randomBytes)(32);return Promise.resolve(WN(x).encrypt(u,m,v)).then(function(S){return Promise.resolve(n(x)).then(function(O){return{...S,recipient:O,cek:x}})})}catch(x){return Promise.reject(x)}},"encrypt"),n=o(function(u){try{let m=(0,Du.generateKeyPair)(),v=(0,Du.sharedKey)(m.secretKey,t),x=qx(v,a,i),S=Xx(x)(u),O={encrypted_key:bi(S.ciphertext),header:{alg:i,iv:bi(S.iv),tag:bi(S.tag),epk:{kty:"OKP",crv:c,x:bi(m.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(m){return Promise.reject(m)}},"encryptCek"),i="ECDH-ES+XC20PKW",a=256,c="X25519";return{alg:i,enc:"XC20P",encrypt:r,encryptCek:n}}o(JN,"x25519Encrypter");function YN(t){if(!(t&&t.epk&&t.iv&&t.tag))throw new Error("bad_jwe: malformed header")}o(YN,"validateHeader");function Zx(t){let e=o(function(a,c,u,m){try{let S=function(){let P=qx(R,n,r),J=$x(m.encrypted_key,m.header.tag);return Promise.resolve(Nx(P).decrypt(J,xn(m.header.iv))).then(function(B){return B===null?null:Nx(B).decrypt(a,c,u)})};o(S,"_temp4");var v,x;if(YN((v=m)==null?void 0:v.header),m=m,((x=m.header.epk)==null?void 0:x.crv)!==i||typeof m.header.epk.x>"u")return Promise.resolve(null);let O=xn(m.header.epk.x),R,D=function(){if(t instanceof Uint8Array)R=(0,Du.sharedKey)(t,O);else return Promise.resolve(t(O)).then(function(P){R=P})}();return Promise.resolve(D&&D.then?D.then(S):S(D))}catch(S){return Promise.reject(S)}},"decrypt"),r="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:r,enc:"XC20P",decrypt:e}}o(Zx,"x25519Decrypter");Om();var pd=o(({enumerable:t=!0,configurable:e=!1}={})=>({enumerable:t,configurable:e,writable:!1}),"readonly"),q1=o(function*(t,e){if(t!=null&&!(t instanceof Uint8Array))for(let[r,n]of Object.entries(t)){let i=[...e,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[a,c]of n.entries()){let u=[...i,a],m=We.asCID(c);m?yield[u.join("/"),m]:typeof c=="object"&&(yield*q1(c,u))}else{let a=We.asCID(n);a?yield[i.join("/"),a]:yield*q1(n,i)}}},"links"),H1=o(function*(t,e){if(t!=null)for(let[r,n]of Object.entries(t)){let i=[...e,r];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!We.asCID(n))if(Array.isArray(n))for(let[a,c]of n.entries()){let u=[...i,a];yield u.join("/"),typeof c=="object"&&!We.asCID(c)&&(yield*H1(c,u))}else yield*H1(n,i)}},"tree"),XN=o((t,e)=>{let r=t;for(let[n,i]of e.entries()){if(r=r[i],r==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let a=We.asCID(r);if(a)return{value:a,remaining:e.slice(n+1).join("/")}}return{value:r}},"get"),Ou=class{constructor({cid:e,bytes:r,value:n}){if(!e||!r||typeof n>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:pd(),bytes:pd(),value:pd(),asBlock:pd()})}links(){return q1(this.value,[])}tree(){return H1(this.value,[])}get(e="/"){return XN(this.value,e.split("/").filter(Boolean))}};o(Ou,"Block");var Ua=o(async({value:t,codec:e,hasher:r})=>{if(typeof t>"u")throw new Error('Missing required argument "value"');if(!e||!r)throw new Error("Missing required argument: codec or hasher");let n=e.encode(t),i=await r.digest(n),a=We.create(1,e.code,i);return new Ou({value:t,bytes:n,cid:a})},"encode"),Qx=o(async({bytes:t,codec:e,hasher:r})=>{if(!t)throw new Error('Missing required argument "bytes"');if(!e||!r)throw new Error("Missing required argument: codec or hasher");let n=e.decode(t),i=await r.digest(t),a=We.create(1,e.code,i);return new Ou({value:n,bytes:t,cid:a})},"decode");Pi();hu();Dm();Mh();var Hi={};Jt(Hi,{code:()=>cc,decode:()=>Q1,encode:()=>qa,name:()=>RP});var ZN=["string","number","bigint","symbol"],QN=["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 ew(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(ZN.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(eP(t))return"Buffer";let r=tP(t);return r||"Object"}o(ew,"is");function eP(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}o(eP,"isBuffer");function tP(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(QN.includes(e))return e}o(tP,"getObjectType");var _e=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,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 $e=class{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o($e,"Token");var nc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",rP=new TextDecoder,nP=new TextEncoder;function md(t){return nc&&globalThis.Buffer.isBuffer(t)}o(md,"isBuffer");function K1(t){return t instanceof Uint8Array?md(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}o(K1,"asU8A");var iw=nc?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):rw(t,e,r):(t,e,r)=>r-e>64?rP.decode(t.subarray(e,r)):rw(t,e,r),ow=nc?t=>t.length>64?globalThis.Buffer.from(t):tw(t):t=>t.length>64?nP.encode(t):tw(t),ho=o(t=>Uint8Array.from(t),"fromArray"),ic=nc?(t,e,r)=>md(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),sw=nc?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),K1(globalThis.Buffer.concat(t,e))):(t,e)=>{let r=new Uint8Array(e),n=0;for(let i of t)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},aw=nc?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function fw(t,e){if(md(t)&&md(e))return t.compare(e);for(let r=0;r<t.length;r++)if(t[r]!==e[r])return t[r]<e[r]?-1:1;return 0}o(fw,"compare");function tw(t,e=1/0){let r,n=t.length,i=null,a=[];for(let c=0;c<n;++c){if(r=t.charCodeAt(c),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(c+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}o(tw,"utf8ToBytes");function rw(t,e,r){let n=[];for(;e<r;){let i=t[e],a=null,c=i>239?4:i>223?3:i>191?2:1;if(e+c<=r){let u,m,v,x;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[e+1],(u&192)===128&&(x=(i&31)<<6|u&63,x>127&&(a=x));break;case 3:u=t[e+1],m=t[e+2],(u&192)===128&&(m&192)===128&&(x=(i&15)<<12|(u&63)<<6|m&63,x>2047&&(x<55296||x>57343)&&(a=x));break;case 4:u=t[e+1],m=t[e+2],v=t[e+3],(u&192)===128&&(m&192)===128&&(v&192)===128&&(x=(i&15)<<18|(u&63)<<12|(m&63)<<6|v&63,x>65535&&x<1114112&&(a=x))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),e+=c}return iP(n)}o(rw,"utf8Slice");var nw=4096;function iP(t){let e=t.length;if(e<=nw)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=nw));return r}o(iP,"decodeCodePointsArray");var oP=256,oc=class{constructor(e=oP){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 r=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(e,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(r=aw(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=ic(n,0,this.cursor)}else r=sw(this.chunks,this.cursor);return e&&this.reset(),r}};o(oc,"Bl");var mt="CBOR decode error:",j1="CBOR encode error:",Ru=[];Ru[23]=1;Ru[24]=2;Ru[25]=3;Ru[26]=5;Ru[27]=9;function Zo(t,e,r){if(t.length-e<r)throw new Error(`${mt} not enough data for type`)}o(Zo,"assertEnoughData");var Cr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Bn(t,e,r){Zo(t,e,1);let n=t[e];if(r.strict===!0&&n<Cr[0])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Bn,"readUint8");function Un(t,e,r){Zo(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<Cr[1])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o(Un,"readUint16");function $n(t,e,r){Zo(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<Cr[2])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);return n}o($n,"readUint32");function Fn(t,e,r){Zo(t,e,8);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3],i=t[e+4]*16777216+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7],a=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&a<Cr[3])throw new Error(`${mt} integer encoded in more bytes than necessary (strict decode)`);if(a<=Number.MAX_SAFE_INTEGER)return Number(a);if(r.allowBigInt===!0)return a;throw new Error(`${mt} integers outside of the safe integer range are not supported`)}o(Fn,"readUint64");function cw(t,e,r,n){return new $e(_e.uint,Bn(t,e+1,n),2)}o(cw,"decodeUint8");function uw(t,e,r,n){return new $e(_e.uint,Un(t,e+1,n),3)}o(uw,"decodeUint16");function lw(t,e,r,n){return new $e(_e.uint,$n(t,e+1,n),5)}o(lw,"decodeUint32");function hw(t,e,r,n){return new $e(_e.uint,Fn(t,e+1,n),9)}o(hw,"decodeUint64");function gi(t,e){return Ur(t,0,e.value)}o(gi,"encodeUint");function Ur(t,e,r){if(r<Cr[0]){let n=Number(r);t.push([e|n])}else if(r<Cr[1]){let n=Number(r);t.push([e|24,n])}else if(r<Cr[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<Cr[3]){let n=Number(r);t.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Cr[4]){let i=[e|27,0,0,0,0,0,0,0],a=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=c&255,c=c>>8,i[3]=c&255,c=c>>8,i[2]=c&255,c=c>>8,i[1]=c&255,t.push(i)}else throw new Error(`${mt} encountered BigInt larger than allowable range`)}}o(Ur,"encodeUintValue");gi.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");Ur.encodedSize=o(function(e){return e<Cr[0]?1:e<Cr[1]?2:e<Cr[2]?3:e<Cr[3]?5:9},"encodedSize");gi.compareTokens=o(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function dw(t,e,r,n){return new $e(_e.negint,-1-Bn(t,e+1,n),2)}o(dw,"decodeNegint8");function pw(t,e,r,n){return new $e(_e.negint,-1-Un(t,e+1,n),3)}o(pw,"decodeNegint16");function mw(t,e,r,n){return new $e(_e.negint,-1-$n(t,e+1,n),5)}o(mw,"decodeNegint32");var G1=BigInt(-1),bw=BigInt(1);function gw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i!="bigint"){let a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new $e(_e.negint,a,9)}if(n.allowBigInt!==!0)throw new Error(`${mt} integers outside of the safe integer range are not supported`);return new $e(_e.negint,G1-BigInt(i),9)}o(gw,"decodeNegint64");function bd(t,e){let r=e.value,n=typeof r=="bigint"?r*G1-bw:r*-1-1;Ur(t,e.type.majorEncoded,n)}o(bd,"encodeNegint");bd.encodedSize=o(function(e){let r=e.value,n=typeof r=="bigint"?r*G1-bw:r*-1-1;return n<Cr[0]?1:n<Cr[1]?2:n<Cr[2]?3:n<Cr[3]?5:9},"encodedSize");bd.compareTokens=o(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Nu(t,e,r,n){Zo(t,e,r+n);let i=ic(t,e+r,e+r+n);return new $e(_e.bytes,i,r+n)}o(Nu,"toToken");function vw(t,e,r,n){return Nu(t,e,1,r)}o(vw,"decodeBytesCompact");function yw(t,e,r,n){return Nu(t,e,2,Bn(t,e+1,n))}o(yw,"decodeBytes8");function xw(t,e,r,n){return Nu(t,e,3,Un(t,e+1,n))}o(xw,"decodeBytes16");function ww(t,e,r,n){return Nu(t,e,5,$n(t,e+1,n))}o(ww,"decodeBytes32");function _w(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer bytes lengths not supported`);return Nu(t,e,9,i)}o(_w,"decodeBytes64");function gd(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===_e.string?ow(t.value):t.value),t.encodedBytes}o(gd,"tokenBytes");function sc(t,e){let r=gd(e);Ur(t,e.type.majorEncoded,r.length),t.push(r)}o(sc,"encodeBytes");sc.encodedSize=o(function(e){let r=gd(e);return Ur.encodedSize(r.length)+r.length},"encodedSize");sc.compareTokens=o(function(e,r){return aP(gd(e),gd(r))},"compareTokens");function aP(t,e){return t.length<e.length?-1:t.length>e.length?1:fw(t,e)}o(aP,"compareBytes");function Pu(t,e,r,n,i){let a=r+n;Zo(t,e,a);let c=new $e(_e.string,iw(t,e+r,e+a),a);return i.retainStringBytes===!0&&(c.byteValue=ic(t,e+r,e+a)),c}o(Pu,"toToken");function Ew(t,e,r,n){return Pu(t,e,1,r,n)}o(Ew,"decodeStringCompact");function Aw(t,e,r,n){return Pu(t,e,2,Bn(t,e+1,n),n)}o(Aw,"decodeString8");function Sw(t,e,r,n){return Pu(t,e,3,Un(t,e+1,n),n)}o(Sw,"decodeString16");function Mw(t,e,r,n){return Pu(t,e,5,$n(t,e+1,n),n)}o(Mw,"decodeString32");function Tw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer string lengths not supported`);return Pu(t,e,9,i,n)}o(Tw,"decodeString64");var Cw=sc;function ac(t,e,r,n){return new $e(_e.array,n,r)}o(ac,"toToken");function kw(t,e,r,n){return ac(t,e,1,r)}o(kw,"decodeArrayCompact");function Iw(t,e,r,n){return ac(t,e,2,Bn(t,e+1,n))}o(Iw,"decodeArray8");function Dw(t,e,r,n){return ac(t,e,3,Un(t,e+1,n))}o(Dw,"decodeArray16");function Ow(t,e,r,n){return ac(t,e,5,$n(t,e+1,n))}o(Ow,"decodeArray32");function Rw(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer array lengths not supported`);return ac(t,e,9,i)}o(Rw,"decodeArray64");function Nw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return ac(t,e,1,1/0)}o(Nw,"decodeArrayIndefinite");function vd(t,e){Ur(t,_e.array.majorEncoded,e.value)}o(vd,"encodeArray");vd.compareTokens=gi.compareTokens;vd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function fc(t,e,r,n){return new $e(_e.map,n,r)}o(fc,"toToken");function Pw(t,e,r,n){return fc(t,e,1,r)}o(Pw,"decodeMapCompact");function Lw(t,e,r,n){return fc(t,e,2,Bn(t,e+1,n))}o(Lw,"decodeMap8");function Bw(t,e,r,n){return fc(t,e,3,Un(t,e+1,n))}o(Bw,"decodeMap16");function Uw(t,e,r,n){return fc(t,e,5,$n(t,e+1,n))}o(Uw,"decodeMap32");function $w(t,e,r,n){let i=Fn(t,e+1,n);if(typeof i=="bigint")throw new Error(`${mt} 64-bit integer map lengths not supported`);return fc(t,e,9,i)}o($w,"decodeMap64");function Fw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return fc(t,e,1,1/0)}o(Fw,"decodeMapIndefinite");function yd(t,e){Ur(t,_e.map.majorEncoded,e.value)}o(yd,"encodeMap");yd.compareTokens=gi.compareTokens;yd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function qw(t,e,r,n){return new $e(_e.tag,r,1)}o(qw,"decodeTagCompact");function Hw(t,e,r,n){return new $e(_e.tag,Bn(t,e+1,n),2)}o(Hw,"decodeTag8");function zw(t,e,r,n){return new $e(_e.tag,Un(t,e+1,n),3)}o(zw,"decodeTag16");function Kw(t,e,r,n){return new $e(_e.tag,$n(t,e+1,n),5)}o(Kw,"decodeTag32");function jw(t,e,r,n){return new $e(_e.tag,Fn(t,e+1,n),9)}o(jw,"decodeTag64");function xd(t,e){Ur(t,_e.tag.majorEncoded,e.value)}o(xd,"encodeTag");xd.compareTokens=gi.compareTokens;xd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");var dP=20,pP=21,mP=22,bP=23;function Gw(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${mt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new $e(_e.null,null,1):new $e(_e.undefined,void 0,1)}o(Gw,"decodeUndefined");function Vw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return new $e(_e.break,void 0,1)}o(Vw,"decodeBreak");function V1(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${mt} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${mt} Infinity values are not supported`)}return new $e(_e.float,t,e)}o(V1,"createToken");function Ww(t,e,r,n){return V1(W1(t,e+1),3,n)}o(Ww,"decodeFloat16");function Jw(t,e,r,n){return V1(J1(t,e+1),5,n)}o(Jw,"decodeFloat32");function Yw(t,e,r,n){return V1(e4(t,e+1),9,n)}o(Yw,"decodeFloat64");function wd(t,e,r){let n=e.value;if(n===!1)t.push([_e.float.majorEncoded|dP]);else if(n===!0)t.push([_e.float.majorEncoded|pP]);else if(n===null)t.push([_e.float.majorEncoded|mP]);else if(n===void 0)t.push([_e.float.majorEncoded|bP]);else{let i,a=!1;(!r||r.float64!==!0)&&(Zw(n),i=W1(Fi,1),n===i||Number.isNaN(n)?(Fi[0]=249,t.push(Fi.slice(0,3)),a=!0):(Qw(n),i=J1(Fi,1),n===i&&(Fi[0]=250,t.push(Fi.slice(0,5)),a=!0))),a||(gP(n),i=e4(Fi,1),Fi[0]=251,t.push(Fi.slice(0,9)))}}o(wd,"encodeFloat");wd.encodedSize=o(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Zw(n);let i=W1(Fi,1);if(n===i||Number.isNaN(n))return 3;if(Qw(n),i=J1(Fi,1),n===i)return 5}return 9},"encodedSize");var Xw=new ArrayBuffer(9),vi=new DataView(Xw,1),Fi=new Uint8Array(Xw,0);function Zw(t){if(t===1/0)vi.setUint16(0,31744,!1);else if(t===-1/0)vi.setUint16(0,64512,!1);else if(Number.isNaN(t))vi.setUint16(0,32256,!1);else{vi.setFloat32(0,t);let e=vi.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)vi.setUint16(0,31744,!1);else if(r===0)vi.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?vi.setUint16(0,0):i<-14?vi.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):vi.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(Zw,"encodeFloat16");function W1(t,e){if(t.length-e<2)throw new Error(`${mt} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,a;return n===0?a=i*2**-24:n!==31?a=(i+1024)*2**(n-25):a=i===0?1/0:NaN,r&32768?-a:a}o(W1,"readFloat16");function Qw(t){vi.setFloat32(0,t,!1)}o(Qw,"encodeFloat32");function J1(t,e){if(t.length-e<4)throw new Error(`${mt} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}o(J1,"readFloat32");function gP(t){vi.setFloat64(0,t,!1)}o(gP,"encodeFloat64");function e4(t,e){if(t.length-e<8)throw new Error(`${mt} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}o(e4,"readFloat64");wd.compareTokens=gi.compareTokens;function $t(t,e,r){throw new Error(`${mt} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}o($t,"invalidMinor");function _d(t){return()=>{throw new Error(`${mt} ${t}`)}}o(_d,"errorer");var Pe=[];for(let t=0;t<=23;t++)Pe[t]=$t;Pe[24]=cw;Pe[25]=uw;Pe[26]=lw;Pe[27]=hw;Pe[28]=$t;Pe[29]=$t;Pe[30]=$t;Pe[31]=$t;for(let t=32;t<=55;t++)Pe[t]=$t;Pe[56]=dw;Pe[57]=pw;Pe[58]=mw;Pe[59]=gw;Pe[60]=$t;Pe[61]=$t;Pe[62]=$t;Pe[63]=$t;for(let t=64;t<=87;t++)Pe[t]=vw;Pe[88]=yw;Pe[89]=xw;Pe[90]=ww;Pe[91]=_w;Pe[92]=$t;Pe[93]=$t;Pe[94]=$t;Pe[95]=_d("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Pe[t]=Ew;Pe[120]=Aw;Pe[121]=Sw;Pe[122]=Mw;Pe[123]=Tw;Pe[124]=$t;Pe[125]=$t;Pe[126]=$t;Pe[127]=_d("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Pe[t]=kw;Pe[152]=Iw;Pe[153]=Dw;Pe[154]=Ow;Pe[155]=Rw;Pe[156]=$t;Pe[157]=$t;Pe[158]=$t;Pe[159]=Nw;for(let t=160;t<=183;t++)Pe[t]=Pw;Pe[184]=Lw;Pe[185]=Bw;Pe[186]=Uw;Pe[187]=$w;Pe[188]=$t;Pe[189]=$t;Pe[190]=$t;Pe[191]=Fw;for(let t=192;t<=215;t++)Pe[t]=qw;Pe[216]=Hw;Pe[217]=zw;Pe[218]=Kw;Pe[219]=jw;Pe[220]=$t;Pe[221]=$t;Pe[222]=$t;Pe[223]=$t;for(let t=224;t<=243;t++)Pe[t]=_d("simple values are not supported");Pe[244]=$t;Pe[245]=$t;Pe[246]=$t;Pe[247]=Gw;Pe[248]=_d("simple values are not supported");Pe[249]=Ww;Pe[250]=Jw;Pe[251]=Yw;Pe[252]=$t;Pe[253]=$t;Pe[254]=$t;Pe[255]=Vw;var qi=[];for(let t=0;t<24;t++)qi[t]=new $e(_e.uint,t,1);for(let t=-1;t>=-24;t--)qi[31-t]=new $e(_e.negint,t,1);qi[64]=new $e(_e.bytes,new Uint8Array(0),1);qi[96]=new $e(_e.string,"",1);qi[128]=new $e(_e.array,0,1);qi[160]=new $e(_e.map,0,1);qi[244]=new $e(_e.false,!1,1);qi[245]=new $e(_e.true,!0,1);qi[246]=new $e(_e.null,null,1);function t4(t){switch(t.type){case _e.false:return ho([244]);case _e.true:return ho([245]);case _e.null:return ho([246]);case _e.bytes:return t.value.length?void 0:ho([64]);case _e.string:return t.value===""?ho([96]):void 0;case _e.array:return t.value===0?ho([128]):void 0;case _e.map:return t.value===0?ho([160]):void 0;case _e.uint:return t.value<24?ho([Number(t.value)]):void 0;case _e.negint:if(t.value>=-24)return ho([31-Number(t.value)])}}o(t4,"quickEncodeToken");var yP={float64:!1,mapSorter:_P,quickEncodeToken:t4};function xP(){let t=[];return t[_e.uint.major]=gi,t[_e.negint.major]=bd,t[_e.bytes.major]=sc,t[_e.string.major]=Cw,t[_e.array.major]=vd,t[_e.map.major]=yd,t[_e.tag.major]=xd,t[_e.float.major]=wd,t}o(xP,"makeCborEncoders");var r4=xP(),Y1=new oc,Fa=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${j1} object contains circular references`);return new Fa(r,e)}};o(Fa,"Ref");var Us={null:new $e(_e.null,null),undefined:new $e(_e.undefined,void 0),true:new $e(_e.true,!0),false:new $e(_e.false,!1),emptyArray:new $e(_e.array,0),emptyMap:new $e(_e.map,0)},$s={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new $e(_e.float,t):t>=0?new $e(_e.uint,t):new $e(_e.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new $e(_e.uint,t):new $e(_e.negint,t)},Uint8Array(t,e,r,n){return new $e(_e.bytes,t)},string(t,e,r,n){return new $e(_e.string,t)},boolean(t,e,r,n){return t?Us.true:Us.false},null(t,e,r,n){return Us.null},undefined(t,e,r,n){return Us.undefined},ArrayBuffer(t,e,r,n){return new $e(_e.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new $e(_e.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Us.emptyArray,new $e(_e.break)]:Us.emptyArray;n=Fa.createCheck(n,t);let i=[],a=0;for(let c of t)i[a++]=Ed(c,r,n);return r.addBreakTokens?[new $e(_e.array,t.length),i,new $e(_e.break)]:[new $e(_e.array,t.length),i]},Object(t,e,r,n){let i=e!=="Object",a=i?t.keys():Object.keys(t),c=i?t.size:a.length;if(!c)return r.addBreakTokens===!0?[Us.emptyMap,new $e(_e.break)]:Us.emptyMap;n=Fa.createCheck(n,t);let u=[],m=0;for(let v of a)u[m++]=[Ed(v,r,n),Ed(i?t.get(v):t[v],r,n)];return wP(u,r),r.addBreakTokens?[new $e(_e.map,c),u,new $e(_e.break)]:[new $e(_e.map,c),u]}};$s.Map=$s.Object;$s.Buffer=$s.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))$s[`${t}Array`]=$s.DataView;function Ed(t,e={},r){let n=ew(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||$s[n];if(typeof i=="function"){let c=i(t,n,e,r);if(c!=null)return c}let a=$s[n];if(!a)throw new Error(`${j1} unsupported type: ${n}`);return a(t,n,e,r)}o(Ed,"objectToTokens");function wP(t,e){e.mapSorter&&t.sort(e.mapSorter)}o(wP,"sortMapEntries");function _P(t,e){let r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);let i=r.type.major,a=r4[i].compareTokens(r,n);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}o(_P,"mapSorter");function n4(t,e,r,n){if(Array.isArray(e))for(let i of e)n4(t,i,r,n);else r[e.type.major](t,e,n)}o(n4,"tokensToEncoded");function EP(t,e,r){let n=Ed(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let a=e[n.type.major];if(a.encodedSize){let c=a.encodedSize(n,r),u=new oc(c);if(a(u,n,r),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return K1(u.chunks[0])}}return Y1.reset(),n4(Y1,n,e,r),Y1.toBytes(!0)}o(EP,"encodeCustom");function X1(t,e){return e=Object.assign({},yP,e),EP(t,r4,e)}o(X1,"encode");var AP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ad=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=qi[e];if(r===void 0){let n=Pe[e];if(!n)throw new Error(`${mt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;r=n(this.data,this.pos,i,this.options)}return this.pos+=r.encodedLength,r}};o(Ad,"Tokeniser");var Lu=Symbol.for("DONE"),Sd=Symbol.for("BREAK");function SP(t,e,r){let n=[];for(let i=0;i<t.value;i++){let a=Bu(e,r);if(a===Sd){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed array`)}if(a===Lu)throw new Error(`${mt} found array but not enough entries (got ${i}, expected ${t.value})`);n[i]=a}return n}o(SP,"tokenToArray");function MP(t,e,r){let n=r.useMaps===!0,i=n?void 0:{},a=n?new Map:void 0;for(let c=0;c<t.value;c++){let u=Bu(e,r);if(u===Sd){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed map`)}if(u===Lu)throw new Error(`${mt} found map but not enough entries (got ${c} [no key], expected ${t.value})`);if(n!==!0&&typeof u!="string")throw new Error(`${mt} non-string keys not supported (got ${typeof u})`);if(r.rejectDuplicateMapKeys===!0&&(n&&a.has(u)||!n&&u in i))throw new Error(`${mt} found repeat map key "${u}"`);let m=Bu(e,r);if(m===Lu)throw new Error(`${mt} found map but not enough entries (got ${c} [no value], expected ${t.value})`);n?a.set(u,m):i[u]=m}return n?a:i}o(MP,"tokenToMap");function Bu(t,e){if(t.done())return Lu;let r=t.next();if(r.type===_e.break)return Sd;if(r.type.terminal)return r.value;if(r.type===_e.array)return SP(r,t,e);if(r.type===_e.map)return MP(r,t,e);if(r.type===_e.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=Bu(t,e);return e.tags[r.value](n)}throw new Error(`${mt} tag not supported (${r.value})`)}throw new Error("unsupported")}o(Bu,"tokensToObject");function Z1(t,e){if(!(t instanceof Uint8Array))throw new Error(`${mt} data to decode must be a Uint8Array`);e=Object.assign({},AP,e);let r=e.tokenizer||new Ad(t,e),n=Bu(r,e);if(n===Lu)throw new Error(`${mt} did not find any content to decode`);if(n===Sd)throw new Error(`${mt} got unexpected break`);if(!r.done())throw new Error(`${mt} too many terminals, data makes no sense`);return n}o(Z1,"decode");Pi();var i4=42;function CP(t){if(t.asCID!==t)return null;let e=We.asCID(t);if(!e)return null;let r=new Uint8Array(e.bytes.byteLength+1);return r.set(e.bytes,1),[new $e(_e.tag,i4),new $e(_e.bytes,r)]}o(CP,"cidEncoder");function kP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(kP,"undefinedEncoder");function IP(t){if(Number.isNaN(t))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(t===1/0||t===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(IP,"numberEncoder");var DP={float64:!0,typeEncoders:{Object:CP,undefined:kP,number:IP}};function OP(t){if(t[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return We.decode(t.subarray(1))}o(OP,"cidDecoder");var o4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};o4.tags[i4]=OP;var RP="dag-cbor",cc=113,qa=o(t=>X1(t,DP),"encode"),Q1=o(t=>Z1(t,o4),"decode");var NP=24;async function s4(t){let e=await Ua({value:t,codec:Hi,hasher:Ms});return{cid:e.cid,linkedBlock:e.bytes}}o(s4,"encodePayload");function PP(t,e=NP){let r=(e-t.length%e)%e,n=new Uint8Array(t.length+r);return n.set(t,0),n}o(PP,"pad");async function LP(t){return(await Ua({value:t,codec:Hi,hasher:Dh})).cid}o(LP,"encodeIdentityCID");function BP(t){if(t=We.asCID(t),t.code!==cc)throw new Error("CID codec must be dag-cbor");if(t.multihash.code!==Dh.code)throw new Error("CID must use identity multihash");return Q1(t.multihash.digest)}o(BP,"decodeIdentityCID");async function a4(t,e){return PP((await LP(t)).bytes,e)}o(a4,"prepareCleartext");function f4(t){return BP(We.decodeFirst(t)[0])}o(f4,"decodeCleartext");var c4=Symbol("abortable"),Md=Symbol("aborted");function u4(t,e){if(e.aborted)return Promise.reject(Md);let r,n=new Promise((i,a)=>{r=a});return e.addEventListener("abort",()=>{r(Md)}),Promise.race([t,n])}o(u4,"abortable");var l4=o((t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),""),"nanoid");var Td="utils_abort_request";var an;(function(t){t[t.PARSE_ERROR=-32700]="PARSE_ERROR",t[t.INVALID_REQUEST=-32600]="INVALID_REQUEST",t[t.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",t[t.INVALID_PARAMS=-32602]="INVALID_PARAMS",t[t.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(an||(an={}));var h4={[an.PARSE_ERROR]:"Parse error",[an.INVALID_REQUEST]:"Invalid request",[an.METHOD_NOT_FOUND]:"Method not found",[an.INVALID_PARAMS]:"Invalid params",[an.INTERNAL_ERROR]:"Internal error"};function UP(t){return-32e3>=t&&t>=-32099}o(UP,"isServerError");function Cd(t){return h4[t.toString()]??(UP(t)?"Server error":"Application error")}o(Cd,"getErrorMessage");var wn=class extends Error{static fromObject(e){return new wn(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,r,n){super(),Object.setPrototypeOf(this,wn.prototype),this.code=e,this.data=n,this.message=r??Cd(e)}};o(wn,"RPCError");function Uu(t){let e=h4[t];return o(function(n){return new wn(t,e,n)},"createError")}o(Uu,"createErrorFactory");var $P=Uu(an.PARSE_ERROR),xG=Uu(an.INVALID_REQUEST),wG=Uu(an.METHOD_NOT_FOUND),_G=Uu(an.INVALID_PARAMS),EG=Uu(an.INTERNAL_ERROR);function FP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(FP,"_checkPrivateRedeclaration");function qP(t,e){return e.get?e.get.call(t):e.value}o(qP,"_classApplyDescriptorGet");function HP(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}o(HP,"_classApplyDescriptorSet");function d4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(d4,"_classExtractFieldDescriptor");function eb(t,e){var r=d4(t,e,"get");return qP(t,r)}o(eb,"_classPrivateFieldGet");function zP(t,e,r){FP(t,e),e.set(t,r)}o(zP,"_classPrivateFieldInit");function KP(t,e,r){var n=d4(t,e,"set");return HP(t,n,r),r}o(KP,"_classPrivateFieldSet");var $u=new WeakMap,uc=class{get connection(){return eb(this,$u)}createID(){return l4()}request(e,r=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Md);let a=this.createID(),c=eb(this,$u).send({jsonrpc:"2.0",id:a,method:e,params:r}).then(u=>{if(u==null)throw new Error("Missing response");if(u.error!=null)throw wn.fromObject(u.error);return u.result});return i==null?c:(i.addEventListener("abort",()=>{this.notify(Td,{id:a})}),u4(c,i))}async notify(e,r=void 0){await eb(this,$u).send({jsonrpc:"2.0",method:e,params:r})}constructor(e){zP(this,$u,{writable:!0,value:void 0}),KP(this,$u,e)}};o(uc,"RPCClient");function p4(t,e){return{jsonrpc:"2.0",id:t,error:{code:e,message:Cd(e)}}}o(p4,"createErrorResponse");function jP(t,e,r){console.warn("Unhandled handler error",e,r)}o(jP,"fallbackOnHandlerError");function GP(t,e){console.warn("Unhandled invalid message",e)}o(GP,"fallbackOnInvalidMessage");function VP(t,e){console.warn("Unhandled notification",e)}o(VP,"fallbackOnNotification");function m4(t,e={}){let r=e.onHandlerError??jP,n=e.onInvalidMessage??GP,i=e.onNotification??VP,a={};function c(u,m){if(m.method===Td){let v=m.params?.id;v!=null&&a[v]?.abort()}else i(u,m)}return o(c,"handleNotification"),o(async function(m,v){let x=v.id;if(v.jsonrpc!=="2.0"||v.method==null)return x==null?(n(m,v),null):p4(x,an.INVALID_REQUEST);let S=t[v.method];if(S==null)return x==null?(c(m,v),null):p4(x,an.METHOD_NOT_FOUND);try{let O;if(x!=null&&S[c4]){let D=new AbortController;a[x]=D,O=S(m,v.params,{signal:D.signal})}else O=S(m,v.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return x==null||a[x]?.signal.aborted?null:{jsonrpc:"2.0",id:x,result:R}}catch(O){if(x==null||a[x]?.signal.aborted)return r(m,v,O),null;let R;if(O instanceof wn)R=O.toObject();else{r(m,v,O);let D=O.code??-32e3;R={code:D,message:O.message||Cd(D)}}return{jsonrpc:"2.0",id:x,error:R}}finally{x!=null&&delete a[x]}},"handleRequest")}o(m4,"createHandler");Pi();var K5=Lt(s5(),1),Zr=Lt(Ka(),1);function cb(){return cb=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},cb.apply(this,arguments)}o(cb,"_extends");var ub={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},hL={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},lb={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},dL={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:ub,1:lb}}},pL={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:ub,1:lb,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Ku={"2":ub,"10":hL,"19":{assetName:lb,assetType:dL,assetId:pL}};function a5(t,e){return t.split(e.parameters.delimiter)}o(a5,"splitParams");function ju(t,e){var r=a5(t,e),n={};return r.forEach(function(i,a){n[e.parameters.values[a].name]=i}),n}o(ju,"getParams");function mc(t,e){return Object.values(e.parameters.values).map(function(r){var n=t[r.name];return typeof n=="string"?n:mc(n,r)}).join(e.parameters.delimiter)}o(mc,"joinParams");function Gu(t,e){if(!new RegExp(e.regex).test(t))return!1;var r=a5(t,e);if(r.length!==Object.keys(e.parameters.values).length)return!1;var n=r.map(function(i,a){return new RegExp(e.parameters.values[a].regex).test(i)}).filter(function(i){return!!i});return n.length===r.length}o(Gu,"isValidId");var zs=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.namespace=r.namespace,this.reference=r.reference}o(t,"ChainId"),t.parse=o(function(n){if(!Gu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(ju(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return mc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();zs.spec=Ku["2"];var Ks=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new zs(r.chainId),this.address=r.address}o(t,"AccountId"),t.parse=o(function(n){if(!Gu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=ju(n,this.spec),a=i.namespace,c=i.reference,u=i.address,m=new zs({namespace:a,reference:c});return new t({chainId:m,address:u}).toJSON()},"parse"),t.format=o(function(n){var i=new zs(n.chainId),a=cb({},i.toJSON(),{address:n.address});return mc(a,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),t}();Ks.spec=Ku["10"];var hb=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.namespace=r.namespace,this.reference=r.reference}o(t,"AssetName"),t.parse=o(function(n){if(!Gu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(ju(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return mc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),t}();hb.spec=Ku["19"].assetName;var mL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new zs(r.chainId),this.assetName=new hb(r.assetName)}o(t,"AssetType"),t.parse=o(function(n){if(!Gu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(ju(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return mc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),t}();mL.spec=Ku["19"].assetType;var bL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new zs(r.chainId),this.assetName=new hb(r.assetName),this.tokenId=r.tokenId}o(t,"AssetId"),t.parse=o(function(n){if(!Gu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(ju(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return mc(n,this.spec)},"format");var e=t.prototype;return e.toString=o(function(){return t.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),t}();bL.spec=Ku["19"].assetId;var f5="logger/5.7.0";var c5=!1,u5=!1,Nd={debug:1,default:2,info:2,warning:3,error:4,off:5},l5=Nd.default,db=null;function gL(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}o(gL,"_checkNormalize");var h5=gL(),pb;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(pb||(pb={}));var Ki;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ki||(Ki={}));var d5="0123456789abcdef",Et=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let n=e.toLowerCase();Nd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(l5>Nd[n])&&console.log.apply(console,r)}debug(...e){this._log(Et.levels.DEBUG,e)}info(...e){this._log(Et.levels.INFO,e)}warn(...e){this._log(Et.levels.WARNING,e)}makeError(e,r,n){if(u5)return this.makeError("censored error",r,{});r||(r=Et.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(m=>{let v=n[m];try{if(v instanceof Uint8Array){let x="";for(let S=0;S<v.length;S++)x+=d5[v[S]>>4],x+=d5[v[S]&15];i.push(m+"=Uint8Array(0x"+x+")")}else i.push(m+"="+JSON.stringify(v))}catch{i.push(m+"="+JSON.stringify(n[m].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let a=e,c="";switch(r){case Ki.NUMERIC_FAULT:{c="NUMERIC_FAULT";let m=e;switch(m){case"overflow":case"underflow":case"division-by-zero":c+="-"+m;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Ki.CALL_EXCEPTION:case Ki.INSUFFICIENT_FUNDS:case Ki.MISSING_NEW:case Ki.NONCE_EXPIRED:case Ki.REPLACEMENT_UNDERPRICED:case Ki.TRANSACTION_REPLACED:case Ki.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let u=new Error(e);return u.reason=a,u.code=r,Object.keys(n).forEach(function(m){u[m]=n[m]}),u}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Et.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),h5&&this.throwError("platform missing String.prototype.normalize",Et.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h5})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,Et.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,Et.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Et.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return db||(db=new Et(f5)),db}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),c5){if(!e)return;this.globalLogger().throwError("error censorship permanent",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u5=!!e,c5=!!r}static setLogLevel(e){let r=Nd[e.toLowerCase()];if(r==null){Et.globalLogger().warn("invalid log level - "+e);return}l5=r}static from(e){return new Et(e)}};o(Et,"Logger");Et.errors=Ki;Et.levels=pb;var p5="bytes/5.7.0";var gr=new Et(p5);function b5(t){return!!t.toHexString}o(b5,"isHexable");function bc(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return bc(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}o(bc,"addSlice");function g5(t){return ji(t)&&!(t.length%2)||bb(t)}o(g5,"isBytesLike");function m5(t){return typeof t=="number"&&t==t&&t%1===0}o(m5,"isInteger");function bb(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!m5(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!m5(r)||r<0||r>=256)return!1}return!0}o(bb,"isBytes");function or(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),bc(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),b5(t)&&(t=t.toHexString()),ji(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":gr.throwArgumentError("hex data is odd-length","value",t));let n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return bc(new Uint8Array(n))}return bb(t)?bc(new Uint8Array(t)):gr.throwArgumentError("invalid arrayify value","value",t)}o(or,"arrayify");function gb(t){let e=t.map(i=>or(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),bc(n)}o(gb,"concat");function vL(t,e){t=or(t),t.length>e&&gr.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),bc(r)}o(vL,"zeroPad");function ji(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}o(ji,"isHexString");var mb="0123456789abcdef";function Yr(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=mb[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),b5(t))return t.toHexString();if(ji(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":gr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(bb(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=mb[(i&240)>>4]+mb[i&15]}return r}return gr.throwArgumentError("invalid hexlify value","value",t)}o(Yr,"hexlify");function Pd(t){if(typeof t!="string")t=Yr(t);else if(!ji(t)||t.length%2)return null;return(t.length-2)/2}o(Pd,"hexDataLength");function Ld(t,e,r){return typeof t!="string"?t=Yr(t):(!ji(t)||t.length%2)&&gr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}o(Ld,"hexDataSlice");function js(t,e){for(typeof t!="string"?t=Yr(t):ji(t)||gr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&gr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}o(js,"hexZeroPad");function Bd(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(g5(t)){let r=or(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Yr(r.slice(0,32)),e.s=Yr(r.slice(32,64))):r.length===65?(e.r=Yr(r.slice(0,32)),e.s=Yr(r.slice(32,64)),e.v=r[64]):gr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:gr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Yr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=vL(or(e._vs),32);e._vs=Yr(i);let a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&gr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=Yr(i);e.s==null?e.s=c:e.s!==c&&gr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?gr.throwArgumentError("signature missing v and recoveryParam","signature",t):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&&gr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!ji(e.r)?gr.throwArgumentError("signature missing or invalid r","signature",t):e.r=js(e.r,32),e.s==null||!ji(e.s)?gr.throwArgumentError("signature missing or invalid s","signature",t):e.s=js(e.s,32);let r=or(e.s);r[0]>=128&&gr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let n=Yr(r);e._vs&&(ji(e._vs)||gr.throwArgumentError("signature invalid _vs","signature",t),e._vs=js(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&gr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(Bd,"splitSignature");var x5=Lt(yb());var y5="bignumber/5.7.0";var yL=x5.default.BN,mV=new Et(y5);function xb(t){return new yL(t,36).toString(16)}o(xb,"_base36To16");var w5=Lt(Hm());function gc(t){return"0x"+w5.default.keccak_256(or(t))}o(gc,"keccak256");var _5="address/5.7.0";var Vu=new Et(_5);function E5(t){ji(t,20)||Vu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let n=or(gc(r));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(E5,"getChecksumAddress");var _L=9007199254740991;function EL(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}o(EL,"log10");var wb={};for(let t=0;t<10;t++)wb[String(t)]=String(t);for(let t=0;t<26;t++)wb[String.fromCharCode(65+t)]=String(10+t);var A5=Math.floor(EL(_L));function AL(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>wb[n]).join("");for(;e.length>=A5;){let n=e.substring(0,A5);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}o(AL,"ibanChecksum");function S5(t){let e=null;if(typeof t!="string"&&Vu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=E5(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Vu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==AL(t)&&Vu.throwArgumentError("bad icap checksum","address",t),e=xb(t.substring(4));e.length<40;)e="0"+e;e=E5("0x"+e)}else Vu.throwArgumentError("invalid address","address",t);return e}o(S5,"getAddress");var M5="properties/5.7.0";var OV=new Et(M5);function vc(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}o(vc,"defineReadOnly");var T5="strings/5.7.0";var C5=new Et(T5),Wu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Wu||(Wu={}));var ja;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(ja||(ja={}));function SL(t,e,r,n,i){return C5.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}o(SL,"errorFunc");function k5(t,e,r,n,i){if(t===ja.BAD_PREFIX||t===ja.UNEXPECTED_CONTINUE){let a=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)a++;return a}return t===ja.OVERRUN?r.length-e-1:0}o(k5,"ignoreFunc");function ML(t,e,r,n,i){return t===ja.OVERLONG?(n.push(i),0):(n.push(65533),k5(t,e,r,n,i))}o(ML,"replaceFunc");var TL=Object.freeze({error:SL,ignore:k5,replace:ML});function Ju(t,e=Wu.current){e!=Wu.current&&(C5.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;let a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(a&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return or(r)}o(Ju,"toUtf8Bytes");var I5=`Ethereum Signed Message:
|
|
652
|
+
`;function _b(t){return typeof t=="string"&&(t=Ju(t)),gc(gb([Ju(I5),Ju(String(t.length)),t]))}o(_b,"hashMessage");var yt=Lt(yb()),bo=Lt(wu());function yc(t,e,r){return r={path:e,exports:{},require:function(n,i){return CL(n,i??r.path)}},t(r,r.exports),r.exports}o(yc,"createCommonjsModule");function CL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(CL,"commonjsRequire");var Mb=O5;function O5(t,e){if(!t)throw new Error(e||"Assertion failed")}o(O5,"assert");O5.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual");var Gi=yc(function(t,e){"use strict";var r=e;function n(c,u){if(Array.isArray(c))return c.slice();if(!c)return[];var m=[];if(typeof c!="string"){for(var v=0;v<c.length;v++)m[v]=c[v]|0;return m}if(u==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var v=0;v<c.length;v+=2)m.push(parseInt(c[v]+c[v+1],16))}else for(var v=0;v<c.length;v++){var x=c.charCodeAt(v),S=x>>8,O=x&255;S?m.push(S,O):m.push(O)}return m}o(n,"toArray"),r.toArray=n;function i(c){return c.length===1?"0"+c:c}o(i,"zero2"),r.zero2=i;function a(c){for(var u="",m=0;m<c.length;m++)u+=i(c[m].toString(16));return u}o(a,"toHex"),r.toHex=a,r.encode=o(function(u,m){return m==="hex"?a(u):u},"encode")}),Hn=yc(function(t,e){"use strict";var r=e;r.assert=Mb,r.toArray=Gi.toArray,r.zero2=Gi.zero2,r.toHex=Gi.toHex,r.encode=Gi.encode;function n(m,v,x){var S=new Array(Math.max(m.bitLength(),x)+1);S.fill(0);for(var O=1<<v+1,R=m.clone(),D=0;D<S.length;D++){var P,J=R.andln(O-1);R.isOdd()?(J>(O>>1)-1?P=(O>>1)-J:P=J,R.isubn(P)):P=0,S[D]=P,R.iushrn(1)}return S}o(n,"getNAF"),r.getNAF=n;function i(m,v){var x=[[],[]];m=m.clone(),v=v.clone();for(var S=0,O=0,R;m.cmpn(-S)>0||v.cmpn(-O)>0;){var D=m.andln(3)+S&3,P=v.andln(3)+O&3;D===3&&(D=-1),P===3&&(P=-1);var J;(D&1)===0?J=0:(R=m.andln(7)+S&7,(R===3||R===5)&&P===2?J=-D:J=D),x[0].push(J);var B;(P&1)===0?B=0:(R=v.andln(7)+O&7,(R===3||R===5)&&D===2?B=-P:B=P),x[1].push(B),2*S===J+1&&(S=1-S),2*O===B+1&&(O=1-O),m.iushrn(1),v.iushrn(1)}return x}o(i,"getJSF"),r.getJSF=i;function a(m,v,x){var S="_"+v;m.prototype[v]=o(function(){return this[S]!==void 0?this[S]:this[S]=x.call(this)},"cachedProperty")}o(a,"cachedProperty"),r.cachedProperty=a;function c(m){return typeof m=="string"?r.toArray(m,"hex"):m}o(c,"parseBytes"),r.parseBytes=c;function u(m){return new yt.default(m,"hex","le")}o(u,"intFromLE"),r.intFromLE=u}),Fd=Hn.getNAF,kL=Hn.getJSF,qd=Hn.assert;function Vs(t,e){this.type=t,this.p=new yt.default(e.p,16),this.red=e.prime?yt.default.red(e.prime):yt.default.mont(this.p),this.zero=new yt.default(0).toRed(this.red),this.one=new yt.default(1).toRed(this.red),this.two=new yt.default(2).toRed(this.red),this.n=e.n&&new yt.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Vs,"BaseCurve");var Ga=Vs;Vs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Vs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Vs.prototype._fixedNafMul=o(function(e,r){qd(e.precomputed);var n=e._getDoubles(),i=Fd(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],u,m;for(u=0;u<i.length;u+=n.step){m=0;for(var v=u+n.step-1;v>=u;v--)m=(m<<1)+i[v];c.push(m)}for(var x=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)m=c[u],m===O?S=S.mixedAdd(n.points[u]):m===-O&&(S=S.mixedAdd(n.points[u].neg()));x=x.add(S)}return x.toP()},"_fixedNafMul");Vs.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=Fd(r,n,this._bitLength),u=this.jpoint(null,null,null),m=c.length-1;m>=0;m--){for(var v=0;m>=0&&c[m]===0;m--)v++;if(m>=0&&v++,u=u.dblp(v),m<0)break;var x=c[m];qd(x!==0),e.type==="affine"?x>0?u=u.mixedAdd(a[x-1>>1]):u=u.mixedAdd(a[-x-1>>1].neg()):x>0?u=u.add(a[x-1>>1]):u=u.add(a[-x-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Vs.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,m=this._wnafT3,v=0,x,S,O;for(x=0;x<i;x++){O=r[x];var R=O._getNAFPoints(e);c[x]=R.wnd,u[x]=R.points}for(x=i-1;x>=1;x-=2){var D=x-1,P=x;if(c[D]!==1||c[P]!==1){m[D]=Fd(n[D],c[D],this._bitLength),m[P]=Fd(n[P],c[P],this._bitLength),v=Math.max(m[D].length,v),v=Math.max(m[P].length,v);continue}var J=[r[D],null,null,r[P]];r[D].y.cmp(r[P].y)===0?(J[1]=r[D].add(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg())):r[D].y.cmp(r[P].y.redNeg())===0?(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].add(r[P].neg())):(J[1]=r[D].toJ().mixedAdd(r[P]),J[2]=r[D].toJ().mixedAdd(r[P].neg()));var B=[-3,-1,-5,-7,0,7,5,1,3],W=kL(n[D],n[P]);for(v=Math.max(W[0].length,v),m[D]=new Array(v),m[P]=new Array(v),S=0;S<v;S++){var Q=W[0][S]|0,Y=W[1][S]|0;m[D][S]=B[(Q+1)*3+(Y+1)],m[P][S]=0,u[D]=J}}var oe=this.jpoint(null,null,null),j=this._wnafT4;for(x=v;x>=0;x--){for(var H=0;x>=0;){var G=!0;for(S=0;S<i;S++)j[S]=m[S][x]|0,j[S]!==0&&(G=!1);if(!G)break;H++,x--}if(x>=0&&H++,oe=oe.dblp(H),x<0)break;for(S=0;S<i;S++){var le=j[S];le!==0&&(le>0?O=u[S][le-1>>1]:le<0&&(O=u[S][-le-1>>1].neg()),O.type==="affine"?oe=oe.mixedAdd(O):oe=oe.add(O))}}for(x=0;x<i;x++)u[x]=null;return a?oe:oe.toP()},"_wnafMulAdd");function wi(t,e){this.curve=t,this.type=e,this.precomputed=null}o(wi,"BasePoint");Vs.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Vs.prototype.decodePoint=o(function(e,r){e=Hn.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?qd(e[e.length-1]%2===0):e[0]===7&&qd(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 r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode");wi.prototype.encode=o(function(e,r){return Hn.encode(this._encode(r),e)},"encode");wi.prototype.precompute=o(function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},"precompute");wi.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},"_hasDoubles");wi.prototype._getDoubles=o(function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=e){for(var c=0;c<e;c++)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 r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:e,points:r}},"_getNAFPoints");wi.prototype._getBeta=o(function(){return null},"_getBeta");wi.prototype.dblp=o(function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r},"dblp");var Tb=yc(function(t){typeof Object.create=="function"?t.exports=o(function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):t.exports=o(function(r,n){if(n){r.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}},"inherits")}),IL=Hn.assert;function _i(t){Ga.call(this,"short",t),this.a=new yt.default(t.a,16).toRed(this.red),this.b=new yt.default(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(_i,"ShortCurve");Tb(_i,Ga);var DL=_i;_i.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new yt.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new yt.default(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],IL(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(u){return{a:new yt.default(u.a,16),b:new yt.default(u.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism");_i.prototype._getEndoRoots=o(function(e){var r=e===this.p?this.red:yt.default.mont(e),n=new yt.default(2).toRed(r).redInvm(),i=n.redNeg(),a=new yt.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=i.redAdd(a).fromRed(),u=i.redSub(a).fromRed();return[c,u]},"_getEndoRoots");_i.prototype._getEndoBasis=o(function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),a=new yt.default(1),c=new yt.default(0),u=new yt.default(0),m=new yt.default(1),v,x,S,O,R,D,P,J=0,B,W;n.cmpn(0)!==0;){var Q=i.div(n);B=i.sub(Q.mul(n)),W=u.sub(Q.mul(a));var Y=m.sub(Q.mul(c));if(!S&&B.cmp(r)<0)v=P.neg(),x=a,S=B.neg(),O=W;else if(S&&++J===2)break;P=B,i=n,n=B,u=a,a=W,m=c,c=Y}R=B.neg(),D=W;var oe=S.sqr().add(O.sqr()),j=R.sqr().add(D.sqr());return j.cmp(oe)>=0&&(R=v,D=x),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),D=D.neg()),[{a:S,b:O},{a:R,b:D}]},"_getEndoBasis");_i.prototype._endoSplit=o(function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),c=n.b.neg().mul(e).divRound(this.n),u=a.mul(n.a),m=c.mul(i.a),v=a.mul(n.b),x=c.mul(i.b),S=e.sub(u).sub(m),O=v.add(x).neg();return{k1:S,k2:O}},"_endoSplit");_i.prototype.pointFromX=o(function(e,r){e=new yt.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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");_i.prototype.validate=o(function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},"validate");_i.prototype._endoWnafMulAdd=o(function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var u=this._endoSplit(r[c]),m=e[c],v=m._getBeta();u.k1.negative&&(u.k1.ineg(),m=m.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=m,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var x=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return x},"_endoWnafMulAdd");function Ir(t,e,r,n){Ga.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new yt.default(e,16),this.y=new yt.default(r,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");Tb(Ir,Ga.BasePoint);_i.prototype.point=o(function(e,r,n){return new Ir(this,e,r,n)},"point");_i.prototype.pointFromJSON=o(function(e,r){return Ir.fromJSON(this,e,r)},"pointFromJSON");Ir.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(a){return n.point(a.x.redMul(n.endo.beta),a.y)},"endoMul");e.beta=r,r.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 r}},"_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,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function a(u){return e.point(u[0],u[1],n)}o(a,"obj2point");var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(a))}},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 r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.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 r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),c=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,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 yt.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");Ir.prototype.mulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)},"mulAdd");Ir.prototype.jmulAdd=o(function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,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 r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(a){return a.neg()},"negate");r.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 r},"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 Fr(t,e,r,n){Ga.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yt.default(0)):(this.x=new yt.default(e,16),this.y=new yt.default(r,16),this.z=new yt.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(Fr,"JPoint");Tb(Fr,Ga.BasePoint);_i.prototype.jpoint=o(function(e,r,n){return new Fr(this,e,r,n)},"jpoint");Fr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)},"toP");Fr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Fr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),c=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(n.redMul(this.z)),m=i.redSub(a),v=c.redSub(u);if(m.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var x=m.redSqr(),S=x.redMul(m),O=i.redMul(x),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),D=v.redMul(O.redISub(R)).redISub(c.redMul(S)),P=this.z.redMul(e.z).redMul(m);return this.curve.jpoint(R,D,P)},"add");Fr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,c=e.y.redMul(r).redMul(this.z),u=n.redSub(i),m=a.redSub(c);if(u.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),x=v.redMul(u),S=n.redMul(v),O=m.redSqr().redIAdd(x).redISub(S).redISub(S),R=m.redMul(S.redISub(O)).redISub(a.redMul(x)),D=this.z.redMul(u);return this.curve.jpoint(O,R,D)},"mixedAdd");Fr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,c=this.x,u=this.y,m=this.z,v=m.redSqr().redSqr(),x=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=x.redSqr(),R=O.redSqr(),D=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),P=c.redMul(O),J=D.redSqr().redISub(P.redAdd(P)),B=P.redISub(J),W=D.redMul(B);W=W.redIAdd(W).redISub(R);var Q=x.redMul(m);r+1<e&&(v=v.redMul(R)),c=J,m=Q,x=W}return this.curve.jpoint(c,x.redMul(a),m)},"dblp");Fr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Fr.prototype._zeroDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i),v=m.redSqr().redISub(u).redISub(u),x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),e=v,r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),D=this.x.redAdd(O).redSqr().redISub(S).redISub(R);D=D.redIAdd(D);var P=S.redAdd(S).redIAdd(S),J=P.redSqr(),B=R.redIAdd(R);B=B.redIAdd(B),B=B.redIAdd(B),e=J.redISub(D).redISub(D),r=P.redMul(D.redISub(e)).redISub(B),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)},"_zeroDbl");Fr.prototype._threeDbl=o(function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(i).redISub(c);u=u.redIAdd(u);var m=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),v=m.redSqr().redISub(u).redISub(u);e=v;var x=c.redIAdd(c);x=x.redIAdd(x),x=x.redIAdd(x),r=m.redMul(u.redISub(v)).redISub(x),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),D=this.x.redSub(S).redMul(this.x.redAdd(S));D=D.redAdd(D).redIAdd(D);var P=R.redIAdd(R);P=P.redIAdd(P);var J=P.redAdd(P);e=D.redSqr().redISub(J),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(S);var B=O.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B),r=D.redMul(P.redISub(e)).redISub(B)}return this.curve.jpoint(e,r,n)},"_threeDbl");Fr.prototype._dbl=o(function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),c=r.redSqr(),u=n.redSqr(),m=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var x=v.redMul(u),S=m.redSqr().redISub(x.redAdd(x)),O=x.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=m.redMul(O).redISub(R),P=n.redAdd(n).redMul(i);return this.curve.jpoint(S,D,P)},"_dbl");Fr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(i);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(c);var m=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var x=a.redIAdd(u).redSqr().redISub(c).redISub(m).redISub(v),S=r.redMul(x);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(m).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(x.redMul(v.redISub(x)).redISub(u.redMul(m)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var D=this.z.redAdd(u).redSqr().redISub(n).redISub(m);return this.curve.jpoint(O,R,D)},"trpl");Fr.prototype.mul=o(function(e,r){return e=new yt.default(e,r),this.curve._wnafMul(this,e)},"mul");Fr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Fr.prototype.eqXToP=o(function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},"eqXToP");Fr.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");Fr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var Ud=yc(function(t,e){"use strict";var r=e;r.base=Ga,r.short=DL,r.mont=null,r.edwards=null}),$d=yc(function(t,e){"use strict";var r=e,n=Hn.assert;function i(u){u.type==="short"?this.curve=new Ud.short(u):u.type==="edwards"?this.curve=new Ud.edwards(u):this.curve=new Ud.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"),r.PresetCurve=i;function a(u,m){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var v=new i(m);return Object.defineProperty(r,u,{configurable:!0,enumerable:!0,value:v}),v}})}o(a,"defineCurve"),a("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:bo.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:bo.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:bo.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:bo.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"]}),a("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:bo.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:bo.default.sha256,gRed:!1,g:["9"]}),a("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:bo.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}a("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:bo.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Gs(t){if(!(this instanceof Gs))return new Gs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Gi.toArray(t.entropy,t.entropyEnc||"hex"),r=Gi.toArray(t.nonce,t.nonceEnc||"hex"),n=Gi.toArray(t.pers,t.persEnc||"hex");Mb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(Gs,"HmacDRBG");var R5=Gs;Gs.prototype._init=o(function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");Gs.prototype._hmac=o(function(){return new bo.default.hmac(this.hash,this.K)},"hmac");Gs.prototype._update=o(function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.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,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Gi.toArray(e,r),n=Gi.toArray(n,i),Mb(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,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Gi.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(n),this._reseed++,Gi.encode(c,r)},"generate");var Sb=Hn.assert;function Xr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(Xr,"KeyPair");var Cb=Xr;Xr.fromPublic=o(function(e,r,n){return r instanceof Xr?r:new Xr(e,{pub:r,pubEnc:n})},"fromPublic");Xr.fromPrivate=o(function(e,r,n){return r instanceof Xr?r:new Xr(e,{priv:r,privEnc:n})},"fromPrivate");Xr.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");Xr.prototype.getPublic=o(function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},"getPublic");Xr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");Xr.prototype._importPrivate=o(function(e,r){this.priv=new yt.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");Xr.prototype._importPublic=o(function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?Sb(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Sb(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,r)},"_importPublic");Xr.prototype.derive=o(function(e){return e.validate()||Sb(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");Xr.prototype.sign=o(function(e,r,n){return this.ec.sign(e,this,r,n)},"sign");Xr.prototype.verify=o(function(e,r){return this.ec.verify(e,r,this)},"verify");Xr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var OL=Hn.assert;function Hd(t,e){if(t instanceof Hd)return t;this._importDER(t,e)||(OL(t.r&&t.s,"Signature without r or s"),this.r=new yt.default(t.r,16),this.s=new yt.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Hd,"Signature");var zd=Hd;function RL(){this.place=0}o(RL,"Position");function Eb(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,c=e.place;a<n;a++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}o(Eb,"getLength");function D5(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}o(D5,"rmPadding");Hd.prototype._importDER=o(function(e,r){e=Hn.toArray(e,r);var n=new RL;if(e[n.place++]!==48)return!1;var i=Eb(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=Eb(e,n);if(a===!1)return!1;var c=e.slice(n.place,a+n.place);if(n.place+=a,e[n.place++]!==2)return!1;var u=Eb(e,n);if(u===!1||e.length!==u+n.place)return!1;var m=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(m[0]===0)if(m[1]&128)m=m.slice(1);else return!1;return this.r=new yt.default(c),this.s=new yt.default(m),this.recoveryParam=null,!0},"_importDER");function Ab(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}o(Ab,"constructLength");Hd.prototype.toDER=o(function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=D5(r),n=D5(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Ab(i,r.length),i=i.concat(r),i.push(2),Ab(i,n.length);var a=i.concat(n),c=[48];return Ab(c,a.length),c=c.concat(a),Hn.encode(c,e)},"toDER");var NL=o(function(){throw new Error("unsupported")},"rand"),N5=Hn.assert;function xi(t){if(!(this instanceof xi))return new xi(t);typeof t=="string"&&(N5(Object.prototype.hasOwnProperty.call($d,t),"Unknown curve "+t),t=$d[t]),t instanceof $d.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}o(xi,"EC");var PL=xi;xi.prototype.keyPair=o(function(e){return new Cb(this,e)},"keyPair");xi.prototype.keyFromPrivate=o(function(e,r){return Cb.fromPrivate(this,e,r)},"keyFromPrivate");xi.prototype.keyFromPublic=o(function(e,r){return Cb.fromPublic(this,e,r)},"keyFromPublic");xi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new R5({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||NL(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yt.default(2));;){var a=new yt.default(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},"genKeyPair");xi.prototype._truncateToN=o(function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");xi.prototype.sign=o(function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yt.default(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),m=new R5({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new yt.default(1)),x=0;;x++){var S=i.k?i.k(x):new yt.default(m.generate(this.n.byteLength()));if(S=this._truncateToN(S,!0),!(S.cmpn(1)<=0||S.cmp(v)>=0)){var O=this.g.mul(S);if(!O.isInfinity()){var R=O.getX(),D=R.umod(this.n);if(D.cmpn(0)!==0){var P=S.invm(this.n).mul(D.mul(r.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(D)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),J^=1),new zd({r:D,s:P,recoveryParam:J})}}}}}},"sign");xi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new yt.default(e,16)),n=this.keyFromPublic(n,i),r=new zd(r,"hex");var a=r.r,c=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var u=c.invm(this.n),m=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),x;return this.curve._maxwellTrick?(x=this.g.jmulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.eqXToP(a)):(x=this.g.mulAdd(m,n.getPublic(),v),x.isInfinity()?!1:x.getX().umod(this.n).cmp(a)===0)},"verify");xi.prototype.recoverPubKey=function(t,e,r,n){N5((3&r)===r,"The recovery param is more than two bits"),e=new zd(e,n);var i=this.n,a=new yt.default(t),c=e.r,u=e.s,m=r&1,v=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?c=this.curve.pointFromX(c.add(this.curve.n),m):c=this.curve.pointFromX(c,m);var x=e.r.invm(i),S=i.sub(a).mul(x).umod(i),O=u.mul(x).umod(i);return this.g.mulAdd(S,c,O)};xi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new zd(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var LL=yc(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=Hn,r.rand=function(){throw new Error("unsupported")},r.curve=Ud,r.curves=$d,r.ec=PL,r.eddsa=null}),P5=LL.ec;var L5="signing-key/5.7.0";var Ib=new Et(L5),kb=null;function go(){return kb||(kb=new P5("secp256k1")),kb}o(go,"getCurve");var Kd=class{constructor(e){vc(this,"curve","secp256k1"),vc(this,"privateKey",Yr(e)),Pd(this.privateKey)!==32&&Ib.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=go().keyFromPrivate(or(this.privateKey));vc(this,"publicKey","0x"+r.getPublic(!1,"hex")),vc(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),vc(this,"_isSigningKey",!0)}_addPoint(e){let r=go().keyFromPublic(or(this.publicKey)),n=go().keyFromPublic(or(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let r=go().keyFromPrivate(or(this.privateKey)),n=or(e);n.length!==32&&Ib.throwArgumentError("bad digest length","digest",e);let i=r.sign(n,{canonical:!0});return Bd({recoveryParam:i.recoveryParam,r:js("0x"+i.r.toString(16),32),s:js("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=go().keyFromPrivate(or(this.privateKey)),n=go().keyFromPublic(or(Db(e)));return js("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(Kd,"SigningKey");function B5(t,e){let r=Bd(e),n={r:or(r.r),s:or(r.s)};return"0x"+go().recoverPubKey(or(t),n,r.recoveryParam).encode("hex",!1)}o(B5,"recoverPublicKey");function Db(t,e){let r=or(t);if(r.length===32){let n=new Kd(r);return e?"0x"+go().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?Yr(r):"0x"+go().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+go().keyFromPublic(r).getPublic(!0,"hex"):Yr(r)}return Ib.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(Db,"computePublicKey");var U5="transactions/5.7.0";var hW=new Et(U5),$5;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})($5||($5={}));function F5(t){let e=Db(t);return S5(Ld(gc(Ld(e,1)),12))}o(F5,"computeAddress");function q5(t,e){return F5(B5(or(t),e))}o(q5,"recoverAddress");var H5="wallet/5.7.0";var wW=new Et(H5);function Ob(t,e){return q5(_b(t),e)}o(Ob,"verifyMessage");var j5=Lt(Su(),1);hu();mu();var BL=`
|
|
653
653
|
sign-in-with-ethereum =
|
|
654
654
|
domain %s" wants you to sign in with your Ethereum account:" LF
|
|
655
655
|
address LF
|
|
@@ -796,25 +796,25 @@ LF = %x0A
|
|
|
796
796
|
DIGIT = %x30-39
|
|
797
797
|
; 0-9
|
|
798
798
|
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
799
|
-
`,
|
|
800
|
-
- `)),le},"resources");i.ast.callbacks.resources=
|
|
799
|
+
`,jd=class{constructor(e){this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0;let r=new K5.default(BL);if(r.generate(),r.errors.length)throw console.error(r.errorsToAscii()),console.error(r.linesToAscii()),console.log(r.displayAttributeErrors()),new Error("ABNF grammar has errors");let n=r.toObject(),i=new Zr.default.parser;i.ast=new Zr.default.ast;let a=Zr.default.ids,c=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.domain=Zr.default.utils.charsToString(oe,j,H)),le},"domain");i.ast.callbacks.domain=c;let u=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.address=Zr.default.utils.charsToString(oe,j,H)),le},"address");i.ast.callbacks.address=u;let m=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.statement=Zr.default.utils.charsToString(oe,j,H)),le},"statement");i.ast.callbacks.statement=m;let v=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.uri||(G.uri=Zr.default.utils.charsToString(oe,j,H))),le},"uri");i.ast.callbacks.uri=v;let x=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.version=Zr.default.utils.charsToString(oe,j,H)),le},"version");i.ast.callbacks.version=x;let S=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.chainId=Zr.default.utils.charsToString(oe,j,H)),le},"chainId");i.ast.callbacks["chain-id"]=S;let O=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.nonce=Zr.default.utils.charsToString(oe,j,H)),le},"nonce");i.ast.callbacks.nonce=O;let R=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.issuedAt=Zr.default.utils.charsToString(oe,j,H)),le},"issuedAt");i.ast.callbacks["issued-at"]=R;let D=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.expirationTime=Zr.default.utils.charsToString(oe,j,H)),le},"expirationTime");i.ast.callbacks["expiration-time"]=D;let P=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.notBefore=Zr.default.utils.charsToString(oe,j,H)),le},"notBefore");i.ast.callbacks["not-before"]=P;let J=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.requestId=Zr.default.utils.charsToString(oe,j,H)),le},"requestId");i.ast.callbacks["request-id"]=J;let B=o(function(Y,oe,j,H,G){let le=a.SEM_OK;return Y===a.SEM_PRE&&(G.resources=Zr.default.utils.charsToString(oe,j,H).slice(3).split(`
|
|
800
|
+
- `)),le},"resources");i.ast.callbacks.resources=B;let W=i.parse(n,"sign-in-with-ethereum",e);if(!W.success)throw new Error(`Invalid message: ${JSON.stringify(W)}`);let Q={};i.ast.translate(Q);for(let[Y,oe]of Object.entries(Q))this[Y]=oe}};o(jd,"ParsedMessage");var z5;(function(t){t.INVALID_SIGNATURE="Invalid signature.",t.EXPIRED_MESSAGE="Expired message.",t.MALFORMED_SESSION="Malformed session."})(z5||(z5={}));var Zu;(function(t){t.PERSONAL_SIGNATURE="Personal signature"})(Zu||(Zu={}));var Yu=class{constructor(e){if(this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0,this.signature=void 0,this.type=void 0,typeof e=="string"){let r=new jd(e);this.domain=r.domain,this.address=r.address,this.statement=r.statement,this.uri=r.uri,this.version=r.version,this.nonce=r.nonce,this.issuedAt=r.issuedAt,this.expirationTime=r.expirationTime,this.notBefore=r.notBefore,this.requestId=r.requestId,this.chainId=r.chainId,this.resources=r.resources}else Object.assign(this,e)}static fromCacao(e){let r=Ks.parse(e.p.iss.replace("did:pkh:","")),n=new this({domain:e.p.domain,address:r.address,uri:e.p.aud,version:e.p.version,chainId:new zs(r.chainId).reference});return e.p.statement&&(n.statement=e.p.statement),e.p.nonce&&(n.nonce=e.p.nonce),e.p.iat&&(n.issuedAt=e.p.iat),e.p.exp&&(n.expirationTime=e.p.exp),e.p.nbf&&(n.notBefore=e.p.nbf),e.p.requestId&&(n.requestId=e.p.requestId),e.p.resources&&(n.resources=e.p.resources),e.s&&(e.s.s&&(n.signature=e.s.s),e.s.t==="eip191"&&(n.type=Zu.PERSONAL_SIGNATURE)),n}toMessage(e){return $L(this,e)}};o(Yu,"SiwxMessage");function UL(t,e){let r=`${t.domain} wants you to sign in with your ${e} account:`,n=`URI: ${t.uri}`,i=[r,t.address].join(`
|
|
801
801
|
`),a=`Version: ${t.version}`;t.nonce||(t.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${t.nonce}`,u=[n,a,c];if(t.issuedAt=t.issuedAt?t.issuedAt:new Date().toISOString(),u.push(`Issued At: ${t.issuedAt}`),t.expirationTime){let v=`Expiration Time: ${t.expirationTime}`;u.push(v)}t.notBefore&&u.push(`Not Before: ${t.notBefore}`),t.requestId&&u.push(`Request ID: ${t.requestId}`),t.chainId&&u.push(`Chain ID: ${t.chainId}`),t.resources&&u.push(["Resources:",...t.resources.map(v=>`- ${v}`)].join(`
|
|
802
802
|
`));let m=u.join(`
|
|
803
803
|
`);return t.statement&&(i=[i,t.statement].join(`
|
|
804
804
|
|
|
805
805
|
`)),[i,m].join(`
|
|
806
806
|
|
|
807
|
-
`)}o(
|
|
807
|
+
`)}o(UL,"asLegacyChainIdString");function $L(t,e){let r=`${t.domain} wants you to sign in with your ${e} account:`,n=`URI: ${t.uri}`,i=[r,t.address].join(`
|
|
808
808
|
`),a=`Version: ${t.version}`;t.nonce||(t.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${t.nonce}`,u=`Chain ID: ${t.chainId}`,m=[n,a,u,c];if(t.issuedAt=t.issuedAt?t.issuedAt:new Date().toISOString(),m.push(`Issued At: ${t.issuedAt}`),t.expirationTime){let x=`Expiration Time: ${t.expirationTime}`;m.push(x)}t.notBefore&&m.push(`Not Before: ${t.notBefore}`),t.requestId&&m.push(`Request ID: ${t.requestId}`),t.resources&&t.resources.length>=1&&m.push(["Resources:",...t.resources.map(x=>`- ${x}`)].join(`
|
|
809
809
|
`));let v=m.join(`
|
|
810
810
|
`);return t.statement&&(i=[i,t.statement].join(`
|
|
811
811
|
|
|
812
812
|
`)),[i,v].join(`
|
|
813
813
|
|
|
814
|
-
`)}o(PL,"asString");var Yu=class extends Ju{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case Xu.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Yu,"SiweMessage");var jd=class extends Ju{toMessage(){return super.toMessage("Solana")}signMessage(){let e;switch(this.type){case Xu.PERSONAL_SIGNATURE:{e=new TextEncoder().encode(this.toMessage());break}default:{e=new TextEncoder().encode(this.toMessage());break}}return e}};o(jd,"SiwsMessage");var LL=5*60,BL=new Date("2022-09-20").valueOf(),Zu;(function(t){function e(c){let u={h:{t:"eip4361"},p:{domain:c.domain,iat:c.issuedAt,iss:`did:pkh:eip155:${c.chainId}:${c.address}`,aud:c.uri,version:c.version,nonce:c.nonce}};return c.signature&&(u.s={t:"eip191",s:c.signature}),c.notBefore&&(u.p.nbf=c.notBefore),c.expirationTime&&(u.p.exp=c.expirationTime),c.statement&&(u.p.statement=c.statement),c.requestId&&(u.p.requestId=c.requestId),c.resources&&(u.p.resources=c.resources),u}o(e,"fromSiweMessage");let r=o(function(c){try{return Promise.resolve(Xx({bytes:c,codec:Hi,hasher:Ss})).then(function(u){return u.value})}catch(u){return Promise.reject(u)}},"fromBlockBytes");t.fromSiweMessage=e;function n(c){let u={h:{t:"caip122"},p:{domain:c.domain,iat:c.issuedAt,iss:`did:pkh:solana:${c.chainId}:${c.address}`,aud:c.uri,version:c.version,nonce:c.nonce}};return c.signature&&(u.s={t:"solana:ed25519",s:c.signature}),c.notBefore&&(u.p.nbf=c.notBefore),c.expirationTime&&(u.p.exp=c.expirationTime),c.statement&&(u.p.statement=c.statement),c.requestId&&(u.p.requestId=c.requestId),c.resources&&(u.p.resources=c.resources),u}o(n,"fromSiwsMessage"),t.fromSiwsMessage=n,t.fromBlockBytes=r;function i(c,u={}){var m,v;if(((m=c.s)==null?void 0:m.t)==="eip191")return a(c,u);if(((v=c.s)==null?void 0:v.t)==="solana:ed25519")return UL(c,u);throw new Error("Unsupported CACAO signature type")}o(i,"verify"),t.verify=i;function a(c,u){if(!c.s)throw new Error("CACAO does not have a signature");let m=u.atTime?u.atTime.getTime():Date.now(),v=(u.clockSkewSecs??LL)*1e3;if(Date.parse(c.p.iat)>m+v||Date.parse(c.p.nbf)>m+v)throw new Error("CACAO is not valid yet");let x=u.revocationPhaseOutSecs?u.revocationPhaseOutSecs*1e3:0;if(!u.disableExpirationCheck&&Date.parse(c.p.exp)+x+v<m)throw new Error("CACAO has expired");let O=[Ib(Yu.fromCacao(c).toMessage(),c.s.s).toLowerCase()];if(Date.parse(c.p.iat)<=BL){let D=Ib(NL(Yu.fromCacao(c),"Ethereum"),c.s.s).toLowerCase();O.push(D)}let R=zs.parse(c.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!O.includes(R))throw new Error("Signature does not belong to issuer")}o(a,"verifyEIP191Signature"),t.verifyEIP191Signature=a})(Zu||(Zu={}));function UL(t,e){if(!t.s)throw new Error("CACAO does not have a signature");let r=e.atTime?e.atTime.getTime():Date.now();if(Date.parse(t.p.iat)>r||Date.parse(t.p.nbf)>r)throw new Error("CACAO is not valid yet");let n=e.revocationPhaseOutSecs?e.revocationPhaseOutSecs*1e3:0;if(!e.disableExpirationCheck&&Date.parse(t.p.exp)+n<r)throw new Error("CACAO has expired");let i=jd.fromCacao(t),a=t.s.s,c=i.signMessage(),u=Ot(a,"base58btc"),m=zs.parse(t.p.iss.replace("did:pkh:","")).address,v=Ot(m,"base58btc");if(!(0,z5.verify)(v,c,u))throw new Error("Signature does not belong to issuer")}o(UL,"verifySolanaSignature");var Qu;(function(t){function e(r){return Ua({value:r,codec:Hi,hasher:Ss})}o(e,"fromCacao"),t.fromCacao=e})(Qu||(Qu={}));Ff();pu();var K5=Lt(Oa(),1);Ff();function j5(){return kt((0,K5.randomBytes)(16),"base64")}o(j5,"randomString");var G5="base64pad",V5="base64url";function W5(t){return kt(t,G5)}o(W5,"encodeBase64");function J5(t){return kt(t,V5)}o(J5,"encodeBase64Url");function Y5(t){return Ot(t,G5)}o(Y5,"decodeBase64");function Gd(t){return JSON.parse(kt(Ot(t,V5)))}o(Gd,"base64urlToJSON");function X5(t){if(t.signatures.length>1)throw new Error("Cant convert to compact jws");return`${t.signatures[0].protected}.${t.payload}.${t.signatures[0].signature}`}o(X5,"fromDagJWS");function Z5(t,e){if(e){let r=e.toISOString().split(".")[0]+"Z";return`${t}?versionTime=${r}`}else return t}o(Z5,"didWithTime");function Q5(t){return t?Array.isArray(t)?t:[t]:[]}o(Q5,"extractControllers");function $L(t){return"registry"in t&&"cache"in t}o($L,"isResolver");var Va=class{constructor({provider:e,resolver:r={},resolverOptions:n,capability:i,parent:a}={}){if(e!=null&&(this._client=new cc(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,a&&this._parentId!==a)throw new Error("Capability issuer and parent not equal")}else a&&(this._parentId=a);this.setResolver(r,n)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){return new Va({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new cc(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,r){this._resolver=$L(e)?e:new ou(e,r)}async authenticate({provider:e,paths:r=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=j5(),a=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:r}),{kid:c}=await this.verifyJWS(a),u=Gd(a.payload);if(!c.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,r={}){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=await Qu.fromCacao(this._capability),a=We.asCID(i.cid);if(!a)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");r.protected=r.protected||{},r.protected.cap=`ipfs://${a?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...r,payload:e});return n}async createDagJWS(e,r={}){let{cid:n,linkedBlock:i}=await i4(e),a=J5(n.bytes);Object.assign(r,{linkedBlock:W5(i)});let c=await this.createJWS(a,r),u=We.asCID(n);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(c.link=u,this._capability){let m=await Qu.fromCacao(this._capability);return{jws:c,linkedBlock:i,cacaoBlock:m.bytes}}return{jws:c,linkedBlock:i}}async verifyJWS(e,r={}){typeof e!="string"&&(e=X5(e));let n=Gd(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!r.disableTimecheck){let v=i.didDocumentMetadata?.nextUpdate;if(v){let S=r.revocationPhaseOutSecs?r.revocationPhaseOutSecs*1e3:0,O=new Date(v).valueOf()+S;if(!(r.atTime&&r.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let x=i.didDocumentMetadata?.updated;if(x&&r.atTime&&r.atTime.getTime()<new Date(x).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let c=i.didDocument?.id;if(r.issuer&&r.issuer===r.capability?.p.iss&&c===r.capability.p.aud)Zu.verify(r.capability,{atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs});else if(r.issuer&&r.issuer!==c){let v=Z5(r.issuer,r.atTime),S=(await this.resolve(v)).didDocument?.controller,O=Q5(S);if(r.capability?.s&&r.capability.p.aud===c&&O.includes(r.capability.p.iss))Zu.verify(r.capability,{atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs});else if(!(c?O.includes(c):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];jx(e,u);let m;try{m=Gd(e.split(".")[1])}catch{}return{kid:n,payload:m,didResolutionResult:i}}async createJWE(e,r,n={}){let i=await Wx(r,this._resolver);return Vx(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,r,n={}){let i=await o4(e);return this.createJWE(i,r,n)}async decryptJWE(e,r={}){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,...r,jwe:e});return Y5(n)}async decryptDagJWE(e){let r=await this.decryptJWE(e);return s4(r)}async resolve(e){let r=await this._resolver.resolve(e);if(r.didResolutionMetadata.error){let{error:n,message:i}=r.didResolutionMetadata,a=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${a}`)}return r}};o(Va,"DID");function e8(t){var e=0,r=t.length,n=[];if(r%2)throw new Error("invalid hex:"+t);for(;e<r;e+=2)n.push(parseInt(t.substr(e,2),16));return new Uint8Array(n)}o(e8,"toUint8Array");var Hb=Lt(el(),1);Ah();var Rb={};Jt(Rb,{keyToDidDoc:()=>QL});function QL(t,e){let r=`did:key:${e}`,n=`${r}#${e}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:kt(t,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(QL,"keyToDidDoc");var Nb={};Jt(Nb,{keyToDidDoc:()=>tB});Ff();var u8=Lt(Au(),1);function eB(t){let e=new Uint8Array(t.length+2);return e[0]=236,e[1]=1,e.set(t,2),`z${kt(e,"base58btc")}`}o(eB,"encodeKey");function tB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=(0,u8.convertPublicKeyToX25519)(t),a=`${r}#${eB(i)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:kt(t,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:a,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:kt(i,"base58btc")}]}}o(tB,"keyToDidDoc");var $b={};Jt($b,{keyToDidDoc:()=>lB,pubKeyBytesToXY:()=>d8});var Vd={};Jt(Vd,{ECPointDecompress:()=>fB});function rB(t){return t>=0?t:-t}o(rB,"n");function nB(t,e){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),t<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,n=1n,i=1n,a=0n;for(;t!==0n;){let c=e/t,u=e%t,m=r-i*c,v=n-a*c;e=t,t=u,r=i,n=a,i=m,a=v}return{g:e,x:r,y:n}}o(nB,"r");function Pb(t,e){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let r=t%e;return r<0n?r+e:r}o(Pb,"f");function iB(t,e){let r=nB(Pb(t,e),e);if(r.g!==1n)throw new RangeError(`${t.toString()} does not have inverse modulo ${e.toString()}`);return Pb(r.x,e)}o(iB,"g");function Wa(t,e,r){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),typeof r=="number"&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(r===1n)return 0n;if(t=Pb(t,r),e<0n)return iB(Wa(t,rB(e),r),r);let n=1n;for(;e>0;)e%2n===1n&&(n=n*t%r),e/=2n,t=t**2n%r;return n}o(Wa,"b");var vr={};Jt(vr,{pubKeyBytesToHex:()=>oB,publicKeyHexToUint8ArrayPointPair:()=>l8,publicKeyIntToUint8ArrayPointPair:()=>h8,publicKeyIntToXY:()=>aB,publicKeyToXY:()=>sB,testHexString:()=>Bb,testUint8Array:()=>Vs});Sh();function oB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");return kt(t,"base16")}o(oB,"pubKeyBytesToHex");function sB(t){if(!Bb(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=l8(t),r=_a.encode(e.xOctet).slice(1),n=_a.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(sB,"publicKeyToXY");function l8(t){if(!Bb(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=t.slice(0,t.length/2),r=t.slice(t.length/2,t.length),n=Ot(e,"base16"),i=Ot(r,"base16");return{xOctet:n,yOctet:i}}o(l8,"publicKeyHexToUint8ArrayPointPair");function Bb(t){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(t)!==null&&e.test(t)&&typeof t=="string")}o(Bb,"testHexString");function Vs(t){return t==null?!1:t.constructor===Uint8Array}o(Vs,"testUint8Array");function aB(t){if(t==null)throw new TypeError("input cannot be null or undefined.");if(typeof t!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(t,"x")||!Object.prototype.hasOwnProperty.call(t,"y"))throw new Error("Input must have properties x and y");if(typeof t.x!="bigint"&&typeof t.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=h8(t),r=_a.encode(e.xOctet).slice(1),n=_a.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(aB,"publicKeyIntToXY");function h8(t){if(t==null)throw new TypeError("input cannot be null or undefined.");if(typeof t!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(t,"x")||!Object.prototype.hasOwnProperty.call(t,"y"))throw new Error("Input must have properties x and y");if(typeof t.x!="bigint"&&typeof t.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=t.x.toString(),r=t.y.toString(),n=Ot(e,"base10"),i=Ot(r,"base10");return{xOctet:n,yOctet:i}}o(h8,"publicKeyIntToUint8ArrayPointPair");function fB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),r=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),m=u**3n-u*3n+n,v=Wa(m,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(fB,"ECPointDecompress");var Wd={};Jt(Wd,{ECPointDecompress:()=>cB});function cB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),r=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),m=u**3n-u*3n+n,v=Wa(m,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(cB,"ECPointDecompress");var Jd={};Jt(Jd,{ECPointDecompress:()=>uB});function uB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),m=u**3n-u*3n+n,v=Wa(m,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(uB,"ECPointDecompress");function lB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=d8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(lB,"keyToDidDoc");function d8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t),r=e.length/2;if(r==64)return vr.publicKeyToXY(e);if(r==65&&e.slice(0,2)=="04"){let n=e.slice(2);return vr.publicKeyToXY(n)}if(r==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ot(e,"base16"),i=Vd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(d8,"pubKeyBytesToXY");var Fb={};Jt(Fb,{keyToDidDoc:()=>hB,pubKeyBytesToXY:()=>p8});function hB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=p8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(hB,"keyToDidDoc");function p8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t),r=e.length/2;if(r==96)return vr.publicKeyToXY(e);if(r==97&&e.slice(0,2)=="04"){let n=e.slice(2);return vr.publicKeyToXY(n)}if(r==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ot(e,"base16"),i=Wd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(p8,"pubKeyBytesToXY");var qb={};Jt(qb,{keyToDidDoc:()=>dB,pubKeyBytesToXY:()=>m8});function dB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=m8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(dB,"keyToDidDoc");function m8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let r=Ot(e,"base16"),n=Jd.ECPointDecompress(r);return vr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(m8,"pubKeyBytesToXY");var pB="application/did+ld+json",b8="application/did+json",mB={231:Rb,237:Nb,4608:$b,4609:Fb,4610:qb};function bB(){return{key:async(t,e,r,n)=>{let i=n.accept||b8,a={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let c=ui.decode(e.id),u=Hb.default.decode(c),m=c.slice(Hb.default.decode.bytes),v=await mB[u].keyToDidDoc(m,e.id);i===pB?(v["@context"]="https://w3id.org/did/v1",a.didDocument=v):i===b8?a.didDocument=v:(delete a.didResolutionMetadata.contentType,a.didResolutionMetadata.error="representationNotSupported")}catch(c){a.didResolutionMetadata.error="invalidDid",a.didResolutionMetadata.message=c.toString()}return a}}}o(bB,"getResolver");var g8={getResolver:bB};var Yd=Lt(Au(),1);var E8=Lt(y8(),1);var gB="base64pad";function x8(t){return JSON.parse((0,E8.default)(t))}o(x8,"toStableObject");function vB(t){let e=new Uint8Array(t.length+2);return e[0]=237,e[1]=1,e.set(t,2),`did:key:z${kt(e,"base58btc")}`}o(vB,"encodeDID");function w8(t){let[e,r,n]=t.split(".");return{payload:r,signatures:[{protected:e,signature:n}]}}o(w8,"toGeneralJWS");var _8=o(async(t,e,r,n={})=>{let i=`${e}#${e.split(":")[2]}`,a=Fx(r),c=x8(Object.assign(n,{kid:i,alg:"EdDSA"}));return Kx(typeof t=="string"?t:x8(t),a,c)},"sign"),yB={did_authenticate:async({did:t,secretKey:e},r)=>{let n=await _8({did:t,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},t,e);return w8(n)},did_createJWS:async({did:t,secretKey:e},r)=>{if(r.did.split("#")[0]!==t)throw new wn(4100,`Unknown DID: ${t}`);let i=await _8(r.payload,t,e,r.protected);return{jws:w8(i)}},did_decryptJWE:async({secretKey:t},e)=>{let r=Yx((0,Yd.convertSecretKeyToX25519)(t));try{let n=await Gx(e.jwe,r);return{cleartext:kt(n,gB)}}catch(n){throw new wn(-32e3,n.message)}}},tl=class{constructor(e){let{secretKey:r,publicKey:n}=(0,Yd.generateKeyPairFromSeed)(e),i=vB(n),a=d4(yB);this._handle=async c=>await a({did:i,secretKey:r},c)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(tl,"Ed25519Provider");var zb={};Jt(zb,{JsonPatchError:()=>dr,_areEquals:()=>il,applyOperation:()=>Ja,applyPatch:()=>n0,applyReducer:()=>AB,deepClone:()=>_B,getValueByPointer:()=>t0,validate:()=>S8,validator:()=>r0});var xB=function(){var t=o(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}o(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),wB=Object.prototype.hasOwnProperty;function Zd(t,e){return wB.call(t,e)}o(Zd,"hasOwnProperty");function Qd(t){if(Array.isArray(t)){for(var e=new Array(t.length),r=0;r<e.length;r++)e[r]=""+r;return e}if(Object.keys)return Object.keys(t);var n=[];for(var i in t)Zd(t,i)&&n.push(i);return n}o(Qd,"_objectKeys");function qr(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}o(qr,"_deepClone");function e0(t){for(var e=0,r=t.length,n;e<r;){if(n=t.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(e0,"isInteger");function vo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(vo,"escapePathComponent");function rl(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(rl,"unescapePathComponent");function Xd(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)if(Xd(t[e]))return!0}else if(typeof t=="object"){for(var n=Qd(t),i=n.length,a=0;a<i;a++)if(Xd(t[n[a]]))return!0}}return!1}o(Xd,"hasUndefined");function A8(t,e){var r=[t];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i<"u"&&r.push(n+": "+i)}return r.join(`
|
|
815
|
-
`)}o(A8,"patchErrorMessageFormatter");var nl=function(t){xB(e,t);function e(r,n,i,a,c){var u=this.constructor,m=t.call(this,A8(r,{name:n,index:i,operation:a,tree:c}))||this;return m.name=n,m.index=i,m.operation=a,m.tree=c,Object.setPrototypeOf(m,u.prototype),m.message=A8(r,{name:n,index:i,operation:a,tree:c}),m}return o(e,"PatchError"),e}(Error);var dr=nl,_B=qr,yc={add:function(t,e,r){return t[e]=this.value,{newDocument:r}},remove:function(t,e,r){var n=t[e];return delete t[e],{newDocument:r,removed:n}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:function(t,e,r){var n=t0(r,this.path);n&&(n=qr(n));var i=Ja(r,{op:"remove",path:this.from}).removed;return Ja(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(t,e,r){var n=t0(r,this.from);return Ja(r,{op:"add",path:this.path,value:qr(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:il(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},EB={add:function(t,e,r){return e0(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:r,index:e}},remove:function(t,e,r){var n=t.splice(e,1);return{newDocument:r,removed:n[0]}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:yc.move,copy:yc.copy,test:yc.test,_get:yc._get};function t0(t,e){if(e=="")return t;var r={op:"_get",path:e};return Ja(t,r),r.value}o(t0,"getValueByPointer");function Ja(t,e,r,n,i,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(e,0,t,e.path):r0(e,0)),e.path===""){var c={newDocument:t};if(e.op==="add")return c.newDocument=e.value,c;if(e.op==="replace")return c.newDocument=e.value,c.removed=t,c;if(e.op==="move"||e.op==="copy")return c.newDocument=t0(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=il(t,e.value),c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c.newDocument=t,c}else{if(e.op==="remove")return c.removed=t,c.newDocument=null,c;if(e.op==="_get")return e.value=t,c;if(r)throw new dr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,e,t);return c}}else{n||(t=qr(t));var u=e.path||"",m=u.split("/"),v=t,x=1,S=m.length,O=void 0,R=void 0,D=void 0;for(typeof r=="function"?D=r:D=r0;;){if(R=m[x],R&&R.indexOf("~")!=-1&&(R=rl(R)),i&&(R=="__proto__"||R=="prototype"&&x>0&&m[x-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(r&&O===void 0&&(v[R]===void 0?O=m.slice(0,x).join("/"):x==S-1&&(O=e.path),O!==void 0&&D(e,0,t,O)),x++,Array.isArray(v)){if(R==="-")R=v.length;else{if(r&&!e0(R))throw new dr("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",a,e,t);e0(R)&&(R=~~R)}if(x>=S){if(r&&e.op==="add"&&R>v.length)throw new dr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,e,t);var c=EB[e.op].call(e,v,R,t);if(c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c}}else if(x>=S){var c=yc[e.op].call(e,v,R,t);if(c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c}if(v=v[R],r&&x<S&&(!v||typeof v!="object"))throw new dr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,e,t)}}}o(Ja,"applyOperation");function n0(t,e,r,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),r&&!Array.isArray(e))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(t=qr(t));for(var a=new Array(e.length),c=0,u=e.length;c<u;c++)a[c]=Ja(t,e[c],r,!0,i,c),t=a[c].newDocument;return a.newDocument=t,a}o(n0,"applyPatch");function AB(t,e,r){var n=Ja(t,e);if(n.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",r,e,t);return n.newDocument}o(AB,"applyReducer");function r0(t,e,r,n){if(typeof t!="object"||t===null||Array.isArray(t))throw new dr("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,r);if(yc[t.op]){if(typeof t.path!="string")throw new dr("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,r);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new dr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,r);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new dr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new dr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Xd(t.value))throw new dr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,r);if(r){if(t.op=="add"){var i=t.path.split("/").length,a=n.split("/").length;if(i!==a+1&&i!==a)throw new dr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,r)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==n)throw new dr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,r)}else if(t.op==="move"||t.op==="copy"){var c={op:"_get",path:t.from,value:void 0},u=S8([c],r);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new dr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,r)}}}else throw new dr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,r)}o(r0,"validator");function S8(t,e,r){try{if(!Array.isArray(t))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)n0(qr(e),qr(t),r||!0);else{r=r||r0;for(var n=0;n<t.length;n++)r(t[n],n,e,void 0)}}catch(i){if(i instanceof dr)return i;throw i}}o(S8,"validate");function il(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var r=Array.isArray(t),n=Array.isArray(e),i,a,c;if(r&&n){if(a=t.length,a!=e.length)return!1;for(i=a;i--!==0;)if(!il(t[i],e[i]))return!1;return!0}if(r!=n)return!1;var u=Object.keys(t);if(a=u.length,a!==Object.keys(e).length)return!1;for(i=a;i--!==0;)if(!e.hasOwnProperty(u[i]))return!1;for(i=a;i--!==0;)if(c=u[i],!il(t[c],e[c]))return!1;return!0}return t!==t&&e!==e}o(il,"_areEquals");var Vb={};Jt(Vb,{compare:()=>OB,generate:()=>Kb,observe:()=>DB,unobserve:()=>IB});var jb=new WeakMap,SB=function(){function t(e){this.observers=new Map,this.obj=e}return o(t,"Mirror"),t}(),MB=function(){function t(e,r){this.callback=e,this.observer=r}return o(t,"ObserverInfo"),t}();function TB(t){return jb.get(t)}o(TB,"getMirror");function CB(t,e){return t.observers.get(e)}o(CB,"getObserverFromMirror");function kB(t,e){t.observers.delete(e.callback)}o(kB,"removeObserverFromMirror");function IB(t,e){e.unobserve()}o(IB,"unobserve");function DB(t,e){var r=[],n,i=TB(t);if(!i)i=new SB(t),jb.set(t,i);else{var a=CB(i,e);n=a&&a.observer}if(n)return n;if(n={},i.value=qr(t),e){n.callback=e,n.next=null;var c=o(function(){Kb(n)},"dirtyCheck"),u=o(function(){clearTimeout(n.next),n.next=setTimeout(c)},"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=r,n.object=t,n.unobserve=function(){Kb(n),clearTimeout(n.next),kB(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 MB(e,n)),n}o(DB,"observe");function Kb(t,e){e===void 0&&(e=!1);var r=jb.get(t.object);Gb(r.value,t.object,t.patches,"",e),t.patches.length&&n0(r.value,t.patches);var n=t.patches;return n.length>0&&(t.patches=[],t.callback&&t.callback(n)),n}o(Kb,"generate");function Gb(t,e,r,n,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var a=Qd(e),c=Qd(t),u=!1,m=!1,v=c.length-1;v>=0;v--){var x=c[v],S=t[x];if(Zd(e,x)&&!(e[x]===void 0&&S!==void 0&&Array.isArray(e)===!1)){var O=e[x];typeof S=="object"&&S!=null&&typeof O=="object"&&O!=null&&Array.isArray(S)===Array.isArray(O)?Gb(S,O,r,n+"/"+vo(x),i):S!==O&&(u=!0,i&&r.push({op:"test",path:n+"/"+vo(x),value:qr(S)}),r.push({op:"replace",path:n+"/"+vo(x),value:qr(O)}))}else Array.isArray(t)===Array.isArray(e)?(i&&r.push({op:"test",path:n+"/"+vo(x),value:qr(S)}),r.push({op:"remove",path:n+"/"+vo(x)}),m=!0):(i&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),u=!0)}if(!(!m&&a.length==c.length))for(var v=0;v<a.length;v++){var x=a[v];!Zd(t,x)&&e[x]!==void 0&&r.push({op:"add",path:n+"/"+vo(x),value:qr(e[x])})}}}o(Gb,"_generate");function OB(t,e,r){r===void 0&&(r=!1);var n=[];return Gb(t,e,n,"",r),n}o(OB,"compare");var i0=Object.assign({},zb,Vb,{JsonPatchError:nl,deepClone:qr,escapePathComponent:vo,unescapePathComponent:rl});var pE=Lt(Ac(),1);var mE=Lt(Oa(),1);var yr;(function(t){t[t.PREFER_CACHE=0]="PREFER_CACHE",t[t.SYNC_ALWAYS=1]="SYNC_ALWAYS",t[t.NEVER_SYNC=2]="NEVER_SYNC"})(yr||(yr={}));var kg=Lt(Ac(),1);Pi();Bf();var d_={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function s$(t){let e=d_[t];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${t}`)}o(s$,"codeByName");function a$(t){let e=Object.entries(d_).find(([,r])=>r===t);if(e)return e[0];throw new Error(`No stream type registered for index ${t}`)}o(a$,"nameByCode");var En=class{};o(En,"StreamType");En.nameByCode=a$;En.codeByName=s$;var mg=Lt(el(),1);function zn(t){let e,r,n;return typeof t=="object"?(e=t.hashFunction,r=t.expiring,n=t.tags):e=t,(i,a,c)=>{if(c.value!=null)c.value=p_(c.value,e,r,n);else if(c.get!=null)c.get=p_(c.get,e,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(zn,"Memoize");var fg=new Map;function p_(t,e,r=0,n){let i=Symbol("__memoized_map__");return function(...a){let c;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 m of n)fg.has(m)?fg.get(m).push(u):fg.set(m,[u]);if(e||a.length>0||r>0){let m;e===!0?m=a.map(S=>S.toString()).join("!"):e?m=e.apply(this,a):m=a[0];let v=`${m}__timestamp`,x=!1;if(r>0)if(!u.has(v))x=!0;else{let S=u.get(v);x=Date.now()-S>r}u.has(m)&&!x?c=u.get(m):(c=t.apply(this,a),u.set(m,c),r>0&&u.set(v,Date.now()))}else{let m=this;u.has(m)?c=u.get(m):(c=t.apply(this,a),u.set(m,c))}return c}}o(p_,"getNewFunction");Pi();Bf();lu();var dg=Lt(el(),1);function Sc(t){try{return t()}catch(e){return e}}o(Sc,"tryCatch");Pi();var cg=Lt(el(),1);Aa();function Qa(t){let e=cg.default.decode(t),r=cg.default.decode.bytes,n=t.subarray(r);return[e,n,r]}o(Qa,"readVarint");function f$(t){return t===0||t===1}o(f$,"isCidVersion");function ug(t){let[e,r]=Qa(t);if(!f$(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=Qa(r),[,a,c]=Qa(i),[u,,m]=Qa(a),v=i.subarray(0,c+m+u),x=i.subarray(c+m+u);return[We.create(e,n,Ch(v)),x]}o(ug,"readCid");Pi();Bf();function ef(t,e="StreamRef"){let[r,n]=Qa(t);if(r!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,a]=Qa(n),c=ug(a),[u,m]=c;if(m.length===0)return{kind:"stream-id",type:i,genesis:u};if(m.length===1&&m[0]===0)return{kind:"commit-id",type:i,genesis:u,commit:null};{let[v]=ug(m);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(ef,"fromBytes");var c$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Mc(t,e="StreamRef"){let r=c$.exec(t)||[],n=r[2];if(!n)throw new Error(`Malformed ${e} string: ${t}`);let i=Ni.decode(n),a=ef(i),c=r[4];return c?{kind:"commit-id",type:a.type,genesis:a.genesis,commit:lg(a.genesis,c)}:a}o(Mc,"fromString");function u$(t){try{return typeof t=="string"?We.parse(t):We.asCID(t)}catch{return null}}o(u$,"parseCID");function lg(t,e=null){if(!e||e==="0")return null;let r=u$(e);if(r)return t.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(lg,"parseCommit");var fl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},d0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ni.encode(e)}: contains commit`)}};o(d0,"InvalidStreamIDBytesError");var p0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(p0,"InvalidStreamIDStringError");function g_(t){let e=ef(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new d0(t)}o(g_,"fromBytes");function l$(t){return Sc(()=>g_(t))}o(l$,"fromBytesNoThrow");function v_(t){let e=Mc(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new p0(t)}o(v_,"fromString");function h$(t){return Sc(()=>v_(t))}o(h$,"fromStringNoThrow");var b_=Symbol.for("@ceramicnetwork/streamid/StreamID"),rt=class{constructor(e,r){if(this._tag=b_,!(e||e===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?En.codeByName(e):e,this._cid=typeof r=="string"?We.parse(r):r}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===b_}static async fromGenesis(e,r){let n=await Ua({value:r,codec:Hi,hasher:Ss});return new rt(e,n.cid)}get type(){return this._type}get typeName(){return En.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=dg.default.encode(206),r=dg.default.encode(this.type);return Oi([e,r,this.cid.bytes])}get baseID(){return new rt(this._type,this._cid)}equals(e){return rt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Ni.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(rt,"StreamID");rt.fromBytes=g_;rt.fromBytesNoThrow=l$;rt.fromString=v_;rt.fromStringNoThrow=h$;fl([zn(),Ei("design:type",String),Ei("design:paramtypes",[])],rt.prototype,"typeName",null);fl([zn(),Ei("design:type",Uint8Array),Ei("design:paramtypes",[])],rt.prototype,"bytes",null);fl([zn(),Ei("design:type",rt),Ei("design:paramtypes",[])],rt.prototype,"baseID",null);fl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toString",null);fl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toUrl",null);var Cc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},An=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},pg=function(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},is=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tc,tf,cl,m0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ni.encode(e)}: no commit information provided`)}};o(m0,"InvalidCommitIDBytesError");var b0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(b0,"InvalidCommitIDStringError");function x_(t){let e=ef(t,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new m0(t)}o(x_,"fromBytes");function d$(t){return Sc(()=>x_(t))}o(d$,"fromBytesNoThrow");function w_(t){let e=Mc(t,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new b0(t)}o(w_,"fromString");function p$(t){return Sc(()=>w_(t))}o(p$,"fromStringNoThrow");var y_=Symbol.for("@ceramicnetwork/streamid/CommitID");function m$(t,e){return new Pt(t.type,t.cid,e)}o(m$,"make");var Pt=class{constructor(e,r,n=null){if(this._tag=y_,Tc.set(this,void 0),tf.set(this,void 0),cl.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");pg(this,Tc,typeof e=="string"?En.codeByName(e):e,"f"),pg(this,tf,typeof r=="string"?We.parse(r):r,"f"),pg(this,cl,lg(is(this,tf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===y_}get baseID(){return new rt(is(this,Tc,"f"),is(this,tf,"f"))}get type(){return is(this,Tc,"f")}get typeName(){return En.nameByCode(is(this,Tc,"f"))}get cid(){return is(this,tf,"f")}get commit(){return is(this,cl,"f")||is(this,tf,"f")}get bytes(){let e=mg.default.encode(206),r=mg.default.encode(this.type),n=is(this,cl,"f")?.bytes||new Uint8Array([0]);return Oi([e,r,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Ni.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Tc=new WeakMap,tf=new WeakMap,cl=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=x_;Pt.fromBytesNoThrow=d$;Pt.fromString=w_;Pt.fromStringNoThrow=p$;Pt.make=m$;Cc([zn(),An("design:type",rt),An("design:paramtypes",[])],Pt.prototype,"baseID",null);Cc([zn(),An("design:type",String),An("design:paramtypes",[])],Pt.prototype,"typeName",null);Cc([zn(),An("design:type",We),An("design:paramtypes",[])],Pt.prototype,"commit",null);Cc([zn(),An("design:type",Uint8Array),An("design:paramtypes",[])],Pt.prototype,"bytes",null);Cc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Pt.prototype,"toString",null);Cc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Pt.prototype,"toUrl",null);Bf();var fn;(function(t){function e(i){let a=ef(i);switch(a.kind){case"commit-id":return new Pt(a.type,a.genesis,a.commit);case"stream-id":return new rt(a.type,a.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Ni.encode(i)}`)}}o(e,"fromBytes"),t.fromBytes=e;function r(i){let a=Mc(i);switch(a.kind){case"commit-id":return new Pt(a.type,a.genesis,a.commit);case"stream-id":return new rt(a.type,a.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(r,"fromString"),t.fromString=r;function n(i){if(rt.isInstance(i)||Pt.isInstance(i))return i;if(i instanceof Uint8Array)return e(i);if(typeof i=="string")return r(i);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(i)}`)}o(n,"from"),t.from=n})(fn||(fn={}));var bg=o(function(t,e){return bg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},bg(t,e)},"extendStatics");function Qr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");bg(t,e);function r(){this.constructor=t}o(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}o(Qr,"__extends");function __(t,e,r,n){function i(a){return a instanceof r?a:new r(function(c){c(a)})}return o(i,"adopt"),new(r||(r=Promise))(function(a,c){function u(x){try{v(n.next(x))}catch(S){c(S)}}o(u,"fulfilled");function m(x){try{v(n.throw(x))}catch(S){c(S)}}o(m,"rejected");function v(x){x.done?a(x.value):i(x.value).then(u,m)}o(v,"step"),v((n=n.apply(t,e||[])).next())})}o(__,"__awaiter");function g0(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(v){return function(x){return m([v,x])}}function m(v){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,v[0]&&(r=0)),r;)try{if(n=1,i&&(a=v[0]&2?i.return:v[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,v[1])).done)return a;switch(i=0,a&&(v=[v[0]&2,a.value]),v[0]){case 0:case 1:a=v;break;case 4:return r.label++,{value:v[1],done:!1};case 5:r.label++,i=v[1],v=[0];continue;case 7:v=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(v[0]===6||v[0]===2)){r=0;continue}if(v[0]===3&&(!a||v[1]>a[0]&&v[1]<a[3])){r.label=v[1];break}if(v[0]===6&&r.label<a[1]){r.label=a[1],a=v;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(v);break}a[2]&&r.ops.pop(),r.trys.pop();continue}v=e.call(t,r)}catch(x){v=[6,x],i=0}finally{n=a=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}o(g0,"__generator");function os(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(os,"__values");function Kn(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return a}o(Kn,"__read");function Vi(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}o(Vi,"__spreadArray");function rf(t){return this instanceof rf?(this.v=t,this):new rf(t)}o(rf,"__await");function E_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(O){n[O]&&(i[O]=function(R){return new Promise(function(D,P){a.push([O,R,D,P])>1||u(O,R)})})}function u(O,R){try{m(n[O](R))}catch(D){S(a[0][3],D)}}function m(O){O.value instanceof rf?Promise.resolve(O.value.v).then(v,x):S(a[0][2],O)}function v(O){u("next",O)}function x(O){u("throw",O)}function S(O,R){O(R),a.shift(),a.length&&u(a[0][0],a[0][1])}}o(E_,"__asyncGenerator");function A_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof os=="function"?os(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(c){return new Promise(function(u,m){c=t[a](c),i(u,m,c.done,c.value)})}}function i(a,c,u,m){Promise.resolve(m).then(function(v){a({value:v,done:u})},c)}}o(A_,"__asyncValues");function At(t){return typeof t=="function"}o(At,"isFunction");function kc(t){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}o(kc,"createErrorClass");var v0=kc(function(t){return o(function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
814
|
+
`)}o($L,"asString");var Xu=class extends Yu{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case Zu.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Xu,"SiweMessage");var Gd=class extends Yu{toMessage(){return super.toMessage("Solana")}signMessage(){let e;switch(this.type){case Zu.PERSONAL_SIGNATURE:{e=new TextEncoder().encode(this.toMessage());break}default:{e=new TextEncoder().encode(this.toMessage());break}}return e}};o(Gd,"SiwsMessage");var FL=5*60,qL=new Date("2022-09-20").valueOf(),Qu;(function(t){function e(c){let u={h:{t:"eip4361"},p:{domain:c.domain,iat:c.issuedAt,iss:`did:pkh:eip155:${c.chainId}:${c.address}`,aud:c.uri,version:c.version,nonce:c.nonce}};return c.signature&&(u.s={t:"eip191",s:c.signature}),c.notBefore&&(u.p.nbf=c.notBefore),c.expirationTime&&(u.p.exp=c.expirationTime),c.statement&&(u.p.statement=c.statement),c.requestId&&(u.p.requestId=c.requestId),c.resources&&(u.p.resources=c.resources),u}o(e,"fromSiweMessage");let r=o(function(c){try{return Promise.resolve(Qx({bytes:c,codec:Hi,hasher:Ms})).then(function(u){return u.value})}catch(u){return Promise.reject(u)}},"fromBlockBytes");t.fromSiweMessage=e;function n(c){let u={h:{t:"caip122"},p:{domain:c.domain,iat:c.issuedAt,iss:`did:pkh:solana:${c.chainId}:${c.address}`,aud:c.uri,version:c.version,nonce:c.nonce}};return c.signature&&(u.s={t:"solana:ed25519",s:c.signature}),c.notBefore&&(u.p.nbf=c.notBefore),c.expirationTime&&(u.p.exp=c.expirationTime),c.statement&&(u.p.statement=c.statement),c.requestId&&(u.p.requestId=c.requestId),c.resources&&(u.p.resources=c.resources),u}o(n,"fromSiwsMessage"),t.fromSiwsMessage=n,t.fromBlockBytes=r;function i(c,u={}){var m,v;if(((m=c.s)==null?void 0:m.t)==="eip191")return a(c,u);if(((v=c.s)==null?void 0:v.t)==="solana:ed25519")return HL(c,u);throw new Error("Unsupported CACAO signature type")}o(i,"verify"),t.verify=i;function a(c,u){if(!c.s)throw new Error("CACAO does not have a signature");let m=u.atTime?u.atTime.getTime():Date.now(),v=(u.clockSkewSecs??FL)*1e3;if(Date.parse(c.p.iat)>m+v||Date.parse(c.p.nbf)>m+v)throw new Error("CACAO is not valid yet");let x=u.revocationPhaseOutSecs?u.revocationPhaseOutSecs*1e3:0;if(!u.disableExpirationCheck&&Date.parse(c.p.exp)+x+v<m)throw new Error("CACAO has expired");let O=[Ob(Xu.fromCacao(c).toMessage(),c.s.s).toLowerCase()];if(Date.parse(c.p.iat)<=qL){let D=Ob(UL(Xu.fromCacao(c),"Ethereum"),c.s.s).toLowerCase();O.push(D)}let R=Ks.parse(c.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!O.includes(R))throw new Error("Signature does not belong to issuer")}o(a,"verifyEIP191Signature"),t.verifyEIP191Signature=a})(Qu||(Qu={}));function HL(t,e){if(!t.s)throw new Error("CACAO does not have a signature");let r=e.atTime?e.atTime.getTime():Date.now();if(Date.parse(t.p.iat)>r||Date.parse(t.p.nbf)>r)throw new Error("CACAO is not valid yet");let n=e.revocationPhaseOutSecs?e.revocationPhaseOutSecs*1e3:0;if(!e.disableExpirationCheck&&Date.parse(t.p.exp)+n<r)throw new Error("CACAO has expired");let i=Gd.fromCacao(t),a=t.s.s,c=i.signMessage(),u=Ot(a,"base58btc"),m=Ks.parse(t.p.iss.replace("did:pkh:","")).address,v=Ot(m,"base58btc");if(!(0,j5.verify)(v,c,u))throw new Error("Signature does not belong to issuer")}o(HL,"verifySolanaSignature");var el;(function(t){function e(r){return Ua({value:r,codec:Hi,hasher:Ms})}o(e,"fromCacao"),t.fromCacao=e})(el||(el={}));qf();mu();var G5=Lt(Oa(),1);qf();function V5(){return kt((0,G5.randomBytes)(16),"base64")}o(V5,"randomString");var W5="base64pad",J5="base64url";function Y5(t){return kt(t,W5)}o(Y5,"encodeBase64");function X5(t){return kt(t,J5)}o(X5,"encodeBase64Url");function Z5(t){return Ot(t,W5)}o(Z5,"decodeBase64");function Vd(t){return JSON.parse(kt(Ot(t,J5)))}o(Vd,"base64urlToJSON");function Q5(t){if(t.signatures.length>1)throw new Error("Cant convert to compact jws");return`${t.signatures[0].protected}.${t.payload}.${t.signatures[0].signature}`}o(Q5,"fromDagJWS");function e8(t,e){if(e){let r=e.toISOString().split(".")[0]+"Z";return`${t}?versionTime=${r}`}else return t}o(e8,"didWithTime");function t8(t){return t?Array.isArray(t)?t:[t]:[]}o(t8,"extractControllers");function zL(t){return"registry"in t&&"cache"in t}o(zL,"isResolver");var Va=class{constructor({provider:e,resolver:r={},resolverOptions:n,capability:i,parent:a}={}){if(e!=null&&(this._client=new uc(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,a&&this._parentId!==a)throw new Error("Capability issuer and parent not equal")}else a&&(this._parentId=a);this.setResolver(r,n)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){return new Va({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new uc(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,r){this._resolver=zL(e)?e:new su(e,r)}async authenticate({provider:e,paths:r=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=V5(),a=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:r}),{kid:c}=await this.verifyJWS(a),u=Vd(a.payload);if(!c.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,r={}){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=await el.fromCacao(this._capability),a=We.asCID(i.cid);if(!a)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");r.protected=r.protected||{},r.protected.cap=`ipfs://${a?.toString()}`}let{jws:n}=await this._client.request("did_createJWS",{did:this._id,...r,payload:e});return n}async createDagJWS(e,r={}){let{cid:n,linkedBlock:i}=await s4(e),a=X5(n.bytes);Object.assign(r,{linkedBlock:Y5(i)});let c=await this.createJWS(a,r),u=We.asCID(n);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(c.link=u,this._capability){let m=await el.fromCacao(this._capability);return{jws:c,linkedBlock:i,cacaoBlock:m.bytes}}return{jws:c,linkedBlock:i}}async verifyJWS(e,r={}){typeof e!="string"&&(e=Q5(e));let n=Vd(e.split(".")[0]).kid;if(!n)throw new Error('No "kid" found in jws');let i=await this.resolve(n);if(!r.disableTimecheck){let v=i.didDocumentMetadata?.nextUpdate;if(v){let S=r.revocationPhaseOutSecs?r.revocationPhaseOutSecs*1e3:0,O=new Date(v).valueOf()+S;if(!(r.atTime&&r.atTime.getTime()<O))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${n}`)}let x=i.didDocumentMetadata?.updated;if(x&&r.atTime&&r.atTime.getTime()<new Date(x).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${n}`)}let c=i.didDocument?.id;if(r.issuer&&r.issuer===r.capability?.p.iss&&c===r.capability.p.aud)Qu.verify(r.capability,{atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs});else if(r.issuer&&r.issuer!==c){let v=e8(r.issuer,r.atTime),S=(await this.resolve(v)).didDocument?.controller,O=t8(S);if(r.capability?.s&&r.capability.p.aud===c&&O.includes(r.capability.p.iss))Qu.verify(r.capability,{atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs});else if(!(c?O.includes(c):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${n}`)}let u=i.didDocument?.verificationMethod||[];Vx(e,u);let m;try{m=Vd(e.split(".")[1])}catch{}return{kid:n,payload:m,didResolutionResult:i}}async createJWE(e,r,n={}){let i=await Yx(r,this._resolver);return Jx(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,r,n={}){let i=await a4(e);return this.createJWE(i,r,n)}async decryptJWE(e,r={}){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,...r,jwe:e});return Z5(n)}async decryptDagJWE(e){let r=await this.decryptJWE(e);return f4(r)}async resolve(e){let r=await this._resolver.resolve(e);if(r.didResolutionMetadata.error){let{error:n,message:i}=r.didResolutionMetadata,a=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${a}`)}return r}};o(Va,"DID");function r8(t){var e=0,r=t.length,n=[];if(r%2)throw new Error("invalid hex:"+t);for(;e<r;e+=2)n.push(parseInt(t.substr(e,2),16));return new Uint8Array(n)}o(r8,"toUint8Array");var Kb=Lt(tl(),1);Sh();var Pb={};Jt(Pb,{keyToDidDoc:()=>nB});function nB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:kt(t,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(nB,"keyToDidDoc");var Lb={};Jt(Lb,{keyToDidDoc:()=>oB});qf();var h8=Lt(Su(),1);function iB(t){let e=new Uint8Array(t.length+2);return e[0]=236,e[1]=1,e.set(t,2),`z${kt(e,"base58btc")}`}o(iB,"encodeKey");function oB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=(0,h8.convertPublicKeyToX25519)(t),a=`${r}#${iB(i)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:kt(t,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:a,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:kt(i,"base58btc")}]}}o(oB,"keyToDidDoc");var qb={};Jt(qb,{keyToDidDoc:()=>mB,pubKeyBytesToXY:()=>m8});var Wd={};Jt(Wd,{ECPointDecompress:()=>hB});function sB(t){return t>=0?t:-t}o(sB,"n");function aB(t,e){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),t<=0n||e<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,n=1n,i=1n,a=0n;for(;t!==0n;){let c=e/t,u=e%t,m=r-i*c,v=n-a*c;e=t,t=u,r=i,n=a,i=m,a=v}return{g:e,x:r,y:n}}o(aB,"r");function Bb(t,e){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),e<=0n)throw new RangeError("n must be > 0");let r=t%e;return r<0n?r+e:r}o(Bb,"f");function fB(t,e){let r=aB(Bb(t,e),e);if(r.g!==1n)throw new RangeError(`${t.toString()} does not have inverse modulo ${e.toString()}`);return Bb(r.x,e)}o(fB,"g");function Wa(t,e,r){if(typeof t=="number"&&(t=BigInt(t)),typeof e=="number"&&(e=BigInt(e)),typeof r=="number"&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(r===1n)return 0n;if(t=Bb(t,r),e<0n)return fB(Wa(t,sB(e),r),r);let n=1n;for(;e>0;)e%2n===1n&&(n=n*t%r),e/=2n,t=t**2n%r;return n}o(Wa,"b");var vr={};Jt(vr,{pubKeyBytesToHex:()=>cB,publicKeyHexToUint8ArrayPointPair:()=>d8,publicKeyIntToUint8ArrayPointPair:()=>p8,publicKeyIntToXY:()=>lB,publicKeyToXY:()=>uB,testHexString:()=>$b,testUint8Array:()=>Ws});Mh();function cB(t){if(!Ws(t))throw new TypeError("input must be a Uint8Array");return kt(t,"base16")}o(cB,"pubKeyBytesToHex");function uB(t){if(!$b(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=d8(t),r=_a.encode(e.xOctet).slice(1),n=_a.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(uB,"publicKeyToXY");function d8(t){if(!$b(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=t.slice(0,t.length/2),r=t.slice(t.length/2,t.length),n=Ot(e,"base16"),i=Ot(r,"base16");return{xOctet:n,yOctet:i}}o(d8,"publicKeyHexToUint8ArrayPointPair");function $b(t){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(t)!==null&&e.test(t)&&typeof t=="string")}o($b,"testHexString");function Ws(t){return t==null?!1:t.constructor===Uint8Array}o(Ws,"testUint8Array");function lB(t){if(t==null)throw new TypeError("input cannot be null or undefined.");if(typeof t!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(t,"x")||!Object.prototype.hasOwnProperty.call(t,"y"))throw new Error("Input must have properties x and y");if(typeof t.x!="bigint"&&typeof t.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=p8(t),r=_a.encode(e.xOctet).slice(1),n=_a.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(lB,"publicKeyIntToXY");function p8(t){if(t==null)throw new TypeError("input cannot be null or undefined.");if(typeof t!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(t,"x")||!Object.prototype.hasOwnProperty.call(t,"y"))throw new Error("Input must have properties x and y");if(typeof t.x!="bigint"&&typeof t.y!="bigint")throw new Error("Input coordinates must be BigInt");let e=t.x.toString(),r=t.y.toString(),n=Ot(e,"base10"),i=Ot(r,"base10");return{xOctet:n,yOctet:i}}o(p8,"publicKeyIntToUint8ArrayPointPair");function hB(t){if(!Ws(t))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),r=e**256n-e**224n+e**192n+e**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),m=u**3n-u*3n+n,v=Wa(m,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(hB,"ECPointDecompress");var Jd={};Jt(Jd,{ECPointDecompress:()=>dB});function dB(t){if(!Ws(t))throw new TypeError("input must be a Uint8Array");let e=BigInt(2),r=e**384n-e**128n-e**96n+e**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),m=u**3n-u*3n+n,v=Wa(m,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(dB,"ECPointDecompress");var Yd={};Jt(Yd,{ECPointDecompress:()=>pB});function pB(t){if(!Ws(t))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,i=(r+1n)/4n,a=BigInt(t[0]-2),c=t.subarray(1),u=BigInt(kt(c,"base10")),m=u**3n-u*3n+n,v=Wa(m,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(pB,"ECPointDecompress");function mB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=m8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(mB,"keyToDidDoc");function m8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t),r=e.length/2;if(r==64)return vr.publicKeyToXY(e);if(r==65&&e.slice(0,2)=="04"){let n=e.slice(2);return vr.publicKeyToXY(n)}if(r==33&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ot(e,"base16"),i=Wd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(m8,"pubKeyBytesToXY");var Hb={};Jt(Hb,{keyToDidDoc:()=>bB,pubKeyBytesToXY:()=>b8});function bB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=b8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(bB,"keyToDidDoc");function b8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t),r=e.length/2;if(r==96)return vr.publicKeyToXY(e);if(r==97&&e.slice(0,2)=="04"){let n=e.slice(2);return vr.publicKeyToXY(n)}if(r==49&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let n=Ot(e,"base16"),i=Jd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(b8,"pubKeyBytesToXY");var zb={};Jt(zb,{keyToDidDoc:()=>gB,pubKeyBytesToXY:()=>g8});function gB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=g8(t);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(gB,"keyToDidDoc");function g8(t){if(!vr.testUint8Array(t))throw new TypeError("input must be a Uint8Array");let e=vr.pubKeyBytesToHex(t);if(132<=e.length&&e.length<=134&&(e.slice(0,2)=="03"||e.slice(0,2)=="02")){let r=Ot(e,"base16"),n=Yd.ECPointDecompress(r);return vr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(g8,"pubKeyBytesToXY");var vB="application/did+ld+json",v8="application/did+json",yB={231:Pb,237:Lb,4608:qb,4609:Hb,4610:zb};function xB(){return{key:async(t,e,r,n)=>{let i=n.accept||v8,a={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let c=ui.decode(e.id),u=Kb.default.decode(c),m=c.slice(Kb.default.decode.bytes),v=await yB[u].keyToDidDoc(m,e.id);i===vB?(v["@context"]="https://w3id.org/did/v1",a.didDocument=v):i===v8?a.didDocument=v:(delete a.didResolutionMetadata.contentType,a.didResolutionMetadata.error="representationNotSupported")}catch(c){a.didResolutionMetadata.error="invalidDid",a.didResolutionMetadata.message=c.toString()}return a}}}o(xB,"getResolver");var y8={getResolver:xB};var Xd=Lt(Su(),1);var S8=Lt(w8(),1);var wB="base64pad";function _8(t){return JSON.parse((0,S8.default)(t))}o(_8,"toStableObject");function _B(t){let e=new Uint8Array(t.length+2);return e[0]=237,e[1]=1,e.set(t,2),`did:key:z${kt(e,"base58btc")}`}o(_B,"encodeDID");function E8(t){let[e,r,n]=t.split(".");return{payload:r,signatures:[{protected:e,signature:n}]}}o(E8,"toGeneralJWS");var A8=o(async(t,e,r,n={})=>{let i=`${e}#${e.split(":")[2]}`,a=Hx(r),c=_8(Object.assign(n,{kid:i,alg:"EdDSA"}));return Gx(typeof t=="string"?t:_8(t),a,c)},"sign"),EB={did_authenticate:async({did:t,secretKey:e},r)=>{let n=await A8({did:t,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},t,e);return E8(n)},did_createJWS:async({did:t,secretKey:e},r)=>{if(r.did.split("#")[0]!==t)throw new wn(4100,`Unknown DID: ${t}`);let i=await A8(r.payload,t,e,r.protected);return{jws:E8(i)}},did_decryptJWE:async({secretKey:t},e)=>{let r=Zx((0,Xd.convertSecretKeyToX25519)(t));try{let n=await Wx(e.jwe,r);return{cleartext:kt(n,wB)}}catch(n){throw new wn(-32e3,n.message)}}},rl=class{constructor(e){let{secretKey:r,publicKey:n}=(0,Xd.generateKeyPairFromSeed)(e),i=_B(n),a=m4(EB);this._handle=async c=>await a({did:i,secretKey:r},c)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(rl,"Ed25519Provider");var jb={};Jt(jb,{JsonPatchError:()=>dr,_areEquals:()=>ol,applyOperation:()=>Ja,applyPatch:()=>i0,applyReducer:()=>CB,deepClone:()=>MB,getValueByPointer:()=>r0,validate:()=>T8,validator:()=>n0});var AB=function(){var t=o(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}o(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),SB=Object.prototype.hasOwnProperty;function Qd(t,e){return SB.call(t,e)}o(Qd,"hasOwnProperty");function e0(t){if(Array.isArray(t)){for(var e=new Array(t.length),r=0;r<e.length;r++)e[r]=""+r;return e}if(Object.keys)return Object.keys(t);var n=[];for(var i in t)Qd(t,i)&&n.push(i);return n}o(e0,"_objectKeys");function qr(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}o(qr,"_deepClone");function t0(t){for(var e=0,r=t.length,n;e<r;){if(n=t.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(t0,"isInteger");function vo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(vo,"escapePathComponent");function nl(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(nl,"unescapePathComponent");function Zd(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)if(Zd(t[e]))return!0}else if(typeof t=="object"){for(var n=e0(t),i=n.length,a=0;a<i;a++)if(Zd(t[n[a]]))return!0}}return!1}o(Zd,"hasUndefined");function M8(t,e){var r=[t];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i<"u"&&r.push(n+": "+i)}return r.join(`
|
|
815
|
+
`)}o(M8,"patchErrorMessageFormatter");var il=function(t){AB(e,t);function e(r,n,i,a,c){var u=this.constructor,m=t.call(this,M8(r,{name:n,index:i,operation:a,tree:c}))||this;return m.name=n,m.index=i,m.operation=a,m.tree=c,Object.setPrototypeOf(m,u.prototype),m.message=M8(r,{name:n,index:i,operation:a,tree:c}),m}return o(e,"PatchError"),e}(Error);var dr=il,MB=qr,xc={add:function(t,e,r){return t[e]=this.value,{newDocument:r}},remove:function(t,e,r){var n=t[e];return delete t[e],{newDocument:r,removed:n}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:function(t,e,r){var n=r0(r,this.path);n&&(n=qr(n));var i=Ja(r,{op:"remove",path:this.from}).removed;return Ja(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(t,e,r){var n=r0(r,this.from);return Ja(r,{op:"add",path:this.path,value:qr(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:ol(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},TB={add:function(t,e,r){return t0(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:r,index:e}},remove:function(t,e,r){var n=t.splice(e,1);return{newDocument:r,removed:n[0]}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:xc.move,copy:xc.copy,test:xc.test,_get:xc._get};function r0(t,e){if(e=="")return t;var r={op:"_get",path:e};return Ja(t,r),r.value}o(r0,"getValueByPointer");function Ja(t,e,r,n,i,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(e,0,t,e.path):n0(e,0)),e.path===""){var c={newDocument:t};if(e.op==="add")return c.newDocument=e.value,c;if(e.op==="replace")return c.newDocument=e.value,c.removed=t,c;if(e.op==="move"||e.op==="copy")return c.newDocument=r0(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=ol(t,e.value),c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c.newDocument=t,c}else{if(e.op==="remove")return c.removed=t,c.newDocument=null,c;if(e.op==="_get")return e.value=t,c;if(r)throw new dr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,e,t);return c}}else{n||(t=qr(t));var u=e.path||"",m=u.split("/"),v=t,x=1,S=m.length,O=void 0,R=void 0,D=void 0;for(typeof r=="function"?D=r:D=n0;;){if(R=m[x],R&&R.indexOf("~")!=-1&&(R=nl(R)),i&&(R=="__proto__"||R=="prototype"&&x>0&&m[x-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(r&&O===void 0&&(v[R]===void 0?O=m.slice(0,x).join("/"):x==S-1&&(O=e.path),O!==void 0&&D(e,0,t,O)),x++,Array.isArray(v)){if(R==="-")R=v.length;else{if(r&&!t0(R))throw new dr("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",a,e,t);t0(R)&&(R=~~R)}if(x>=S){if(r&&e.op==="add"&&R>v.length)throw new dr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,e,t);var c=TB[e.op].call(e,v,R,t);if(c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c}}else if(x>=S){var c=xc[e.op].call(e,v,R,t);if(c.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c}if(v=v[R],r&&x<S&&(!v||typeof v!="object"))throw new dr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,e,t)}}}o(Ja,"applyOperation");function i0(t,e,r,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),r&&!Array.isArray(e))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(t=qr(t));for(var a=new Array(e.length),c=0,u=e.length;c<u;c++)a[c]=Ja(t,e[c],r,!0,i,c),t=a[c].newDocument;return a.newDocument=t,a}o(i0,"applyPatch");function CB(t,e,r){var n=Ja(t,e);if(n.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",r,e,t);return n.newDocument}o(CB,"applyReducer");function n0(t,e,r,n){if(typeof t!="object"||t===null||Array.isArray(t))throw new dr("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,r);if(xc[t.op]){if(typeof t.path!="string")throw new dr("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,r);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new dr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,r);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new dr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new dr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Zd(t.value))throw new dr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,r);if(r){if(t.op=="add"){var i=t.path.split("/").length,a=n.split("/").length;if(i!==a+1&&i!==a)throw new dr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,r)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==n)throw new dr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,r)}else if(t.op==="move"||t.op==="copy"){var c={op:"_get",path:t.from,value:void 0},u=T8([c],r);if(u&&u.name==="OPERATION_PATH_UNRESOLVABLE")throw new dr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,r)}}}else throw new dr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,r)}o(n0,"validator");function T8(t,e,r){try{if(!Array.isArray(t))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)i0(qr(e),qr(t),r||!0);else{r=r||n0;for(var n=0;n<t.length;n++)r(t[n],n,e,void 0)}}catch(i){if(i instanceof dr)return i;throw i}}o(T8,"validate");function ol(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var r=Array.isArray(t),n=Array.isArray(e),i,a,c;if(r&&n){if(a=t.length,a!=e.length)return!1;for(i=a;i--!==0;)if(!ol(t[i],e[i]))return!1;return!0}if(r!=n)return!1;var u=Object.keys(t);if(a=u.length,a!==Object.keys(e).length)return!1;for(i=a;i--!==0;)if(!e.hasOwnProperty(u[i]))return!1;for(i=a;i--!==0;)if(c=u[i],!ol(t[c],e[c]))return!1;return!0}return t!==t&&e!==e}o(ol,"_areEquals");var Jb={};Jt(Jb,{compare:()=>LB,generate:()=>Gb,observe:()=>PB,unobserve:()=>NB});var Vb=new WeakMap,kB=function(){function t(e){this.observers=new Map,this.obj=e}return o(t,"Mirror"),t}(),IB=function(){function t(e,r){this.callback=e,this.observer=r}return o(t,"ObserverInfo"),t}();function DB(t){return Vb.get(t)}o(DB,"getMirror");function OB(t,e){return t.observers.get(e)}o(OB,"getObserverFromMirror");function RB(t,e){t.observers.delete(e.callback)}o(RB,"removeObserverFromMirror");function NB(t,e){e.unobserve()}o(NB,"unobserve");function PB(t,e){var r=[],n,i=DB(t);if(!i)i=new kB(t),Vb.set(t,i);else{var a=OB(i,e);n=a&&a.observer}if(n)return n;if(n={},i.value=qr(t),e){n.callback=e,n.next=null;var c=o(function(){Gb(n)},"dirtyCheck"),u=o(function(){clearTimeout(n.next),n.next=setTimeout(c)},"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=r,n.object=t,n.unobserve=function(){Gb(n),clearTimeout(n.next),RB(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 IB(e,n)),n}o(PB,"observe");function Gb(t,e){e===void 0&&(e=!1);var r=Vb.get(t.object);Wb(r.value,t.object,t.patches,"",e),t.patches.length&&i0(r.value,t.patches);var n=t.patches;return n.length>0&&(t.patches=[],t.callback&&t.callback(n)),n}o(Gb,"generate");function Wb(t,e,r,n,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var a=e0(e),c=e0(t),u=!1,m=!1,v=c.length-1;v>=0;v--){var x=c[v],S=t[x];if(Qd(e,x)&&!(e[x]===void 0&&S!==void 0&&Array.isArray(e)===!1)){var O=e[x];typeof S=="object"&&S!=null&&typeof O=="object"&&O!=null&&Array.isArray(S)===Array.isArray(O)?Wb(S,O,r,n+"/"+vo(x),i):S!==O&&(u=!0,i&&r.push({op:"test",path:n+"/"+vo(x),value:qr(S)}),r.push({op:"replace",path:n+"/"+vo(x),value:qr(O)}))}else Array.isArray(t)===Array.isArray(e)?(i&&r.push({op:"test",path:n+"/"+vo(x),value:qr(S)}),r.push({op:"remove",path:n+"/"+vo(x)}),m=!0):(i&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),u=!0)}if(!(!m&&a.length==c.length))for(var v=0;v<a.length;v++){var x=a[v];!Qd(t,x)&&e[x]!==void 0&&r.push({op:"add",path:n+"/"+vo(x),value:qr(e[x])})}}}o(Wb,"_generate");function LB(t,e,r){r===void 0&&(r=!1);var n=[];return Wb(t,e,n,"",r),n}o(LB,"compare");var o0=Object.assign({},jb,Jb,{JsonPatchError:il,deepClone:qr,escapePathComponent:vo,unescapePathComponent:nl});var bE=Lt(Sc(),1);var gE=Lt(Oa(),1);var yr;(function(t){t[t.PREFER_CACHE=0]="PREFER_CACHE",t[t.SYNC_ALWAYS=1]="SYNC_ALWAYS",t[t.NEVER_SYNC=2]="NEVER_SYNC"})(yr||(yr={}));var Dg=Lt(Sc(),1);Pi();Uf();var m_={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function u$(t){let e=m_[t];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${t}`)}o(u$,"codeByName");function l$(t){let e=Object.entries(m_).find(([,r])=>r===t);if(e)return e[0];throw new Error(`No stream type registered for index ${t}`)}o(l$,"nameByCode");var En=class{};o(En,"StreamType");En.nameByCode=l$;En.codeByName=u$;var gg=Lt(tl(),1);function zn(t){let e,r,n;return typeof t=="object"?(e=t.hashFunction,r=t.expiring,n=t.tags):e=t,(i,a,c)=>{if(c.value!=null)c.value=b_(c.value,e,r,n);else if(c.get!=null)c.get=b_(c.get,e,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(zn,"Memoize");var ug=new Map;function b_(t,e,r=0,n){let i=Symbol("__memoized_map__");return function(...a){let c;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 m of n)ug.has(m)?ug.get(m).push(u):ug.set(m,[u]);if(e||a.length>0||r>0){let m;e===!0?m=a.map(S=>S.toString()).join("!"):e?m=e.apply(this,a):m=a[0];let v=`${m}__timestamp`,x=!1;if(r>0)if(!u.has(v))x=!0;else{let S=u.get(v);x=Date.now()-S>r}u.has(m)&&!x?c=u.get(m):(c=t.apply(this,a),u.set(m,c),r>0&&u.set(v,Date.now()))}else{let m=this;u.has(m)?c=u.get(m):(c=t.apply(this,a),u.set(m,c))}return c}}o(b_,"getNewFunction");Pi();Uf();hu();var mg=Lt(tl(),1);function Mc(t){try{return t()}catch(e){return e}}o(Mc,"tryCatch");Pi();var lg=Lt(tl(),1);Aa();function Qa(t){let e=lg.default.decode(t),r=lg.default.decode.bytes,n=t.subarray(r);return[e,n,r]}o(Qa,"readVarint");function h$(t){return t===0||t===1}o(h$,"isCidVersion");function hg(t){let[e,r]=Qa(t);if(!h$(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=Qa(r),[,a,c]=Qa(i),[u,,m]=Qa(a),v=i.subarray(0,c+m+u),x=i.subarray(c+m+u);return[We.create(e,n,kh(v)),x]}o(hg,"readCid");Pi();Uf();function ef(t,e="StreamRef"){let[r,n]=Qa(t);if(r!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,a]=Qa(n),c=hg(a),[u,m]=c;if(m.length===0)return{kind:"stream-id",type:i,genesis:u};if(m.length===1&&m[0]===0)return{kind:"commit-id",type:i,genesis:u,commit:null};{let[v]=hg(m);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(ef,"fromBytes");var d$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Tc(t,e="StreamRef"){let r=d$.exec(t)||[],n=r[2];if(!n)throw new Error(`Malformed ${e} string: ${t}`);let i=Ni.decode(n),a=ef(i),c=r[4];return c?{kind:"commit-id",type:a.type,genesis:a.genesis,commit:dg(a.genesis,c)}:a}o(Tc,"fromString");function p$(t){try{return typeof t=="string"?We.parse(t):We.asCID(t)}catch{return null}}o(p$,"parseCID");function dg(t,e=null){if(!e||e==="0")return null;let r=p$(e);if(r)return t.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(dg,"parseCommit");var cl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},p0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ni.encode(e)}: contains commit`)}};o(p0,"InvalidStreamIDBytesError");var m0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(m0,"InvalidStreamIDStringError");function y_(t){let e=ef(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new p0(t)}o(y_,"fromBytes");function m$(t){return Mc(()=>y_(t))}o(m$,"fromBytesNoThrow");function x_(t){let e=Tc(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new m0(t)}o(x_,"fromString");function b$(t){return Mc(()=>x_(t))}o(b$,"fromStringNoThrow");var v_=Symbol.for("@ceramicnetwork/streamid/StreamID"),rt=class{constructor(e,r){if(this._tag=v_,!(e||e===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?En.codeByName(e):e,this._cid=typeof r=="string"?We.parse(r):r}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===v_}static async fromGenesis(e,r){let n=await Ua({value:r,codec:Hi,hasher:Ms});return new rt(e,n.cid)}get type(){return this._type}get typeName(){return En.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=mg.default.encode(206),r=mg.default.encode(this.type);return Oi([e,r,this.cid.bytes])}get baseID(){return new rt(this._type,this._cid)}equals(e){return rt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Ni.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(rt,"StreamID");rt.fromBytes=y_;rt.fromBytesNoThrow=m$;rt.fromString=x_;rt.fromStringNoThrow=b$;cl([zn(),Ei("design:type",String),Ei("design:paramtypes",[])],rt.prototype,"typeName",null);cl([zn(),Ei("design:type",Uint8Array),Ei("design:paramtypes",[])],rt.prototype,"bytes",null);cl([zn(),Ei("design:type",rt),Ei("design:paramtypes",[])],rt.prototype,"baseID",null);cl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toString",null);cl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toUrl",null);var kc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},An=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bg=function(t,e,r,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"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},os=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Cc,tf,ul,b0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ni.encode(e)}: no commit information provided`)}};o(b0,"InvalidCommitIDBytesError");var g0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(g0,"InvalidCommitIDStringError");function __(t){let e=ef(t,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new b0(t)}o(__,"fromBytes");function g$(t){return Mc(()=>__(t))}o(g$,"fromBytesNoThrow");function E_(t){let e=Tc(t,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new g0(t)}o(E_,"fromString");function v$(t){return Mc(()=>E_(t))}o(v$,"fromStringNoThrow");var w_=Symbol.for("@ceramicnetwork/streamid/CommitID");function y$(t,e){return new Pt(t.type,t.cid,e)}o(y$,"make");var Pt=class{constructor(e,r,n=null){if(this._tag=w_,Cc.set(this,void 0),tf.set(this,void 0),ul.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");bg(this,Cc,typeof e=="string"?En.codeByName(e):e,"f"),bg(this,tf,typeof r=="string"?We.parse(r):r,"f"),bg(this,ul,dg(os(this,tf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===w_}get baseID(){return new rt(os(this,Cc,"f"),os(this,tf,"f"))}get type(){return os(this,Cc,"f")}get typeName(){return En.nameByCode(os(this,Cc,"f"))}get cid(){return os(this,tf,"f")}get commit(){return os(this,ul,"f")||os(this,tf,"f")}get bytes(){let e=gg.default.encode(206),r=gg.default.encode(this.type),n=os(this,ul,"f")?.bytes||new Uint8Array([0]);return Oi([e,r,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Ni.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Cc=new WeakMap,tf=new WeakMap,ul=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=__;Pt.fromBytesNoThrow=g$;Pt.fromString=E_;Pt.fromStringNoThrow=v$;Pt.make=y$;kc([zn(),An("design:type",rt),An("design:paramtypes",[])],Pt.prototype,"baseID",null);kc([zn(),An("design:type",String),An("design:paramtypes",[])],Pt.prototype,"typeName",null);kc([zn(),An("design:type",We),An("design:paramtypes",[])],Pt.prototype,"commit",null);kc([zn(),An("design:type",Uint8Array),An("design:paramtypes",[])],Pt.prototype,"bytes",null);kc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Pt.prototype,"toString",null);kc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Pt.prototype,"toUrl",null);Uf();var fn;(function(t){function e(i){let a=ef(i);switch(a.kind){case"commit-id":return new Pt(a.type,a.genesis,a.commit);case"stream-id":return new rt(a.type,a.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Ni.encode(i)}`)}}o(e,"fromBytes"),t.fromBytes=e;function r(i){let a=Tc(i);switch(a.kind){case"commit-id":return new Pt(a.type,a.genesis,a.commit);case"stream-id":return new rt(a.type,a.genesis);default:throw new Error(`Malformed StreamRef string: ${i}`)}}o(r,"fromString"),t.fromString=r;function n(i){if(rt.isInstance(i)||Pt.isInstance(i))return i;if(i instanceof Uint8Array)return e(i);if(typeof i=="string")return r(i);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(i)}`)}o(n,"from"),t.from=n})(fn||(fn={}));var vg=o(function(t,e){return vg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},vg(t,e)},"extendStatics");function Qr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vg(t,e);function r(){this.constructor=t}o(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}o(Qr,"__extends");function A_(t,e,r,n){function i(a){return a instanceof r?a:new r(function(c){c(a)})}return o(i,"adopt"),new(r||(r=Promise))(function(a,c){function u(x){try{v(n.next(x))}catch(S){c(S)}}o(u,"fulfilled");function m(x){try{v(n.throw(x))}catch(S){c(S)}}o(m,"rejected");function v(x){x.done?a(x.value):i(x.value).then(u,m)}o(v,"step"),v((n=n.apply(t,e||[])).next())})}o(A_,"__awaiter");function v0(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(v){return function(x){return m([v,x])}}function m(v){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,v[0]&&(r=0)),r;)try{if(n=1,i&&(a=v[0]&2?i.return:v[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,v[1])).done)return a;switch(i=0,a&&(v=[v[0]&2,a.value]),v[0]){case 0:case 1:a=v;break;case 4:return r.label++,{value:v[1],done:!1};case 5:r.label++,i=v[1],v=[0];continue;case 7:v=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(v[0]===6||v[0]===2)){r=0;continue}if(v[0]===3&&(!a||v[1]>a[0]&&v[1]<a[3])){r.label=v[1];break}if(v[0]===6&&r.label<a[1]){r.label=a[1],a=v;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(v);break}a[2]&&r.ops.pop(),r.trys.pop();continue}v=e.call(t,r)}catch(x){v=[6,x],i=0}finally{n=a=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}o(v0,"__generator");function ss(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}o(ss,"__values");function Kn(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],c;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return a}o(Kn,"__read");function Vi(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}o(Vi,"__spreadArray");function rf(t){return this instanceof rf?(this.v=t,this):new rf(t)}o(rf,"__await");function S_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(O){n[O]&&(i[O]=function(R){return new Promise(function(D,P){a.push([O,R,D,P])>1||u(O,R)})})}function u(O,R){try{m(n[O](R))}catch(D){S(a[0][3],D)}}function m(O){O.value instanceof rf?Promise.resolve(O.value.v).then(v,x):S(a[0][2],O)}function v(O){u("next",O)}function x(O){u("throw",O)}function S(O,R){O(R),a.shift(),a.length&&u(a[0][0],a[0][1])}}o(S_,"__asyncGenerator");function M_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ss=="function"?ss(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(c){return new Promise(function(u,m){c=t[a](c),i(u,m,c.done,c.value)})}}function i(a,c,u,m){Promise.resolve(m).then(function(v){a({value:v,done:u})},c)}}o(M_,"__asyncValues");function At(t){return typeof t=="function"}o(At,"isFunction");function Ic(t){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}o(Ic,"createErrorClass");var y0=Ic(function(t){return o(function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
816
816
|
`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
817
|
-
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function nf(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}o(nf,"arrRemove");var Js=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(t,"Subscription"),t.prototype.unsubscribe=function(){var e,r,n,i,a;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var u=os(c),m=u.next();!m.done;m=u.next()){var v=m.value;v.remove(this)}}catch(P){e={error:P}}finally{try{m&&!m.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}else c.remove(this);var x=this.initialTeardown;if(At(x))try{x()}catch(P){a=P instanceof v0?P.errors:[P]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var O=os(S),R=O.next();!R.done;R=O.next()){var D=R.value;try{S_(D)}catch(P){a=a??[],P instanceof v0?a=Vi(Vi([],Kn(a)),Kn(P.errors)):a.push(P)}}}catch(P){n={error:P}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(a)throw new v0(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)S_(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&nf(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&nf(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();var gg=Js.EMPTY;function y0(t){return t instanceof Js||t&&"closed"in t&&At(t.remove)&&At(t.add)&&At(t.unsubscribe)}o(y0,"isSubscription");function S_(t){At(t)?t():t.unsubscribe()}o(S_,"execFinalizer");var Wi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Ic={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ic.delegate;return i?.setTimeout?i.setTimeout.apply(i,Vi([t,e],Kn(r))):setTimeout.apply(void 0,Vi([t,e],Kn(r)))},clearTimeout:function(t){var e=Ic.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function x0(t){Ic.setTimeout(function(){var e=Wi.onUnhandledError;if(e)e(t);else throw t})}o(x0,"reportUnhandledError");function vg(){}o(vg,"noop");var M_=function(){return yg("C",void 0,void 0)}();function T_(t){return yg("E",void 0,t)}o(T_,"errorNotification");function C_(t){return yg("N",t,void 0)}o(C_,"nextNotification");function yg(t,e,r){return{kind:t,value:e,error:r}}o(yg,"createNotification");var of=null;function Dc(t){if(Wi.useDeprecatedSynchronousErrorHandling){var e=!of;if(e&&(of={errorThrown:!1,error:null}),t(),e){var r=of,n=r.errorThrown,i=r.error;if(of=null,n)throw i}}else t()}o(Dc,"errorContext");function k_(t){Wi.useDeprecatedSynchronousErrorHandling&&of&&(of.errorThrown=!0,of.error=t)}o(k_,"captureError");var ul=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,y0(r)&&r.add(n)):n.destination=y$,n}return o(e,"Subscriber"),e.create=function(r,n,i){return new _0(r,n,i)},e.prototype.next=function(r){this.isStopped?wg(C_(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?wg(T_(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?wg(M_,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Js);var b$=Function.prototype.bind;function xg(t,e){return b$.call(t,e)}o(xg,"bind");var g$=function(){function t(e){this.partialObserver=e}return o(t,"ConsumerObserver"),t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){w0(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){w0(n)}else w0(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){w0(r)}},t}(),_0=function(t){Qr(e,t);function e(r,n,i){var a=t.call(this)||this,c;if(At(r)||!r)c={next:r??void 0,error:n??void 0,complete:i??void 0};else{var u;a&&Wi.useDeprecatedNextContext?(u=Object.create(r),u.unsubscribe=function(){return a.unsubscribe()},c={next:r.next&&xg(r.next,u),error:r.error&&xg(r.error,u),complete:r.complete&&xg(r.complete,u)}):c=r}return a.destination=new g$(c),a}return o(e,"SafeSubscriber"),e}(ul);function w0(t){Wi.useDeprecatedSynchronousErrorHandling?k_(t):x0(t)}o(w0,"handleUnhandledError");function v$(t){throw t}o(v$,"defaultErrorHandler");function wg(t,e){var r=Wi.onStoppedNotification;r&&Ic.setTimeout(function(){return r(t,e)})}o(wg,"handleStoppedNotification");var y$={closed:!0,next:vg,error:v$,complete:vg};var Oc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Rc(t){return t}o(Rc,"identity");function I_(t){return t.length===0?Rc:t.length===1?t[0]:o(function(r){return t.reduce(function(n,i){return i(n)},r)},"piped")}o(I_,"pipeFromArray");var Wt=function(){function t(e){e&&(this._subscribe=e)}return o(t,"Observable"),t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,a=w$(e)?e:new _0(e,r,n);return Dc(function(){var c=i,u=c.operator,m=c.source;a.add(u?u.call(a,m):m?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=D_(r),new r(function(i,a){var c=new _0({next:function(u){try{e(u)}catch(m){a(m),c.unsubscribe()}},error:a,complete:i});n.subscribe(c)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Oc]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return I_(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=D_(e),new e(function(n,i){var a;r.subscribe(function(c){return a=c},function(c){return i(c)},function(){return n(a)})})},t.create=function(e){return new t(e)},t}();function D_(t){var e;return(e=t??Wi.Promise)!==null&&e!==void 0?e:Promise}o(D_,"getPromiseCtor");function x$(t){return t&&At(t.next)&&At(t.error)&&At(t.complete)}o(x$,"isObserver");function w$(t){return t&&t instanceof ul||x$(t)&&y0(t)}o(w$,"isSubscriber");function _$(t){return At(t?.lift)}o(_$,"hasLift");function Dr(t){return function(e){if(_$(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Dr,"operate");function Or(t,e,r,n,i){return new E$(t,e,r,n,i)}o(Or,"createOperatorSubscriber");var E$=function(t){Qr(e,t);function e(r,n,i,a,c,u){var m=t.call(this,r)||this;return m.onFinalize=c,m.shouldUnsubscribe=u,m._next=n?function(v){try{n(v)}catch(x){r.error(x)}}:t.prototype._next,m._error=a?function(v){try{a(v)}catch(x){r.error(x)}finally{this.unsubscribe()}}:t.prototype._error,m._complete=i?function(){try{i()}catch(v){r.error(v)}finally{this.unsubscribe()}}:t.prototype._complete,m}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(ul);var O_=kc(function(t){return o(function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var _g=function(t){Qr(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return o(e,"Subject"),e.prototype.lift=function(r){var n=new R_(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new O_},e.prototype.next=function(r){var n=this;Dc(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=os(n.currentObservers),u=c.next();!u.done;u=c.next()){var m=u.value;m.next(r)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;Dc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;Dc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.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 r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,c=i.isStopped,u=i.observers;return a||c?gg:(this.currentObservers=null,u.push(r),new Js(function(){n.currentObservers=null,nf(u,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,c=n.isStopped;i?r.error(a):c&&r.complete()},e.prototype.asObservable=function(){var r=new Wt;return r.source=this,r},e.create=function(r,n){return new R_(r,n)},e}(Wt);var R_=function(t){Qr(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:gg},e}(_g);var Eg=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(_g);var Ag={now:function(){return(Ag.delegate||Date).now()},delegate:void 0};var N_=function(t){Qr(e,t);function e(r,n){return t.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},e}(Js);var ll={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ll.delegate;return i?.setInterval?i.setInterval.apply(i,Vi([t,e],Kn(r))):setInterval.apply(void 0,Vi([t,e],Kn(r)))},clearInterval:function(t){var e=ll.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var P_=function(t){Qr(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var a=this.id,c=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(c,a,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(c,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),ll.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&ll.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,a;try{this.work(r)}catch(c){i=!0,a=c||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nf(a,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(N_);var Sg=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return o(t,"Scheduler"),t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Ag.now,t}();var L_=function(t){Qr(e,t);function e(r,n){n===void 0&&(n=Sg.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Sg);var A$=new L_(P_),B_=A$;var E0=new Wt(function(t){return t.complete()});function A0(t){return t&&At(t.schedule)}o(A0,"isScheduler");function U_(t){return t[t.length-1]}o(U_,"last");function $_(t){return A0(U_(t))?t.pop():void 0}o($_,"popScheduler");function F_(t,e){return typeof U_(t)=="number"?t.pop():e}o(F_,"popNumber");var Nc=o(function(t){return t&&typeof t.length=="number"&&typeof t!="function"},"isArrayLike");function S0(t){return At(t?.then)}o(S0,"isPromise");function M0(t){return At(t[Oc])}o(M0,"isInteropObservable");function T0(t){return Symbol.asyncIterator&&At(t?.[Symbol.asyncIterator])}o(T0,"isAsyncIterable");function C0(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(C0,"createInvalidObservableTypeError");function S$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(S$,"getSymbolIterator");var k0=S$();function I0(t){return At(t?.[k0])}o(I0,"isIterable");function D0(t){return E_(this,arguments,o(function(){var r,n,i,a;return g0(this,function(c){switch(c.label){case 0:r=t.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,rf(r.read())];case 3:return n=c.sent(),i=n.value,a=n.done,a?[4,rf(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,rf(i)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(D0,"readableStreamLikeToAsyncGenerator");function O0(t){return At(t?.getReader)}o(O0,"isReadableStreamLike");function en(t){if(t instanceof Wt)return t;if(t!=null){if(M0(t))return M$(t);if(Nc(t))return T$(t);if(S0(t))return C$(t);if(T0(t))return q_(t);if(I0(t))return k$(t);if(O0(t))return I$(t)}throw C0(t)}o(en,"innerFrom");function M$(t){return new Wt(function(e){var r=t[Oc]();if(At(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(M$,"fromInteropObservable");function T$(t){return new Wt(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}o(T$,"fromArrayLike");function C$(t){return new Wt(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,x0)})}o(C$,"fromPromise");function k$(t){return new Wt(function(e){var r,n;try{for(var i=os(t),a=i.next();!a.done;a=i.next()){var c=a.value;if(e.next(c),e.closed)return}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}o(k$,"fromIterable");function q_(t){return new Wt(function(e){D$(t,e).catch(function(r){return e.error(r)})})}o(q_,"fromAsyncIterable");function I$(t){return q_(D0(t))}o(I$,"fromReadableStreamLike");function D$(t,e){var r,n,i,a;return __(this,void 0,void 0,function(){var c,u;return g0(this,function(m){switch(m.label){case 0:m.trys.push([0,5,6,11]),r=A_(t),m.label=1;case 1:return[4,r.next()];case 2:if(n=m.sent(),!!n.done)return[3,4];if(c=n.value,e.next(c),e.closed)return[2];m.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=m.sent(),i={error:u},[3,11];case 6:return m.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:m.sent(),m.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(D$,"process");function Ai(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var a=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(a),!i)return a}o(Ai,"executeSchedule");function R0(t,e){return e===void 0&&(e=0),Dr(function(r,n){r.subscribe(Or(n,function(i){return Ai(n,t,function(){return n.next(i)},e)},function(){return Ai(n,t,function(){return n.complete()},e)},function(i){return Ai(n,t,function(){return n.error(i)},e)}))})}o(R0,"observeOn");function N0(t,e){return e===void 0&&(e=0),Dr(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}o(N0,"subscribeOn");function H_(t,e){return en(t).pipe(N0(e),R0(e))}o(H_,"scheduleObservable");function z_(t,e){return en(t).pipe(N0(e),R0(e))}o(z_,"schedulePromise");function K_(t,e){return new Wt(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}o(K_,"scheduleArray");function j_(t,e){return new Wt(function(r){var n;return Ai(r,e,function(){n=t[k0](),Ai(r,e,function(){var i,a,c;try{i=n.next(),a=i.value,c=i.done}catch(u){r.error(u);return}c?r.complete():r.next(a)},0,!0)}),function(){return At(n?.return)&&n.return()}})}o(j_,"scheduleIterable");function P0(t,e){if(!t)throw new Error("Iterable cannot be null");return new Wt(function(r){Ai(r,e,function(){var n=t[Symbol.asyncIterator]();Ai(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}o(P0,"scheduleAsyncIterable");function G_(t,e){return P0(D0(t),e)}o(G_,"scheduleReadableStreamLike");function V_(t,e){if(t!=null){if(M0(t))return H_(t,e);if(Nc(t))return K_(t,e);if(S0(t))return z_(t,e);if(T0(t))return P0(t,e);if(I0(t))return j_(t,e);if(O0(t))return G_(t,e)}throw C0(t)}o(V_,"scheduled");function W_(t,e){return e?V_(t,e):en(t)}o(W_,"from");var L0=kc(function(t){return o(function(){t(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function J_(t){return t instanceof Date&&!isNaN(t)}o(J_,"isValidDate");function B0(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){n.next(t.call(e,a,i++))}))})}o(B0,"map");var O$=Array.isArray;function R$(t,e){return O$(e)?t.apply(void 0,Vi([],Kn(e))):t(e)}o(R$,"callOrApply");function Y_(t){return B0(function(e){return R$(t,e)})}o(Y_,"mapOneOrManyArgs");function X_(t,e,r,n,i,a,c,u){var m=[],v=0,x=0,S=!1,O=o(function(){S&&!m.length&&!v&&e.complete()},"checkComplete"),R=o(function(P){return v<n?D(P):m.push(P)},"outerNext"),D=o(function(P){a&&e.next(P),v++;var J=!1;en(r(P,x++)).subscribe(Or(e,function(L){i?.(L),a?R(L):e.next(L)},function(){J=!0},void 0,function(){if(J)try{v--;for(var L=o(function(){var W=m.shift();c?Ai(e,c,function(){return D(W)}):D(W)},"_loop_1");m.length&&v<n;)L();O()}catch(W){e.error(W)}}))},"doInnerSub");return t.subscribe(Or(e,R,function(){S=!0,O()})),function(){u?.()}}o(X_,"mergeInternals");function hl(t,e,r){return r===void 0&&(r=1/0),At(e)?hl(function(n,i){return B0(function(a,c){return e(n,a,i,c)})(en(t(n,i)))},r):(typeof e=="number"&&(r=e),Dr(function(n,i){return X_(n,i,t,r)}))}o(hl,"mergeMap");function Z_(t){return t===void 0&&(t=1/0),hl(Rc,t)}o(Z_,"mergeAll");var N$=["addListener","removeListener"],P$=["addEventListener","removeEventListener"],L$=["on","off"];function dl(t,e,r,n){if(At(r)&&(n=r,r=void 0),n)return dl(t,e,r).pipe(Y_(n));var i=Kn($$(t)?P$.map(function(u){return function(m){return t[u](e,m,r)}}):B$(t)?N$.map(Q_(t,e)):U$(t)?L$.map(Q_(t,e)):[],2),a=i[0],c=i[1];if(!a&&Nc(t))return hl(function(u){return dl(u,e,r)})(en(t));if(!a)throw new TypeError("Invalid event target");return new Wt(function(u){var m=o(function(){for(var v=[],x=0;x<arguments.length;x++)v[x]=arguments[x];return u.next(1<v.length?v:v[0])},"handler");return a(m),function(){return c(m)}})}o(dl,"fromEvent");function Q_(t,e){return function(r){return function(n){return t[r](e,n)}}}o(Q_,"toCommonHandlerRegistry");function B$(t){return At(t.addListener)&&At(t.removeListener)}o(B$,"isNodeStyleEventEmitter");function U$(t){return At(t.on)&&At(t.off)}o(U$,"isJQueryStyleEventEmitter");function $$(t){return At(t.addEventListener)&&At(t.removeEventListener)}o($$,"isEventTarget");function pl(t,e,r){t===void 0&&(t=0),r===void 0&&(r=B_);var n=-1;return e!=null&&(A0(e)?r=e:n=e),new Wt(function(i){var a=J_(t)?+t-r.now():t;a<0&&(a=0);var c=0;return r.schedule(function(){i.closed||(i.next(c++),0<=n?this.schedule(void 0,n):i.complete())},a)})}o(pl,"timer");function Mg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=$_(t),n=F_(t,1/0),i=t;return i.length?i.length===1?en(i[0]):Z_(n)(W_(i,r)):E0}o(Mg,"merge");function eE(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){return t.call(e,a,i++)&&n.next(a)}))})}o(eE,"filter");function tE(t){return Dr(function(e,r){var n=!1;e.subscribe(Or(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}o(tE,"defaultIfEmpty");function rE(t){return t<=0?function(){return E0}:Dr(function(e,r){var n=0;e.subscribe(Or(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}o(rE,"take");function nE(t){return t===void 0&&(t=F$),Dr(function(e,r){var n=!1;e.subscribe(Or(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}o(nE,"throwIfEmpty");function F$(){return new L0}o(F$,"defaultErrorFactory");function Tg(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?eE(function(i,a){return t(i,a,n)}):Rc,rE(1),r?tE(e):nE(function(){return new L0}))}}o(Tg,"first");function Cg(t,e){return Dr(function(r,n){var i=e??{},a=i.leading,c=a===void 0?!0:a,u=i.trailing,m=u===void 0?!1:u,v=!1,x=null,S=null,O=!1,R=o(function(){S?.unsubscribe(),S=null,m&&(J(),O&&n.complete())},"endThrottling"),D=o(function(){S=null,O&&n.complete()},"cleanupThrottling"),P=o(function(L){return S=en(t(L)).subscribe(Or(n,R,D))},"startThrottle"),J=o(function(){if(v){v=!1;var L=x;x=null,n.next(L),!O&&P(L)}},"send");r.subscribe(Or(n,function(L){v=!0,x=L,!(S&&!S.closed)&&(c?J():P(L))},function(){O=!0,!(m&&v&&S&&!S.closed)&&n.complete()}))})}o(Cg,"throttle");var iE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(iE||(iE={}));var ml;(function(t){t[t.NOT_REQUESTED=0]="NOT_REQUESTED",t[t.PENDING=1]="PENDING",t[t.PROCESSING=2]="PROCESSING",t[t.ANCHORED=3]="ANCHORED",t[t.FAILED=4]="FAILED"})(ml||(ml={}));var Ig;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(Ig||(Ig={}));var ss=class extends Wt{constructor(e,r){super(n=>{e.subscribe(n)}),this.state$=e,this._context=r}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:r}=this.state$.value;return(0,kg.default)(e?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Ig.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,kg.default)(this.state$.value)}async sync(e={}){e={sync:yr.PREFER_CACHE,...e};let r=await this.api.loadStream(this.id,e);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(ss,"Stream");function Pc(){return t=>{}}o(Pc,"StreamStatic");var uE=Lt(aE(),1);function fE(t){let e=new AbortController;if(t.length===0)throw Error("Need abort signals to create a merged abort signal");return t.some(r=>r.aborted)?(e.abort(),e.signal):(Mg(...t.map(r=>dl(r,"abort"))).pipe(Tg()).subscribe(()=>{e.abort()}),e.signal)}o(fE,"mergeAbortSignals");var bl=class{constructor(e){let r=new AbortController;if(this.signal=r.signal,e<=0){r.abort();return}this._subscription=pl(e).subscribe(()=>{r.abort()})}clear(){this._subscription?.unsubscribe()}};o(bl,"TimedAbortSignal");async function cE(t,e){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return t.addEventListener("abort",n),t.aborted&&r.abort(),e(r.signal).finally(()=>{t.removeEventListener("abort",n)})}o(cE,"abortable");var q$=60*1e3*3;async function Hr(t,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let r=e.timeout||q$,n=new bl(r),i=e.signal?fE([e.signal,n.signal]):n.signal,a=await cE(i,c=>(0,uE.default)(String(t),{...e,signal:c})).finally(()=>n.clear());if(!a.ok){let c=await a.text();throw new Error(`HTTP request to '${t}' failed with status '${a.statusText}': ${c}`)}return a.json()}o(Hr,"fetchJson");var gl=Lt(Ac(),1);Pi();function fs(t){let e=We.asCID(t);if(e)return e;if(typeof t=="string")return We.parse(t);if(t instanceof Uint8Array)return We.decode(t);throw new Error(`${t} cannot be converted to a CID`)}o(fs,"toCID");var lE=0,Xt=class{static streamIdFromState(e){return new rt(e.type,e.log[0].cid)}static serializeCommit(e){let r=(0,gl.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=r.jws.link.toString(),r.linkedBlock=kt(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=kt(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(e)&&(r.link=r.link.toString()),Xt.isAnchorCommit(e)&&(r.proof=r.proof.toString()),r.id&&(r.id=r.id.toString()),r.prev&&(r.prev=r.prev.toString()),e.header?.model&&(r.header.model=kt(e.header.model,"base64")),r)}static deserializeCommit(e){let r=(0,gl.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=fs(r.jws.link),r.linkedBlock=Ot(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=Ot(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(r)&&(r.link=fs(r.link)),Xt.isAnchorCommit(r)&&(r.proof=fs(r.proof)),r.id&&(r.id=fs(r.id)),r.prev&&(r.prev=fs(r.prev)),r.header?.model&&(r.header.model=Ot(r.header.model,"base64")),r)}static serializeState(e){let r=(0,gl.default)(e);return r.log=r.log.map(n=>({...n,cid:n.cid.toString()})),r.anchorStatus!=null&&(r.anchorStatus=ml[r.anchorStatus]),r.anchorProof!=null&&(r.anchorProof.txHash=r.anchorProof.txHash.toString(),r.anchorProof.root=r.anchorProof.root.toString()),e.metadata?.model&&(r.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(r.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=lE&&(r.metadata.unique=kt(r.metadata.unique,"base64")),r.doctype=En.nameByCode(r.type),r}static deserializeState(e){if(!e)return null;let r=(0,gl.default)(e);return r.doctype&&(r.type=En.codeByName(r.doctype),delete r.doctype),r.log=r.log.map(n=>({...n,cid:fs(n.cid)})),r.anchorProof&&(r.anchorProof.txHash=fs(r.anchorProof.txHash),r.anchorProof.root=fs(r.anchorProof.root)),r.anchorStatus&&(r.anchorStatus=ml[r.anchorStatus]),e.metadata?.model&&(r.metadata.model=rt.fromString(e.metadata.model)),e.next?.metadata?.model&&(r.next.metadata.model=rt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=lE&&(r.metadata.unique=Ot(e.metadata.unique,"base64")),r}static statesEqual(e,r){return JSON.stringify(Xt.serializeState(e))===JSON.stringify(Xt.serializeState(r))}static isStateSupersetOf(e,r){if(e.log.length<r.log.length)return!1;for(let n in r.log)if(!e.log[n].cid.equals(r.log[n].cid))return!1;return!(e.log.length===r.log.length&&e.anchorStatus!=r.anchorStatus)}static assertCommitLinksToState(e,r){let n=this.streamIdFromState(e);if(r.id&&!r.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${r.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!r.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${r.prev}`)}static async convertCommitToSignedCommitContainer(e,r){if(Xt.isSignedCommit(e)){let n=await r.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(Xt,"StreamUtils");var vl=class extends Eg{next(e){let r=this.value;Xt.statesEqual(r,e)||super.next(e)}};o(vl,"StreamStateSubject");var H$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},jn,Dg={anchor:!0,publish:!0,pin:!0,sync:yr.PREFER_CACHE},z$={sync:yr.PREFER_CACHE},hE={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Og(t,e){if(typeof t?.schema=="string")try{Pt.fromString(t.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:t?.controllers,family:t?.family,schema:t?.schema?.toString(),tags:t?.tags};if(e)t?.deterministic||(r.unique=kt((0,mE.randomBytes)(12),"base64")),t?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(t?.deterministic!==void 0||t?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(t?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}o(Og,"headerFromMetadata");async function dE(t){if(!t.did)throw new Error("No DID provided");return t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`)),t.did}o(dE,"getAuthenticatedDID");async function Rg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Rg,"throwReadOnlyError");var Gn=jn=o(class extends ss{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,pE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(e,r,n,i={}){i={...Dg,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let a=i.asDID?{did:i.asDID}:e,c=await jn.makeGenesis(a,r,n);return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,c,i)}static async createFromGenesis(e,r,n={}){n={...Dg,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=r.data?await jn._signDagJWS(e,r):r;return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,i,n)}static async deterministic(e,r,n={}){if(n={...Dg,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let i=await jn.makeGenesis(e,null,r);return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,i,n)}static async load(e,r,n={}){n={...z$,...n};let i=fn.from(r);if(i.type!=jn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${jn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,r,n={}){n={...hE,...n};let i=n.asDID?{did:n.asDID}:this.api,a=await this.makeCommit(i,e,r),c=await this.api.applyCommit(this.id,a,n);this.state$.next(c.state)}async patch(e,r={}){r={...hE,...r};let i={header:Og(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=await jn._signDagJWS(this.api,i),c=await this.api.applyCommit(this.id,a,r);this.state$.next(c.state)}makeReadOnly(){this.update=Rg,this.patch=Rg,this.sync=Rg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,r,n){let i=await this._makeRawCommit(r,n);return jn._signDagJWS(e,i)}async _makeRawCommit(e,r){r||(r={});let n=Og(r,!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=i0.compare(this.content,e),a=this.state.log[0];return{header:n,data:i,prev:this.tip,id:a.cid}}static async makeGenesis(e,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let c=await dE(e);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=Og(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:i};return qa(c),c}let a={data:r,header:i};return jn._signDagJWS(e,a)}static async _signDagJWS(e,r){return(await dE(e)).createDagJWS(r)}},"TileDocument");Gn.STREAM_TYPE_NAME="tile";Gn.STREAM_TYPE_ID=0;Gn=jn=H$([Pc()],Gn);var _E=Lt(vE(),1);function Q$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(Q$,"_checkPrivateRedeclaration");function eF(t,e){return e.get?e.get.call(t):e.value}o(eF,"_classApplyDescriptorGet");function tF(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}o(tF,"_classApplyDescriptorSet");function wE(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(wE,"_classExtractFieldDescriptor");function Bg(t,e){var r=wE(t,e,"get");return eF(t,r)}o(Bg,"_classPrivateFieldGet");function yE(t,e,r){Q$(t,e),e.set(t,r)}o(yE,"_classPrivateFieldInit");function xE(t,e,r){var n=wE(t,e,"set");return tF(t,n,r),r}o(xE,"_classPrivateFieldSet");function rF(t){return typeof t=="string"||Pt.isInstance(t)||rt.isInstance(t)?{streamId:t}:{streamId:t.streamId,genesis:t.genesis}}o(rF,"keyToQuery");function Ug(t){return typeof t=="string"?fn.from(t).toString():Pt.isInstance(t)||rt.isInstance(t)?t.toString():t.streamId.toString()}o(Ug,"keyToString");async function nF(t){let e=await Gn.makeGenesis({},null,{...t,deterministic:!0}),r=await rt.fromGenesis("tile",e);return{genesis:e,streamId:r}}o(nF,"getDeterministicQuery");var iF=o(()=>Promise.resolve([]),"tempBatchLoadFn"),$0=new WeakMap,$g=new WeakMap,yl=class extends _E.default{cache(e){if(!Bg(this,$g))return!1;let r=e.id.toString();return this.clear(r).prime(r,e),!0}async create(e,r,n){let i=await Gn.create(Bg(this,$0),e,r,n);return this.cache(i),i}async deterministic(e,r){let n=await nF(e);try{return await super.load(n)}catch{let a=await Gn.createFromGenesis(Bg(this,$0),n.genesis,r);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,r,n,i){let a=Ug(e);this.clear(a);let c=await this.load({streamId:a});return await c.update(r,n,i),c}constructor(e){super(iF,{cache:!0,cacheKeyFn:Ug,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),yE(this,$0,{writable:!0,value:void 0}),yE(this,$g,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(r.map(rF),e.multiqueryTimeout);return r.map(i=>{let a=Ug(i),c=n[a];return c||new Error(`Failed to load stream: ${a}`)})},xE(this,$0,e.ceramic),xE(this,$g,!!e.cache)}};o(yl,"TileLoader");function Fg(t){return typeof t=="string"?rt.fromString(t):t}o(Fg,"typeStreamID");function EE(t,e){let r=new URL(t);for(let[n,i]of Object.entries(e))rt.isInstance(i)?r.searchParams.set(n,i.toString()):typeof i=="object"?r.searchParams.set(n,JSON.stringify(i)):r.searchParams.set(n,i);return r}o(EE,"serializeObjectToSearchParams");function qg(t){let e={};for(let[r,n]of Object.entries(t))rt.isInstance(n)?e[r]=n.toString():e[r]=n;return e}o(qg,"serializeObjectForHttpPost");var tn=class extends Wt{constructor(e,r,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=pl(0,n).pipe(Cg(()=>this._syncState(this.id,{sync:yr.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new vl(e),this._apiUrl=new URL(r)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,r){let n=await tn._load(e,this._apiUrl,r);this.state$.next(Xt.deserializeState(n))}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,r,n,i,a){let c=new URL("./streams",e),{state:u}=await Hr(c,{method:"post",body:{type:r,genesis:Xt.serializeCommit(n),opts:i}});return new tn(Xt.deserializeState(u),e,a)}static async applyCommit(e,r,n,i,a){let c=new URL("./commits",e),{state:u}=await Hr(c,{method:"post",body:{streamId:r.toString(),commit:Xt.serializeCommit(n),opts:i}});return new tn(Xt.deserializeState(u),e,a)}static async _load(e,r,n){let i=EE(new URL(`./streams/${e}`,r),n),{state:a}=await Hr(i);return a}static async load(e,r,n,i){let a=await tn._load(e,r,i);return new tn(Xt.deserializeState(a),r,n)}static async loadStreamCommits(e,r){let n=new URL(`./commits/${e}`,r),{commits:i}=await Hr(n);return i.map(a=>({cid:a.cid,value:Xt.deserializeCommit(a.value)}))}complete(){this.state$.complete()}};o(tn,"Document");var sf;(function(t){t[t.PREFER_CACHE=0]="PREFER_CACHE",t[t.SYNC_ALWAYS=1]="SYNC_ALWAYS",t[t.NEVER_SYNC=2]="NEVER_SYNC",t[t.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(sf||(sf={}));var Hg=Lt(Ac(),1);var AE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(AE||(AE={}));var zg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(zg||(zg={}));var xl=class extends Wt{constructor(e,r){super(n=>{e.subscribe(n)}),this.state$=e,this._context=r}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:r}=this.state$.value;return(0,Hg.default)(e?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===zg.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,Hg.default)(this.state$.value)}async sync(e={}){e={sync:sf.PREFER_CACHE,...e};let r=await this.api.loadStream(this.id,e);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(xl,"Stream");function SE(){return t=>{}}o(SE,"StreamStatic");function ME(t){if(typeof t=="string"&&t.includes("@")){let[e,r]=t.split("@");if(!e||!r)throw new Error("Invalid accountId provided");return new zs({address:e,chainId:r})}return new zs(t)}o(ME,"normalizeAccountId");var oF="(?:%[0-9a-fA-F]{2})",TE=`(?:[a-zA-Z0-9._-]|${oF})`,sF="([a-z0-9]+)",aF=`((?:${TE}*:)*(${TE}+))`,CE="[a-zA-Z0-9_.:%-]",fF=`;${CE}+=${CE}*`,cF=`((${fF})*)`,uF="(/[^#?]*)?",lF="([?][^#]*)?",hF="(#.*)?",dF=new RegExp(`^did:${sF}:${aF}${cF}${uF}${lF}${hF}$`);function kE(t){if(t===""||!t)return null;let e=t.match(dF);if(e){let r={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:t};if(e[4]){let n=e[4].slice(1).split(";");r.params={};for(let i of n){let a=i.split("=");r.params[a[0]]=a[1]}}return e[6]&&(r.path=e[6]),e[7]&&(r.query=e[7].slice(1)),e[8]&&(r.fragment=e[8].slice(1)),r}return null}o(kE,"parse");var DE=Lt(Ac(),1),pF=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},af,Kg=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),IE={anchor:!1,publish:!0,sync:sf.PREFER_CACHE},jg={anchor:!0,publish:!0},mF={sync:sf.PREFER_CACHE},ff=af=o(class extends xl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,DE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(e,r,n={}){n={...IE,...n};let i=ME(r),a=af.makeGenesis(i);return af.fromGenesis(e,a,n)}static async fromGenesis(e,r,n={}){return n={...IE,...n},e.createStreamFromGenesis(af.STREAM_TYPE_ID,r,n)}async setDid(e,r,n={}){n={...jg,...n};let i=typeof e=="string"?e.trim():e.id;if(kE(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let c=await r.createLink(i);return this.setDidProof(c,n)}async setDidProof(e,r={}){r={...jg,...r};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,r);this.state$.next(i.state)}async clearDid(e,r={}){r={...jg,...r};let n=await e.createLink("");return this.setDidProof(n,r)}static async load(e,r,n={}){n={...mF,...n};let i=fn.from(r);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=Kg,this.setDid=Kg,this.sync=Kg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");ff.STREAM_TYPE_NAME="caip10-link";ff.STREAM_TYPE_ID=1;ff=af=pF([SE()],ff);Pi();Aa();var d9=Lt(l9(),1),fq=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},yo,cq={sync:yr.PREFER_CACHE};async function h9(t){if(t.did==null)throw new Error("No DID provided");t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`))}o(h9,"_ensureAuthenticated");async function uq(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(uq,"throwReadOnlyError");var Ys=yo=o(class extends ss{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:yo.MODEL}}static async create(e,r,n){yo.assertComplete(r);let i={publish:!0,anchor:!0,pin:!0,sync:yr.NEVER_SYNC,throwOnInvalidCommit:!0},a=await yo._makeGenesis(e,r,n);return await e.createStreamFromGenesis(yo.STREAM_TYPE_ID,a,i)}static assertComplete(e,r){if(!e.name)throw r?new Error(`Model with StreamID ${r.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw r?new Error(`Model ${e.name} (${r.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw r?new Error(`Model ${e.name} (${r.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static async load(e,r,n={}){n={...cq,...n};let i=fn.from(r);if(i.type!=yo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${yo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,r,n){let i=await this._makeRawGenesis(e,r,n);return yo._signDagJWS(e,i)}static async _makeRawGenesis(e,r,n){if(r==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await h9(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:yo.MODEL.bytes};return{data:r,header:i}}makeReadOnly(){this.sync=uq,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,r){return await h9(e),e.did.createDagJWS(r)}},"Model");Ys.STREAM_TYPE_NAME="model";Ys.STREAM_TYPE_ID=2;Ys.MODEL=function(){let t=qa("model-v1"),e=d9.default.encode(t,"identity"),r=qo(fc,e),n=We.createV1(fc,r);return new rt("UNLOADABLE",n)}();Ys=yo=fq([Pc()],Ys);var b9=Lt(Oa(),1);var lq=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ji,hq={anchor:!0,publish:!0,pin:!0,sync:yr.NEVER_SYNC,syncTimeoutSeconds:0},dq={anchor:!1,publish:!1,pin:!0,sync:yr.PREFER_CACHE},pq={sync:yr.PREFER_CACHE},p9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function m9(t){if(t.did==null)throw new Error("No DID provided");t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`))}o(m9,"_ensureAuthenticated");async function Wg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Wg,"throwReadOnlyError");var uf=Ji=o(class extends ss{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,r,n,i={}){i={...hq,...i};let a=i.asDID?{did:i.asDID}:e,c=await Ji._makeGenesis(a,r,n);return e.createStreamFromGenesis(Ji.STREAM_TYPE_ID,c,i)}static async single(e,r,n={}){n={...dq,...n};let i=n.asDID?{did:n.asDID}:e;r={...r,deterministic:!0};let a=await Ji._makeGenesis(i,null,r);return e.createStreamFromGenesis(Ji.STREAM_TYPE_ID,a,n)}static async load(e,r,n={}){n={...pq,...n};let i=fn.from(r);if(i.type!=Ji.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ji.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,r={}){r={...p9,...r};let n=r.asDID?{did:r.asDID}:this.api,i=await this._makeCommit(n,e),a=await this.api.applyCommit(this.id,i,r);this.state$.next(a.state)}async patch(e,r={}){r={...p9,...r};let n={data:e,prev:this.tip,id:this.id.cid},i=await Ji._signDagJWS(this.api,n),a=await this.api.applyCommit(this.id,i,r);this.state$.next(a.state)}makeReadOnly(){this.replace=Wg,this.patch=Wg,this.sync=Wg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,r){let n=this._makeRawCommit(r);return Ji._signDagJWS(e,n)}_makeRawCommit(e){return{data:i0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,r,n){let i=await this._makeRawGenesis(e,r,n);return n.deterministic?(qa(i),i):Ji._signDagJWS(e,i)}static async _makeRawGenesis(e,r,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 m9(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let a={controllers:[i],model:n.model.bytes};return n.deterministic||(a.unique=(0,b9.randomBytes)(12)),{data:r,header:a}}static async _signDagJWS(e,r){return await m9(e),e.did.createDagJWS(r)}},"ModelInstanceDocument");uf.STREAM_TYPE_NAME="MID";uf.STREAM_TYPE_ID=3;uf=Ji=lq([Pc()],uf);var El=class{constructor(e){this._apiUrl=e}async add(e,r){let n={};r&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await Hr(i,{method:"post",body:n})}async rm(e,r){let n=new URL(`./pins/${e}`,this._apiUrl);await Hr(n,{method:"delete",body:{opts:r}})}async ls(e){let r=new URL("./pins",this._apiUrl);e&&(r=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await Hr(r),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[a++],done:!1})}}}}}};o(El,"RemotePinApi");var Al=class{constructor(e){this._fetchJson=Hr,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:qg(e)})).count}async query(e){let r=await this._fetchJson(this._collectionURL,{method:"POST",body:qg(e)});return{edges:r.edges.map(i=>({cursor:i.cursor,node:Xt.deserializeState(i.node)})),pageInfo:r.pageInfo}}};o(Al,"RemoteIndexApi");var Sl=class{constructor(e,r){this._apiUrl=e,this._getDidFn=r,this._fetchJson=Hr,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,r,n){let i=n?{models:n.map(c=>c.toString())}:void 0,a=await e.createJWS({code:r,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${a.signatures[0].protected}.${a.payload}.${a.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let r=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),r,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=>rt.fromString(n))}async stopIndexingModels(e){let r=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),r,e)}})}};o(Sl,"RemoteAdminApi");var mq="/api/v0/",bq="http://localhost:7007",gq={syncInterval:5e3},vq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},yq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},g9={sync:yr.PREFER_CACHE},Ml=class{constructor(e=bq,r={}){this._config={...gq,...r},this._apiUrl=new URL(mq,e),this._streamCache=new Map,this.context={api:this},this.pin=new El(this._apiUrl),this.index=new Al(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Sl(this._apiUrl,n),this._streamConstructors={[ff.STREAM_TYPE_ID]:ff,[Ys.STREAM_TYPE_ID]:Ys,[uf.STREAM_TYPE_ID]:uf,[Gn.STREAM_TYPE_ID]:Gn}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,r,n={}){n={...yq,...n};let i=await tn.createFromGenesis(this._apiUrl,e,r,n,this._config.syncInterval),a=this._streamCache.get(i.id.toString());return a?(Xt.statesEqual(i.state,a.state)||a.next(i.state),this.buildStreamFromDocument(a)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,r={}){r={...g9,...r};let n=fn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,r):(i=await tn.load(n,this._apiUrl,this._config.syncInterval,r),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,r){let n=e.map(c=>({...c,streamId:typeof c.streamId=="string"?c.streamId:c.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),a=await Hr(i,{method:"post",body:{queries:n,timeout:r}});return Object.entries(a).reduce((c,u)=>{let[m,v]=u,x=Xt.deserializeState(v),S=new tn(x,this._apiUrl,this._config.syncInterval);return c[m]=this.buildStreamFromDocument(S),c},{})}loadStreamCommits(e){let r=Fg(e);return tn.loadStreamCommits(r,this._apiUrl)}async applyCommit(e,r,n={}){n={...vq,...n};let i=Fg(e),a=await tn.applyCommit(this._apiUrl,i,r,n,this._config.syncInterval),c=this._streamCache.get(i.toString());return c?(c.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(i.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,r={}){r={...g9,...r};let{anchorStatus:n}=await Hr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:r}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let r=new tn(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(r)}buildStreamFromDocument(e){let r=e.state.type,n=this._streamConstructors[r];if(!n)throw new Error(`Failed to find constructor for stream ${r}`);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 Hr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Ml,"CeramicClient");var Ut;(function(t){t.assertEqual=i=>i;function e(i){}o(e,"assertIs"),t.assertIs=e;function r(i){throw new Error}o(r,"assertNever"),t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let c of i)a[c]=c;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),c={};for(let u of a)c[u]=i[u];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&a.push(c);return a},t.find=(i,a)=>{for(let c of i)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}o(n,"joinValues"),t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ut||(Ut={}));var Fe=Ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xs=o(t=>{switch(typeof t){case"undefined":return Fe.undefined;case"string":return Fe.string;case"number":return isNaN(t)?Fe.nan:Fe.number;case"boolean":return Fe.boolean;case"function":return Fe.function;case"bigint":return Fe.bigint;case"symbol":return Fe.symbol;case"object":return Array.isArray(t)?Fe.array:t===null?Fe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Fe.promise:typeof Map<"u"&&t instanceof Map?Fe.map:typeof Set<"u"&&t instanceof Set?Fe.set:typeof Date<"u"&&t instanceof Date?Fe.date:Fe.object;default:return Fe.unknown}},"getParsedType"),Ne=Ut.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"]),xq=o(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Si=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 r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=o(a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let u=n,m=0;for(;m<c.path.length;){let v=c.path[m];m===c.path.length-1?(u[v]=u[v]||{_errors:[]},u[v]._errors.push(r(c))):u[v]=u[v]||{_errors:[]},u=u[v],m++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ut.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(Si,"ZodError");Si.create=t=>new Si(t);var Cl=o((t,e)=>{let r;switch(t.code){case Ne.invalid_type:t.received===Fe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ne.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ut.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ut.joinValues(t.keys,", ")}`;break;case Ne.invalid_union:r="Invalid input";break;case Ne.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ut.joinValues(t.options)}`;break;case Ne.invalid_enum_value:r=`Invalid enum value. Expected ${Ut.joinValues(t.options)}, received '${t.received}'`;break;case Ne.invalid_arguments:r="Invalid function arguments";break;case Ne.invalid_return_type:r="Invalid function return type";break;case Ne.invalid_date:r="Invalid date";break;case Ne.invalid_string:typeof t.validation=="object"?"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ut.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ne.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(t.minimum)}`:r="Invalid input";break;case Ne.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(t.maximum)}`:r="Invalid input";break;case Ne.custom:r="Invalid input";break;case Ne.invalid_intersection_types:r="Intersection results could not be merged";break;case Ne.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ne.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ut.assertNever(t)}return{message:r}},"errorMap"),w9=Cl;function wq(t){w9=t}o(wq,"setErrorMap");function j0(){return w9}o(j0,"getErrorMap");var G0=o(t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],c={...i,path:a},u="",m=n.filter(v=>!!v).slice().reverse();for(let v of m)u=v(c,{data:e,defaultError:u}).message;return{...i,path:a,message:i.message||u}},"makeIssue"),_q=[];function Ke(t,e){let r=G0({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j0(),Cl].filter(n=>!!n)});t.common.issues.push(r)}o(Ke,"addIssueToContext");var Rr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){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,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Rr.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:c}=i;if(a.status==="aborted"||c.status==="aborted")return gt;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),(typeof c.value<"u"||i.alwaysSet)&&(n[a.value]=c.value)}return{status:e.value,value:n}}};o(Rr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),_9=o(t=>({status:"dirty",value:t}),"DIRTY"),rn=o(t=>({status:"valid",value:t}),"OK"),Jg=o(t=>t.status==="aborted","isAborted"),Yg=o(t=>t.status==="dirty","isDirty"),V0=o(t=>t.status==="valid","isValid"),W0=o(t=>typeof Promise!==void 0&&t instanceof Promise,"isAsync"),Rt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Rt||(Rt={}));var Vn=class{constructor(e,r,n,i){this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(Vn,"ParseInputLazyPath");var v9=o((t,e)=>{if(V0(e))return{success:!0,data:e.value};{if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Si(t.common.issues);return{success:!1,error:r}}},"handleResult");function Tt(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||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((c,u)=>c.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:n??u.defaultError}:{message:r??u.defaultError},"customMap"),description:i}}o(Tt,"processCreateParams");var xt=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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Xs(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Xs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rr,ctx:{common:e.parent.common,data:e.data,parsedType:Xs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(W0(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xs(e)},a=this._parseSync({data:e,path:i.path,parent:i});return v9(i,a)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xs(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(W0(i)?i:Promise.resolve(i));return v9(n,a)}refine(e,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,a)=>{let c=e(i),u=o(()=>a.addIssue({code:Ne.custom,...n(i)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(m=>m?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mn({schema:this,typeName:pt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Jn.create(this)}nullable(){return Eo.create(this)}nullish(){return this.optional().nullable()}array(){return Sn.create(this)}promise(){return hs.create(this)}or(e){return ra.create([this,e])}and(e){return na.create(this,e)}transform(e){return new Mn({schema:this,typeName:pt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ca({innerType:this,defaultValue:r,typeName:pt.ZodDefault})}brand(){return new Tl({typeName:pt.ZodBranded,type:this,...Tt(void 0)})}catch(e){let r=typeof e=="function"?e:()=>e;return new mf({innerType:this,defaultValue:r,typeName:pt.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ua.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(xt,"ZodType");var Eq=/^c[^\s-]{8,}$/i,Aq=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Sq=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Mq=o(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}:\\d{2})|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Mi=class extends xt{constructor(){super(...arguments),this._regex=(e,r,n)=>this.refinement(i=>e.test(i),{validation:r,code:Ne.invalid_string,...Rt.errToObj(n)}),this.nonempty=e=>this.min(1,Rt.errToObj(e)),this.trim=()=>new Mi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Fe.string){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_type,expected:Fe.string,received:a.parsedType}),gt}let n=new Rr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let c=e.data.length>a.value,u=e.data.length<a.value;(c||u)&&(i=this._getOrReturnCtx(e,i),c?Ke(i,{code:Ne.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):u&&Ke(i,{code:Ne.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Sq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"email",code:Ne.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Aq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"uuid",code:Ne.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Eq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"cuid",code:Ne.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ke(i,{validation:"url",code:Ne.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"regex",code:Ne.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Mq(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.invalid_string,validation:"datetime",message:a.message}),n.dirty()):Ut.assertNever(a);return{status:n.value,value:e.data}}_addCheck(e){return new Mi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Rt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Rt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Rt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Rt.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...Rt.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Rt.errToObj(r)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Rt.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Rt.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Rt.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Rt.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Rt.errToObj(r)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};o(Mi,"ZodString");Mi.create=t=>{var e;return new Mi({checks:[],typeName:pt.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tt(t)})};function Tq(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)}o(Tq,"floatSafeRemainder");var Yi=class extends xt{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)!==Fe.number){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_type,expected:Fe.number,received:a.parsedType}),gt}let n,i=new Rr;for(let a of this._def.checks)a.kind==="int"?Ut.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Tq(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.not_finite,message:a.message}),i.dirty()):Ut.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Rt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Rt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Rt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Rt.toString(r))}setLimit(e,r,n,i){return new Yi({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Rt.toString(i)}]})}_addCheck(e){return new Yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Rt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Rt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Rt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Rt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Rt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Rt.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Rt.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};o(Yi,"ZodNumber");Yi.create=t=>new Yi({checks:[],typeName:pt.ZodNumber,coerce:t?.coerce||!1,...Tt(t)});var Zs=class extends xt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Fe.bigint){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.bigint,received:n.parsedType}),gt}return rn(e.data)}};o(Zs,"ZodBigInt");Zs.create=t=>{var e;return new Zs({typeName:pt.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tt(t)})};var Qs=class extends xt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Fe.boolean){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.boolean,received:n.parsedType}),gt}return rn(e.data)}};o(Qs,"ZodBoolean");Qs.create=t=>new Qs({typeName:pt.ZodBoolean,coerce:t?.coerce||!1,...Tt(t)});var xo=class extends xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Fe.date){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_type,expected:Fe.date,received:a.parsedType}),gt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_date}),gt}let n=new Rr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Ut.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xo({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Rt.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Rt.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};o(xo,"ZodDate");xo.create=t=>new xo({checks:[],coerce:t?.coerce||!1,typeName:pt.ZodDate,...Tt(t)});var lf=class extends xt{_parse(e){if(this._getType(e)!==Fe.symbol){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.symbol,received:n.parsedType}),gt}return rn(e.data)}};o(lf,"ZodSymbol");lf.create=t=>new lf({typeName:pt.ZodSymbol,...Tt(t)});var ea=class extends xt{_parse(e){if(this._getType(e)!==Fe.undefined){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.undefined,received:n.parsedType}),gt}return rn(e.data)}};o(ea,"ZodUndefined");ea.create=t=>new ea({typeName:pt.ZodUndefined,...Tt(t)});var ta=class extends xt{_parse(e){if(this._getType(e)!==Fe.null){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.null,received:n.parsedType}),gt}return rn(e.data)}};o(ta,"ZodNull");ta.create=t=>new ta({typeName:pt.ZodNull,...Tt(t)});var us=class extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return rn(e.data)}};o(us,"ZodAny");us.create=t=>new us({typeName:pt.ZodAny,...Tt(t)});var wo=class extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rn(e.data)}};o(wo,"ZodUnknown");wo.create=t=>new wo({typeName:pt.ZodUnknown,...Tt(t)});var Ti=class extends xt{_parse(e){let r=this._getOrReturnCtx(e);return Ke(r,{code:Ne.invalid_type,expected:Fe.never,received:r.parsedType}),gt}};o(Ti,"ZodNever");Ti.create=t=>new Ti({typeName:pt.ZodNever,...Tt(t)});var hf=class extends xt{_parse(e){if(this._getType(e)!==Fe.undefined){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.void,received:n.parsedType}),gt}return rn(e.data)}};o(hf,"ZodVoid");hf.create=t=>new hf({typeName:pt.ZodVoid,...Tt(t)});var Sn=class extends xt{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==Fe.array)return Ke(r,{code:Ne.invalid_type,expected:Fe.array,received:r.parsedType}),gt;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(c||u)&&(Ke(r,{code:c?Ne.too_big:Ne.too_small,minimum:u?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Ke(r,{code:Ne.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Ke(r,{code:Ne.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all(r.data.map((c,u)=>i.type._parseAsync(new Vn(r,c,r.path,u)))).then(c=>Rr.mergeArray(n,c));let a=r.data.map((c,u)=>i.type._parseSync(new Vn(r,c,r.path,u)));return Rr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new Sn({...this._def,minLength:{value:e,message:Rt.toString(r)}})}max(e,r){return new Sn({...this._def,maxLength:{value:e,message:Rt.toString(r)}})}length(e,r){return new Sn({...this._def,exactLength:{value:e,message:Rt.toString(r)}})}nonempty(e){return this.min(1,e)}};o(Sn,"ZodArray");Sn.create=(t,e)=>new Sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pt.ZodArray,...Tt(e)});var J0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(J0||(J0={}));var y9=o(t=>e=>new er({...t,shape:()=>({...t.shape(),...e})}),"AugmentFactory");function Fc(t){if(t instanceof er){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Jn.create(Fc(n))}return new er({...t._def,shape:()=>e})}else return t instanceof Sn?Sn.create(Fc(t.element)):t instanceof Jn?Jn.create(Fc(t.unwrap())):t instanceof Eo?Eo.create(Fc(t.unwrap())):t instanceof Wn?Wn.create(t.items.map(e=>Fc(e))):t}o(Fc,"deepPartialify");var er=class extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=y9(this._def),this.extend=y9(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ut.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Fe.object){let v=this._getOrReturnCtx(e);return Ke(v,{code:Ne.invalid_type,expected:Fe.object,received:v.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ti&&this._def.unknownKeys==="strip"))for(let v in i.data)c.includes(v)||u.push(v);let m=[];for(let v of c){let x=a[v],S=i.data[v];m.push({key:{status:"valid",value:v},value:x._parse(new Vn(i,S,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Ti){let v=this._def.unknownKeys;if(v==="passthrough")for(let x of u)m.push({key:{status:"valid",value:x},value:{status:"valid",value:i.data[x]}});else if(v==="strict")u.length>0&&(Ke(i,{code:Ne.unrecognized_keys,keys:u}),n.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let v=this._def.catchall;for(let x of u){let S=i.data[x];m.push({key:{status:"valid",value:x},value:v._parse(new Vn(i,S,i.path,x)),alwaysSet:x in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let v=[];for(let x of m){let S=await x.key;v.push({key:S,value:await x.value,alwaysSet:x.alwaysSet})}return v}).then(v=>Rr.mergeObjectSync(n,v)):Rr.mergeObjectSync(n,m)}get shape(){return this._def.shape()}strict(e){return Rt.errToObj,new er({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,c,u;let m=(c=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(u=Rt.errToObj(e).message)!==null&&u!==void 0?u:m}:{message:m}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}setKey(e,r){return this.augment({[e]:r})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>J0.mergeShapes(this._def.shape(),e._def.shape()),typeName:pt.ZodObject})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let r={};return Ut.objectKeys(e).map(n=>{this.shape[n]&&(r[n]=this.shape[n])}),new er({...this._def,shape:()=>r})}omit(e){let r={};return Ut.objectKeys(this.shape).map(n=>{Ut.objectKeys(e).indexOf(n)===-1&&(r[n]=this.shape[n])}),new er({...this._def,shape:()=>r})}deepPartial(){return Fc(this)}partial(e){let r={};if(e)return Ut.objectKeys(this.shape).map(n=>{Ut.objectKeys(e).indexOf(n)===-1?r[n]=this.shape[n]:r[n]=this.shape[n].optional()}),new er({...this._def,shape:()=>r});for(let n in this.shape){let i=this.shape[n];r[n]=i.optional()}return new er({...this._def,shape:()=>r})}required(e){let r={};if(e)Ut.objectKeys(this.shape).map(n=>{if(Ut.objectKeys(e).indexOf(n)===-1)r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Jn;)a=a._def.innerType;r[n]=a}});else for(let n in this.shape){let a=this.shape[n];for(;a instanceof Jn;)a=a._def.innerType;r[n]=a}return new er({...this._def,shape:()=>r})}keyof(){return E9(Ut.objectKeys(this.shape))}};o(er,"ZodObject");er.create=(t,e)=>new er({shape:()=>t,unknownKeys:"strip",catchall:Ti.create(),typeName:pt.ZodObject,...Tt(e)});er.strictCreate=(t,e)=>new er({shape:()=>t,unknownKeys:"strict",catchall:Ti.create(),typeName:pt.ZodObject,...Tt(e)});er.lazycreate=(t,e)=>new er({shape:t,unknownKeys:"strip",catchall:Ti.create(),typeName:pt.ZodObject,...Tt(e)});var ra=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let u of a)if(u.result.status==="valid")return u.result;for(let u of a)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let c=a.map(u=>new Si(u.ctx.common.issues));return Ke(r,{code:Ne.invalid_union,unionErrors:c}),gt}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async a=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let a,c=[];for(let m of n){let v={...r,common:{...r.common,issues:[]},parent:null},x=m._parseSync({data:r.data,path:r.path,parent:v});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:v}),v.common.issues.length&&c.push(v.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let u=c.map(m=>new Si(m));return Ke(r,{code:Ne.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ra,"ZodUnion");ra.create=(t,e)=>new ra({options:t,typeName:pt.ZodUnion,...Tt(e)});var K0=o(t=>t instanceof oa?K0(t.schema):t instanceof Mn?K0(t.innerType()):t instanceof sa?[t.value]:t instanceof aa?t.options:t instanceof fa?Object.keys(t.enum):t instanceof ca?K0(t._def.innerType):t instanceof ea?[void 0]:t instanceof ta?[null]:null,"getDiscriminator"),df=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.object)return Ke(r,{code:Ne.invalid_type,expected:Fe.object,received:r.parsedType}),gt;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(Ke(r,{code:Ne.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,r,n){let i=new Map;for(let a of r){let c=K0(a.shape[e]);if(!c)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of c){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,a)}}return new df({typeName:pt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Tt(n)})}};o(df,"ZodDiscriminatedUnion");function Xg(t,e){let r=Xs(t),n=Xs(e);if(t===e)return{valid:!0,data:t};if(r===Fe.object&&n===Fe.object){let i=Ut.objectKeys(e),a=Ut.objectKeys(t).filter(u=>i.indexOf(u)!==-1),c={...t,...e};for(let u of a){let m=Xg(t[u],e[u]);if(!m.valid)return{valid:!1};c[u]=m.data}return{valid:!0,data:c}}else if(r===Fe.array&&n===Fe.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let c=t[a],u=e[a],m=Xg(c,u);if(!m.valid)return{valid:!1};i.push(m.data)}return{valid:!0,data:i}}else return r===Fe.date&&n===Fe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}o(Xg,"mergeValues");var na=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=o((a,c)=>{if(Jg(a)||Jg(c))return gt;let u=Xg(a.value,c.value);return u.valid?((Yg(a)||Yg(c))&&r.dirty(),{status:r.value,value:u.data}):(Ke(n,{code:Ne.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(([a,c])=>i(a,c)):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(na,"ZodIntersection");na.create=(t,e,r)=>new na({left:t,right:e,typeName:pt.ZodIntersection,...Tt(r)});var Wn=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.array)return Ke(n,{code:Ne.invalid_type,expected:Fe.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return Ke(n,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&(Ke(n,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=n.data.map((c,u)=>{let m=this._def.items[u]||this._def.rest;return m?m._parse(new Vn(n,c,n.path,u)):null}).filter(c=>!!c);return n.common.async?Promise.all(a).then(c=>Rr.mergeArray(r,c)):Rr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Wn({...this._def,rest:e})}};o(Wn,"ZodTuple");Wn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wn({items:t,typeName:pt.ZodTuple,rest:null,...Tt(e)})};var ia=class extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.object)return Ke(n,{code:Ne.invalid_type,expected:Fe.object,received:n.parsedType}),gt;let i=[],a=this._def.keyType,c=this._def.valueType;for(let u in n.data)i.push({key:a._parse(new Vn(n,u,n.path,u)),value:c._parse(new Vn(n,n.data[u],n.path,u))});return n.common.async?Rr.mergeObjectAsync(r,i):Rr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xt?new ia({keyType:e,valueType:r,typeName:pt.ZodRecord,...Tt(n)}):new ia({keyType:Mi.create(),valueType:e,typeName:pt.ZodRecord,...Tt(r)})}};o(ia,"ZodRecord");var pf=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.map)return Ke(n,{code:Ne.invalid_type,expected:Fe.map,received:n.parsedType}),gt;let i=this._def.keyType,a=this._def.valueType,c=[...n.data.entries()].map(([u,m],v)=>({key:i._parse(new Vn(n,u,n.path,[v,"key"])),value:a._parse(new Vn(n,m,n.path,[v,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let m of c){let v=await m.key,x=await m.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&r.dirty(),u.set(v.value,x.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let m of c){let v=m.key,x=m.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&r.dirty(),u.set(v.value,x.value)}return{status:r.value,value:u}}}};o(pf,"ZodMap");pf.create=(t,e,r)=>new pf({valueType:e,keyType:t,typeName:pt.ZodMap,...Tt(r)});var _o=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.set)return Ke(n,{code:Ne.invalid_type,expected:Fe.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Ke(n,{code:Ne.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Ke(n,{code:Ne.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function c(m){let v=new Set;for(let x of m){if(x.status==="aborted")return gt;x.status==="dirty"&&r.dirty(),v.add(x.value)}return{status:r.value,value:v}}o(c,"finalizeSet");let u=[...n.data.values()].map((m,v)=>a._parse(new Vn(n,m,n.path,v)));return n.common.async?Promise.all(u).then(m=>c(m)):c(u)}min(e,r){return new _o({...this._def,minSize:{value:e,message:Rt.toString(r)}})}max(e,r){return new _o({...this._def,maxSize:{value:e,message:Rt.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};o(_o,"ZodSet");_o.create=(t,e)=>new _o({valueType:t,minSize:null,maxSize:null,typeName:pt.ZodSet,...Tt(e)});var ls=class extends xt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.function)return Ke(r,{code:Ne.invalid_type,expected:Fe.function,received:r.parsedType}),gt;function n(u,m){return G0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,j0(),Cl].filter(v=>!!v),issueData:{code:Ne.invalid_arguments,argumentsError:m}})}o(n,"makeArgsIssue");function i(u,m){return G0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,j0(),Cl].filter(v=>!!v),issueData:{code:Ne.invalid_return_type,returnTypeError:m}})}o(i,"makeReturnsIssue");let a={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof hs?rn(async(...u)=>{let m=new Si([]),v=await this._def.args.parseAsync(u,a).catch(O=>{throw m.addIssue(n(u,O)),m}),x=await c(...v);return await this._def.returns._def.type.parseAsync(x,a).catch(O=>{throw m.addIssue(i(x,O)),m})}):rn((...u)=>{let m=this._def.args.safeParse(u,a);if(!m.success)throw new Si([n(u,m.error)]);let v=c(...m.data),x=this._def.returns.safeParse(v,a);if(!x.success)throw new Si([i(v,x.error)]);return x.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ls({...this._def,args:Wn.create(e).rest(wo.create())})}returns(e){return new ls({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new ls({args:e||Wn.create([]).rest(wo.create()),returns:r||wo.create(),typeName:pt.ZodFunction,...Tt(n)})}};o(ls,"ZodFunction");var oa=class extends xt{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(oa,"ZodLazy");oa.create=(t,e)=>new oa({getter:t,typeName:pt.ZodLazy,...Tt(e)});var sa=class extends xt{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Ke(r,{code:Ne.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(sa,"ZodLiteral");sa.create=(t,e)=>new sa({value:t,typeName:pt.ZodLiteral,...Tt(e)});function E9(t,e){return new aa({values:t,typeName:pt.ZodEnum,...Tt(e)})}o(E9,"createZodEnum");var aa=class extends xt{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{expected:Ut.joinValues(n),received:r.parsedType,code:Ne.invalid_type}),gt}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{received:r.data,code:Ne.invalid_enum_value,options:n}),gt}return rn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}};o(aa,"ZodEnum");aa.create=E9;var fa=class extends xt{_parse(e){let r=Ut.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Fe.string&&n.parsedType!==Fe.number){let i=Ut.objectValues(r);return Ke(n,{expected:Ut.joinValues(i),received:n.parsedType,code:Ne.invalid_type}),gt}if(r.indexOf(e.data)===-1){let i=Ut.objectValues(r);return Ke(n,{received:n.data,code:Ne.invalid_enum_value,options:i}),gt}return rn(e.data)}get enum(){return this._def.values}};o(fa,"ZodNativeEnum");fa.create=(t,e)=>new fa({values:t,typeName:pt.ZodNativeEnum,...Tt(e)});var hs=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.promise&&r.common.async===!1)return Ke(r,{code:Ne.invalid_type,expected:Fe.promise,received:r.parsedType}),gt;let n=r.parsedType===Fe.promise?r.data:Promise.resolve(r.data);return rn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(hs,"ZodPromise");hs.create=(t,e)=>new hs({type:t,typeName:pt.ZodPromise,...Tt(e)});var Mn=class extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let c=i.transform(n.data);return n.common.async?Promise.resolve(c).then(u=>this._def.schema._parseAsync({data:u,path:n.path,parent:n})):this._def.schema._parseSync({data:c,path:n.path,parent:n})}let a={addIssue:c=>{Ke(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="refinement"){let c=o(u=>{let m=i.refinement(u,a);if(n.common.async)return Promise.resolve(m);if(m 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"&&r.dirty(),c(u.value),{status:r.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"&&r.dirty(),c(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!V0(c))return c;let u=i.transform(c.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>V0(c)?Promise.resolve(i.transform(c.value,a)).then(u=>({status:r.value,value:u})):c);Ut.assertNever(i)}};o(Mn,"ZodEffects");Mn.create=(t,e,r)=>new Mn({schema:t,typeName:pt.ZodEffects,effect:e,...Tt(r)});Mn.createWithPreprocess=(t,e,r)=>new Mn({schema:e,effect:{type:"preprocess",transform:t},typeName:pt.ZodEffects,...Tt(r)});var Jn=class extends xt{_parse(e){return this._getType(e)===Fe.undefined?rn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Jn,"ZodOptional");Jn.create=(t,e)=>new Jn({innerType:t,typeName:pt.ZodOptional,...Tt(e)});var Eo=class extends xt{_parse(e){return this._getType(e)===Fe.null?rn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Eo,"ZodNullable");Eo.create=(t,e)=>new Eo({innerType:t,typeName:pt.ZodNullable,...Tt(e)});var ca=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Fe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(ca,"ZodDefault");ca.create=(t,e)=>new ca({innerType:t,typeName:pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tt(e)});var mf=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.innerType._parse({data:r.data,path:r.path,parent:r});return W0(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.defaultValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};o(mf,"ZodCatch");mf.create=(t,e)=>new mf({innerType:t,typeName:pt.ZodCatch,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tt(e)});var bf=class extends xt{_parse(e){if(this._getType(e)!==Fe.nan){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(bf,"ZodNaN");bf.create=t=>new bf({typeName:pt.ZodNaN,...Tt(t)});var Cq=Symbol("zod_brand"),Tl=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(Tl,"ZodBranded");var ua=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?gt:a.status==="dirty"?(r.dirty(),_9(a.value)):this._def.out._parseAsync({data:a.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"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new ua({in:e,out:r,typeName:pt.ZodPipeline})}};o(ua,"ZodPipeline");var A9=o((t,e={},r)=>t?us.create().superRefine((n,i)=>{if(!t(n)){let a=typeof e=="function"?e(n):e,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:r})}}):us.create(),"custom"),kq={object:er.lazycreate},pt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline"})(pt||(pt={}));var Iq=o((t,e={message:`Input not instance of ${t.name}`})=>A9(r=>r instanceof t,e,!0),"instanceOfType"),S9=Mi.create,M9=Yi.create,Dq=bf.create,Oq=Zs.create,T9=Qs.create,Rq=xo.create,Nq=lf.create,Pq=ea.create,Lq=ta.create,Bq=us.create,Uq=wo.create,$q=Ti.create,Fq=hf.create,qq=Sn.create,Hq=er.create,zq=er.strictCreate,Kq=ra.create,jq=df.create,Gq=na.create,Vq=Wn.create,Wq=ia.create,Jq=pf.create,Yq=_o.create,Xq=ls.create,Zq=oa.create,Qq=sa.create,eH=aa.create,tH=fa.create,rH=hs.create,x9=Mn.create,nH=Jn.create,iH=Eo.create,oH=Mn.createWithPreprocess,sH=ua.create,aH=o(()=>S9().optional(),"ostring"),fH=o(()=>M9().optional(),"onumber"),cH=o(()=>T9().optional(),"oboolean"),uH={string:t=>Mi.create({...t,coerce:!0}),number:t=>Yi.create({...t,coerce:!0}),boolean:t=>Qs.create({...t,coerce:!0}),bigint:t=>Zs.create({...t,coerce:!0}),date:t=>xo.create({...t,coerce:!0})},lH=gt,U=Object.freeze({__proto__:null,defaultErrorMap:Cl,setErrorMap:wq,getErrorMap:j0,makeIssue:G0,EMPTY_PATH:_q,addIssueToContext:Ke,ParseStatus:Rr,INVALID:gt,DIRTY:_9,OK:rn,isAborted:Jg,isDirty:Yg,isValid:V0,isAsync:W0,get util(){return Ut},ZodParsedType:Fe,getParsedType:Xs,ZodType:xt,ZodString:Mi,ZodNumber:Yi,ZodBigInt:Zs,ZodBoolean:Qs,ZodDate:xo,ZodSymbol:lf,ZodUndefined:ea,ZodNull:ta,ZodAny:us,ZodUnknown:wo,ZodNever:Ti,ZodVoid:hf,ZodArray:Sn,get objectUtil(){return J0},ZodObject:er,ZodUnion:ra,ZodDiscriminatedUnion:df,ZodIntersection:na,ZodTuple:Wn,ZodRecord:ia,ZodMap:pf,ZodSet:_o,ZodFunction:ls,ZodLazy:oa,ZodLiteral:sa,ZodEnum:aa,ZodNativeEnum:fa,ZodPromise:hs,ZodEffects:Mn,ZodTransformer:Mn,ZodOptional:Jn,ZodNullable:Eo,ZodDefault:ca,ZodCatch:mf,ZodNaN:bf,BRAND:Cq,ZodBranded:Tl,ZodPipeline:ua,custom:A9,Schema:xt,ZodSchema:xt,late:kq,get ZodFirstPartyTypeKind(){return pt},coerce:uH,any:Bq,array:qq,bigint:Oq,boolean:T9,date:Rq,discriminatedUnion:jq,effect:x9,enum:eH,function:Xq,instanceof:Iq,intersection:Gq,lazy:Zq,literal:Qq,map:Jq,nan:Dq,nativeEnum:tH,never:$q,null:Lq,nullable:iH,number:M9,object:Hq,oboolean:cH,onumber:fH,optional:nH,ostring:aH,pipeline:sH,preprocess:oH,promise:rH,record:Wq,set:Yq,strictObject:zq,string:S9,symbol:Nq,transformer:x9,tuple:Vq,undefined:Pq,union:Kq,unknown:Uq,void:Fq,NEVER:lH,ZodIssueCode:Ne,quotelessJson:xq,ZodError:Si});var k9=U.array(U.string().or(U.record(U.any()))),Jte=U.object({type:U.string().optional(),narrative:U.string().optional()}),X0=U.string().or(U.object({id:U.string(),type:U.string(),caption:U.string().optional()})),hH=U.object({type:U.string().min(1).or(U.string().array().nonempty()),latitude:U.number(),longitude:U.number()}),dH=U.object({type:U.string().min(1).or(U.string().array().nonempty()),addressCountry:U.string().optional(),addressCountryCode:U.string().optional(),addressRegion:U.string().optional(),addressLocality:U.string().optional(),streetAddress:U.string().optional(),postOfficeBoxNumber:U.string().optional(),postalCode:U.string().optional(),geo:hH.optional()}),pH=U.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(U.string()),I9=U.object({type:U.string().min(1).or(U.string().array().nonempty()),identifier:U.string(),identifierType:pH}),kl=U.string().or(U.object({id:U.string().optional(),type:U.string().or(U.string().array().nonempty().optional()),name:U.string().optional(),url:U.string().optional(),phone:U.string().optional(),description:U.string().optional(),endorsement:U.any().array().optional(),image:X0.optional(),email:U.string().email().optional(),address:dH.optional(),otherIdentifier:I9.array().optional(),official:U.string().optional(),parentOrg:U.any().optional(),familyName:U.string().optional(),givenName:U.string().optional(),additionalName:U.string().optional(),patronymicName:U.string().optional(),honorificPrefix:U.string().optional(),honorificSuffix:U.string().optional(),familyNamePrefix:U.string().optional(),dateOfBirth:U.string().optional()}).catchall(U.any())),Zg=U.object({id:U.string().optional()}).catchall(U.any()),mH=U.object({type:U.string(),id:U.string()}).catchall(U.any()),bH=U.object({id:U.string(),type:U.string()}).catchall(U.any()),gH=U.object({id:U.string(),type:U.string()}).catchall(U.any()),Y0=U.object({"@context":k9,id:U.string().optional(),type:U.string().array().nonempty(),issuer:kl,issuanceDate:U.string(),expirationDate:U.string().optional(),credentialSubject:Zg.or(Zg.array()),credentialStatus:mH.optional(),credentialSchema:bH.array().optional(),refreshService:gH.optional()}).catchall(U.any()),la=U.object({type:U.string(),created:U.string(),challenge:U.string().optional(),domain:U.string().optional(),nonce:U.string().optional(),proofPurpose:U.string(),verificationMethod:U.string(),jws:U.string().optional()}).catchall(U.any()),Il=Y0.extend({proof:la.or(la.array())}),vH=U.object({"@context":k9,id:U.string().optional(),type:U.string().or(U.string().array().nonempty()),verifiableCredential:Il.or(Il.array()).optional(),holder:U.string().optional()}).catchall(U.any()),e2=vH.extend({proof:la.or(la.array())}),yH=U.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(U.string()),Z0=U.object({type:U.string().array().nonempty(),targetCode:U.string().optional(),targetDescription:U.string().optional(),targetName:U.string(),targetFramework:U.string().optional(),targetType:yH.optional(),targetUrl:U.string()}),xH=U.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"]),wH=xH.or(U.string()),_H=U.object({id:U.string().optional(),narrative:U.string().optional()}).catchall(U.any()),EH=U.object({id:U.string(),type:U.string().array().nonempty(),endorsementComment:U.string().optional()}),AH=Y0.extend({credentialSubject:EH,proof:la.or(la.array()).optional()}),SH=U.object({id:U.string(),"@language":U.string().optional(),version:U.string().optional()}),MH=U.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(U.string()),TH=U.object({id:U.string(),type:U.string().array().nonempty(),alignment:Z0.array().optional(),description:U.string().optional(),level:U.string().optional(),name:U.string(),points:U.string().optional()}).catchall(U.any()),CH=U.object({id:U.string(),type:U.string().array().nonempty(),alignment:Z0.array().optional(),allowedValue:U.string().array().optional(),name:U.string(),requiredLevel:U.string().optional(),requiredValue:U.string().optional(),resultType:MH,rubricCriterionLevel:TH.array().optional(),valueMax:U.string().optional(),valueMin:U.string().optional()}).catchall(U.any()),kH=U.object({id:U.string().optional(),type:U.string().array().nonempty(),alignment:Z0.array().optional(),achievementType:wH.optional(),creator:kl.optional(),creditsAvailable:U.number().optional(),criteria:_H,description:U.string(),endorsement:AH.array().optional(),fieldOfStudy:U.string().optional(),humanCode:U.string().optional(),image:X0.optional(),"@language":U.string().optional(),name:U.string(),otherIdentifier:I9.array().optional(),related:SH.array().optional(),resultDescription:CH.array().optional(),specialization:U.string().optional(),tag:U.string().array().optional(),version:U.string().optional()}).catchall(U.any()),IH=U.object({type:U.string(),hashed:U.boolean(),identityHash:U.string(),identityType:U.string(),salt:U.string().optional()}),DH=U.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),OH=U.object({type:U.string().array().nonempty(),achievedLevel:U.string().optional(),alignment:Z0.array().optional(),resultDescription:U.string().optional(),status:DH.optional(),value:U.string().optional()}).catchall(U.any()),C9=U.object({id:U.string().optional(),type:U.string().array().nonempty(),activityEndDate:U.string().optional(),activityStartDate:U.string().optional(),creditsEarned:U.number().optional(),achievement:kH.optional(),identifier:IH.array().optional(),image:X0.optional(),licenseNumber:U.string().optional(),narrative:U.string().optional(),result:OH.array().optional(),role:U.string().optional(),source:kl.optional(),term:U.string().optional()}).catchall(U.any()),RH=U.object({id:U.string().optional(),type:U.string().array().nonempty(),narrative:U.string().optional(),name:U.string().optional(),description:U.string().optional(),genre:U.string().optional(),audience:U.string().optional()}).catchall(U.any()),NH=Y0.extend({name:U.string().optional(),description:U.string().optional(),image:X0.optional(),credentialSubject:C9.or(C9.array()),endorsement:Y0.array().optional(),evidence:RH.array().optional()}),Xte=NH.extend({proof:la.or(la.array())}),Qte=U.object({checks:U.string().array(),warnings:U.string().array(),errors:U.string().array()}),D9=U.enum(["Success","Failed","Error"]),ere=D9.enum,tre=U.object({check:U.string(),status:D9,message:U.string().optional(),details:U.string().optional()}),rre=U.object({title:U.string().optional(),createdAt:U.string().optional(),issuer:kl.optional(),issuee:kl.optional(),credentialSubject:Zg.optional()}),nre=U.object({id:U.string(),uri:U.string()}).catchall(U.any()),sre=U.object({limit:U.number(),cursor:U.string().optional(),sort:U.string().optional()}),gf=U.object({cursor:U.string().optional(),hasMore:U.boolean()}),PH=U.object({kty:U.string(),crv:U.string(),x:U.string(),y:U.string().optional(),n:U.string().optional(),d:U.string()}),LH=U.object({alg:U.string(),iv:U.string(),tag:U.string(),epk:PH.partial().optional(),kid:U.string().optional(),apv:U.string().optional(),apu:U.string().optional()}),BH=U.object({header:LH,encrypted_key:U.string()}),UH=U.object({protected:U.string(),iv:U.string(),ciphertext:U.string(),tag:U.string(),aad:U.string().optional(),recipients:BH.array().optional()}),O9=U.object({encryptedRecord:UH,fields:U.string().array()}).catchall(U.any()),fre=gf.extend({records:O9.array()}),$H=O9.extend({id:U.string()}),cre=gf.extend({records:$H.array()}),qc=U.object({profileId:U.string().min(3).max(40),displayName:U.string().default(""),bio:U.string().default(""),did:U.string(),email:U.string().optional(),image:U.string().optional(),isServiceProfile:U.boolean().default(!1).optional(),notificationsWebhook:U.string().url().startsWith("https://").optional()}),lre=gf.extend({records:qc.array()}),hre=U.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),dre=U.object({uri:U.string(),to:U.string(),from:U.string(),sent:U.string().datetime(),received:U.string().datetime().optional()}),FH=U.enum(["DRAFT","LIVE"]),pre=U.object({uri:U.string(),name:U.string().optional(),type:U.string().optional(),category:U.string().optional(),status:FH.optional(),autoConnectRecipients:U.boolean().optional()}),mre=U.object({to:qc,from:U.string(),received:U.string().optional()}),qH=U.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED"]),HH=U.object({title:U.string().optional(),body:U.string().optional()}),zH=U.object({vcUris:U.array(U.string()).optional(),vpUris:U.array(U.string()).optional()}),bre=U.object({type:qH,to:qc.partial().and(U.object({did:U.string()})),from:qc.partial().and(U.object({did:U.string()})),message:HH.optional(),data:zH.optional(),sent:U.string().datetime().optional()}),gre=U.object({endpoint:U.string(),name:U.string(),did:U.string().optional()}),vre=U.object({ttlSeconds:U.number().optional(),totalUses:U.number().optional()}),KH=U.object({endpoint:U.string()}),yre=U.object({signingAuthority:KH,relationship:U.object({name:U.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:U.string()})}),jH=U.enum(["live","stale","withdrawn"]),GH=U.object({read:U.object({anonymize:U.boolean().optional(),credentials:U.object({categories:U.record(U.object({required:U.boolean()})).default({})}).default({}),personal:U.record(U.object({required:U.boolean()})).default({})}).default({}),write:U.object({credentials:U.object({categories:U.record(U.object({required:U.boolean()})).default({})}).default({}),personal:U.record(U.object({required:U.boolean()})).default({})}).default({})}),R9=U.object({contract:GH,owner:qc,name:U.string(),subtitle:U.string().optional(),description:U.string().optional(),reasonForAccessing:U.string().optional(),image:U.string().optional(),uri:U.string(),createdAt:U.string(),updatedAt:U.string(),expiresAt:U.string().optional()}),xre=gf.extend({records:R9.omit({owner:!0}).array()}),VH=U.object({credentials:U.object({categories:U.record(U.string().array()).default({})}),personal:U.record(U.string()).default({}),date:U.string()}),wre=gf.extend({records:VH.array()}),N9=U.object({read:U.object({anonymize:U.boolean().optional(),credentials:U.object({shareAll:U.boolean().optional(),sharing:U.boolean().optional(),categories:U.record(U.object({sharing:U.boolean().optional(),shared:U.string().array().optional(),shareAll:U.boolean().optional()})).default({})}).default({}),personal:U.record(U.string()).default({})}).default({}),write:U.object({credentials:U.object({categories:U.record(U.boolean()).default({})}).default({}),personal:U.record(U.boolean()).default({})}).default({})}),_re=gf.extend({records:U.object({expiresAt:U.string().optional(),oneTime:U.boolean().optional(),terms:N9,contract:R9,uri:U.string(),consenter:qc,status:jH}).array()}),Ere=U.object({read:U.object({anonymize:U.boolean().optional(),credentials:U.object({categories:U.record(U.object({required:U.boolean().optional()})).optional()}).optional(),personal:U.record(U.object({required:U.boolean().optional()})).optional()}).optional(),write:U.object({credentials:U.object({categories:U.record(U.object({required:U.boolean().optional()})).optional()}).optional(),personal:U.record(U.object({required:U.boolean().optional()})).optional()}).optional()}),WH=U.object({read:U.object({anonymize:U.boolean().optional(),credentials:U.object({shareAll:U.boolean().optional(),sharing:U.boolean().optional(),categories:U.record(U.object({sharing:U.boolean().optional(),shared:U.string().array().optional(),shareAll:U.boolean().optional()}).optional()).optional()}).optional(),personal:U.record(U.string()).optional()}).optional(),write:U.object({credentials:U.object({categories:U.record(U.boolean()).optional()}).optional(),personal:U.record(U.boolean()).optional()}).optional()}),Qg=U.enum(["consent","update","sync","withdraw"]),Are=U.object({terms:WH.optional(),action:Qg.or(Qg.array()).optional(),date:U.object({$gt:U.string()}).or(U.object({$lt:U.string()})).or(U.object({$eq:U.string()})).optional(),expiresAt:U.object({$gt:U.string()}).or(U.object({$lt:U.string()})).or(U.object({$eq:U.string()})).optional(),oneTime:U.boolean().optional()}),JH=U.object({expiresAt:U.string().optional(),oneTime:U.boolean().optional(),terms:N9.optional(),id:U.string(),action:Qg,date:U.string()}),Sre=gf.extend({records:JH.array()});var Q0=o(t=>`lc:ceramic:${t}`,"streamIdToCeramicURI");var t2=U.string().refine(t=>t.split(":").length===3&&t.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(t=>t.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var ep=o(async(t,{ceramicEndpoint:e,defaultContentFamily:r})=>{let n=new Ml(e),i=o(async(R,D,P,J)=>t.invoke.didResolver(R,J),"learnCardResolver"),a={...g8.getResolver(),web:i},c=new Va({resolver:a});n.did=c;let u=t.invoke.getKey(),m=new tl(e8(u));n.did.setProvider(m),await n.did.authenticate();let v=new yl({ceramic:n}),x=o(async(R,D={},P={},J)=>{if(!R)throw new Error("content is required");if(D.controllers||(D.controllers=[n.did.id]),D.family||(D.family=r),"pin"in P||(P.pin=!0),J?.encrypt){t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",J);let W=J?.recipients||[];J?.controllersCanDecrypt&&(W=[...W,...D.controllers]),R=await n?.did?.createDagJWE(R,P9.default.uniq(W))}return t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,D,P),(await Gn.create(n,R,D,P)).id.toString()},"publishContentToCeramic"),S=o(async R=>{let D=(await v.load(R))?.content;if(t.debug?.("learnCard.read.get.readContentFromCeramic",D),D?.ciphertext)try{return await c.decryptDagJWE(D)}catch(P){throw t.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",P),new Error("Could not decrypt credential - DID not authorized.")}return D},"readContentFromCeramic"),O=o(async(R,D)=>(await Il.or(e2).parseAsync(R),Q0(await x(R,{},{},D))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,D)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(D)),uploadEncrypted:async(R,D,P)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(D,{encrypt:!0,controllersCanDecrypt:!0,...P?{recipients:P.recipients}:{}}))},read:{get:async(R,D)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!D)return;let P=await t2.spa(D);if(!P.success)return;let J=P.data.split(":")[2];try{return await Il.or(e2).parseAsync(await S(J))}catch(L){R.debug?.(L);return}}},methods:{publishContentToCeramic:async(R,D,P)=>Q0(await x(D,{},{},P)),readContentFromCeramic:async(R,D)=>S(D),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var YH=ep;
|
|
817
|
+
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function nf(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}o(nf,"arrRemove");var Ys=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(t,"Subscription"),t.prototype.unsubscribe=function(){var e,r,n,i,a;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var u=ss(c),m=u.next();!m.done;m=u.next()){var v=m.value;v.remove(this)}}catch(P){e={error:P}}finally{try{m&&!m.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}else c.remove(this);var x=this.initialTeardown;if(At(x))try{x()}catch(P){a=P instanceof y0?P.errors:[P]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var O=ss(S),R=O.next();!R.done;R=O.next()){var D=R.value;try{T_(D)}catch(P){a=a??[],P instanceof y0?a=Vi(Vi([],Kn(a)),Kn(P.errors)):a.push(P)}}}catch(P){n={error:P}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(a)throw new y0(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)T_(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&nf(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&nf(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();var yg=Ys.EMPTY;function x0(t){return t instanceof Ys||t&&"closed"in t&&At(t.remove)&&At(t.add)&&At(t.unsubscribe)}o(x0,"isSubscription");function T_(t){At(t)?t():t.unsubscribe()}o(T_,"execFinalizer");var Wi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Dc={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Dc.delegate;return i?.setTimeout?i.setTimeout.apply(i,Vi([t,e],Kn(r))):setTimeout.apply(void 0,Vi([t,e],Kn(r)))},clearTimeout:function(t){var e=Dc.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function w0(t){Dc.setTimeout(function(){var e=Wi.onUnhandledError;if(e)e(t);else throw t})}o(w0,"reportUnhandledError");function xg(){}o(xg,"noop");var C_=function(){return wg("C",void 0,void 0)}();function k_(t){return wg("E",void 0,t)}o(k_,"errorNotification");function I_(t){return wg("N",t,void 0)}o(I_,"nextNotification");function wg(t,e,r){return{kind:t,value:e,error:r}}o(wg,"createNotification");var of=null;function Oc(t){if(Wi.useDeprecatedSynchronousErrorHandling){var e=!of;if(e&&(of={errorThrown:!1,error:null}),t(),e){var r=of,n=r.errorThrown,i=r.error;if(of=null,n)throw i}}else t()}o(Oc,"errorContext");function D_(t){Wi.useDeprecatedSynchronousErrorHandling&&of&&(of.errorThrown=!0,of.error=t)}o(D_,"captureError");var ll=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,x0(r)&&r.add(n)):n.destination=E$,n}return o(e,"Subscriber"),e.create=function(r,n,i){return new E0(r,n,i)},e.prototype.next=function(r){this.isStopped?Eg(I_(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?Eg(k_(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?Eg(C_,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ys);var x$=Function.prototype.bind;function _g(t,e){return x$.call(t,e)}o(_g,"bind");var w$=function(){function t(e){this.partialObserver=e}return o(t,"ConsumerObserver"),t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){_0(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){_0(n)}else _0(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){_0(r)}},t}(),E0=function(t){Qr(e,t);function e(r,n,i){var a=t.call(this)||this,c;if(At(r)||!r)c={next:r??void 0,error:n??void 0,complete:i??void 0};else{var u;a&&Wi.useDeprecatedNextContext?(u=Object.create(r),u.unsubscribe=function(){return a.unsubscribe()},c={next:r.next&&_g(r.next,u),error:r.error&&_g(r.error,u),complete:r.complete&&_g(r.complete,u)}):c=r}return a.destination=new w$(c),a}return o(e,"SafeSubscriber"),e}(ll);function _0(t){Wi.useDeprecatedSynchronousErrorHandling?D_(t):w0(t)}o(_0,"handleUnhandledError");function _$(t){throw t}o(_$,"defaultErrorHandler");function Eg(t,e){var r=Wi.onStoppedNotification;r&&Dc.setTimeout(function(){return r(t,e)})}o(Eg,"handleStoppedNotification");var E$={closed:!0,next:xg,error:_$,complete:xg};var Rc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Nc(t){return t}o(Nc,"identity");function O_(t){return t.length===0?Nc:t.length===1?t[0]:o(function(r){return t.reduce(function(n,i){return i(n)},r)},"piped")}o(O_,"pipeFromArray");var Wt=function(){function t(e){e&&(this._subscribe=e)}return o(t,"Observable"),t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,a=S$(e)?e:new E0(e,r,n);return Oc(function(){var c=i,u=c.operator,m=c.source;a.add(u?u.call(a,m):m?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=R_(r),new r(function(i,a){var c=new E0({next:function(u){try{e(u)}catch(m){a(m),c.unsubscribe()}},error:a,complete:i});n.subscribe(c)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[Rc]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return O_(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=R_(e),new e(function(n,i){var a;r.subscribe(function(c){return a=c},function(c){return i(c)},function(){return n(a)})})},t.create=function(e){return new t(e)},t}();function R_(t){var e;return(e=t??Wi.Promise)!==null&&e!==void 0?e:Promise}o(R_,"getPromiseCtor");function A$(t){return t&&At(t.next)&&At(t.error)&&At(t.complete)}o(A$,"isObserver");function S$(t){return t&&t instanceof ll||A$(t)&&x0(t)}o(S$,"isSubscriber");function M$(t){return At(t?.lift)}o(M$,"hasLift");function Dr(t){return function(e){if(M$(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Dr,"operate");function Or(t,e,r,n,i){return new T$(t,e,r,n,i)}o(Or,"createOperatorSubscriber");var T$=function(t){Qr(e,t);function e(r,n,i,a,c,u){var m=t.call(this,r)||this;return m.onFinalize=c,m.shouldUnsubscribe=u,m._next=n?function(v){try{n(v)}catch(x){r.error(x)}}:t.prototype._next,m._error=a?function(v){try{a(v)}catch(x){r.error(x)}finally{this.unsubscribe()}}:t.prototype._error,m._complete=i?function(){try{i()}catch(v){r.error(v)}finally{this.unsubscribe()}}:t.prototype._complete,m}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e}(ll);var N_=Ic(function(t){return o(function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Ag=function(t){Qr(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return o(e,"Subject"),e.prototype.lift=function(r){var n=new P_(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new N_},e.prototype.next=function(r){var n=this;Oc(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=ss(n.currentObservers),u=c.next();!u.done;u=c.next()){var m=u.value;m.next(r)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;Oc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;Oc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.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 r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,c=i.isStopped,u=i.observers;return a||c?yg:(this.currentObservers=null,u.push(r),new Ys(function(){n.currentObservers=null,nf(u,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,c=n.isStopped;i?r.error(a):c&&r.complete()},e.prototype.asObservable=function(){var r=new Wt;return r.source=this,r},e.create=function(r,n){return new P_(r,n)},e}(Wt);var P_=function(t){Qr(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:yg},e}(Ag);var Sg=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Ag);var Mg={now:function(){return(Mg.delegate||Date).now()},delegate:void 0};var L_=function(t){Qr(e,t);function e(r,n){return t.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},e}(Ys);var hl={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=hl.delegate;return i?.setInterval?i.setInterval.apply(i,Vi([t,e],Kn(r))):setInterval.apply(void 0,Vi([t,e],Kn(r)))},clearInterval:function(t){var e=hl.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var B_=function(t){Qr(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var a=this.id,c=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(c,a,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(c,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),hl.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&hl.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,a;try{this.work(r)}catch(c){i=!0,a=c||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nf(a,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(L_);var Tg=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return o(t,"Scheduler"),t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=Mg.now,t}();var U_=function(t){Qr(e,t);function e(r,n){n===void 0&&(n=Tg.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Tg);var C$=new U_(B_),$_=C$;var A0=new Wt(function(t){return t.complete()});function S0(t){return t&&At(t.schedule)}o(S0,"isScheduler");function F_(t){return t[t.length-1]}o(F_,"last");function q_(t){return S0(F_(t))?t.pop():void 0}o(q_,"popScheduler");function H_(t,e){return typeof F_(t)=="number"?t.pop():e}o(H_,"popNumber");var Pc=o(function(t){return t&&typeof t.length=="number"&&typeof t!="function"},"isArrayLike");function M0(t){return At(t?.then)}o(M0,"isPromise");function T0(t){return At(t[Rc])}o(T0,"isInteropObservable");function C0(t){return Symbol.asyncIterator&&At(t?.[Symbol.asyncIterator])}o(C0,"isAsyncIterable");function k0(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(k0,"createInvalidObservableTypeError");function k$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(k$,"getSymbolIterator");var I0=k$();function D0(t){return At(t?.[I0])}o(D0,"isIterable");function O0(t){return S_(this,arguments,o(function(){var r,n,i,a;return v0(this,function(c){switch(c.label){case 0:r=t.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,rf(r.read())];case 3:return n=c.sent(),i=n.value,a=n.done,a?[4,rf(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,rf(i)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(O0,"readableStreamLikeToAsyncGenerator");function R0(t){return At(t?.getReader)}o(R0,"isReadableStreamLike");function en(t){if(t instanceof Wt)return t;if(t!=null){if(T0(t))return I$(t);if(Pc(t))return D$(t);if(M0(t))return O$(t);if(C0(t))return z_(t);if(D0(t))return R$(t);if(R0(t))return N$(t)}throw k0(t)}o(en,"innerFrom");function I$(t){return new Wt(function(e){var r=t[Rc]();if(At(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(I$,"fromInteropObservable");function D$(t){return new Wt(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}o(D$,"fromArrayLike");function O$(t){return new Wt(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,w0)})}o(O$,"fromPromise");function R$(t){return new Wt(function(e){var r,n;try{for(var i=ss(t),a=i.next();!a.done;a=i.next()){var c=a.value;if(e.next(c),e.closed)return}}catch(u){r={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}o(R$,"fromIterable");function z_(t){return new Wt(function(e){P$(t,e).catch(function(r){return e.error(r)})})}o(z_,"fromAsyncIterable");function N$(t){return z_(O0(t))}o(N$,"fromReadableStreamLike");function P$(t,e){var r,n,i,a;return A_(this,void 0,void 0,function(){var c,u;return v0(this,function(m){switch(m.label){case 0:m.trys.push([0,5,6,11]),r=M_(t),m.label=1;case 1:return[4,r.next()];case 2:if(n=m.sent(),!!n.done)return[3,4];if(c=n.value,e.next(c),e.closed)return[2];m.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=m.sent(),i={error:u},[3,11];case 6:return m.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:m.sent(),m.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(P$,"process");function Ai(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var a=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(a),!i)return a}o(Ai,"executeSchedule");function N0(t,e){return e===void 0&&(e=0),Dr(function(r,n){r.subscribe(Or(n,function(i){return Ai(n,t,function(){return n.next(i)},e)},function(){return Ai(n,t,function(){return n.complete()},e)},function(i){return Ai(n,t,function(){return n.error(i)},e)}))})}o(N0,"observeOn");function P0(t,e){return e===void 0&&(e=0),Dr(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}o(P0,"subscribeOn");function K_(t,e){return en(t).pipe(P0(e),N0(e))}o(K_,"scheduleObservable");function j_(t,e){return en(t).pipe(P0(e),N0(e))}o(j_,"schedulePromise");function G_(t,e){return new Wt(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}o(G_,"scheduleArray");function V_(t,e){return new Wt(function(r){var n;return Ai(r,e,function(){n=t[I0](),Ai(r,e,function(){var i,a,c;try{i=n.next(),a=i.value,c=i.done}catch(u){r.error(u);return}c?r.complete():r.next(a)},0,!0)}),function(){return At(n?.return)&&n.return()}})}o(V_,"scheduleIterable");function L0(t,e){if(!t)throw new Error("Iterable cannot be null");return new Wt(function(r){Ai(r,e,function(){var n=t[Symbol.asyncIterator]();Ai(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}o(L0,"scheduleAsyncIterable");function W_(t,e){return L0(O0(t),e)}o(W_,"scheduleReadableStreamLike");function J_(t,e){if(t!=null){if(T0(t))return K_(t,e);if(Pc(t))return G_(t,e);if(M0(t))return j_(t,e);if(C0(t))return L0(t,e);if(D0(t))return V_(t,e);if(R0(t))return W_(t,e)}throw k0(t)}o(J_,"scheduled");function Y_(t,e){return e?J_(t,e):en(t)}o(Y_,"from");var B0=Ic(function(t){return o(function(){t(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function X_(t){return t instanceof Date&&!isNaN(t)}o(X_,"isValidDate");function U0(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){n.next(t.call(e,a,i++))}))})}o(U0,"map");var L$=Array.isArray;function B$(t,e){return L$(e)?t.apply(void 0,Vi([],Kn(e))):t(e)}o(B$,"callOrApply");function Z_(t){return U0(function(e){return B$(t,e)})}o(Z_,"mapOneOrManyArgs");function Q_(t,e,r,n,i,a,c,u){var m=[],v=0,x=0,S=!1,O=o(function(){S&&!m.length&&!v&&e.complete()},"checkComplete"),R=o(function(P){return v<n?D(P):m.push(P)},"outerNext"),D=o(function(P){a&&e.next(P),v++;var J=!1;en(r(P,x++)).subscribe(Or(e,function(B){i?.(B),a?R(B):e.next(B)},function(){J=!0},void 0,function(){if(J)try{v--;for(var B=o(function(){var W=m.shift();c?Ai(e,c,function(){return D(W)}):D(W)},"_loop_1");m.length&&v<n;)B();O()}catch(W){e.error(W)}}))},"doInnerSub");return t.subscribe(Or(e,R,function(){S=!0,O()})),function(){u?.()}}o(Q_,"mergeInternals");function dl(t,e,r){return r===void 0&&(r=1/0),At(e)?dl(function(n,i){return U0(function(a,c){return e(n,a,i,c)})(en(t(n,i)))},r):(typeof e=="number"&&(r=e),Dr(function(n,i){return Q_(n,i,t,r)}))}o(dl,"mergeMap");function eE(t){return t===void 0&&(t=1/0),dl(Nc,t)}o(eE,"mergeAll");var U$=["addListener","removeListener"],$$=["addEventListener","removeEventListener"],F$=["on","off"];function pl(t,e,r,n){if(At(r)&&(n=r,r=void 0),n)return pl(t,e,r).pipe(Z_(n));var i=Kn(z$(t)?$$.map(function(u){return function(m){return t[u](e,m,r)}}):q$(t)?U$.map(tE(t,e)):H$(t)?F$.map(tE(t,e)):[],2),a=i[0],c=i[1];if(!a&&Pc(t))return dl(function(u){return pl(u,e,r)})(en(t));if(!a)throw new TypeError("Invalid event target");return new Wt(function(u){var m=o(function(){for(var v=[],x=0;x<arguments.length;x++)v[x]=arguments[x];return u.next(1<v.length?v:v[0])},"handler");return a(m),function(){return c(m)}})}o(pl,"fromEvent");function tE(t,e){return function(r){return function(n){return t[r](e,n)}}}o(tE,"toCommonHandlerRegistry");function q$(t){return At(t.addListener)&&At(t.removeListener)}o(q$,"isNodeStyleEventEmitter");function H$(t){return At(t.on)&&At(t.off)}o(H$,"isJQueryStyleEventEmitter");function z$(t){return At(t.addEventListener)&&At(t.removeEventListener)}o(z$,"isEventTarget");function ml(t,e,r){t===void 0&&(t=0),r===void 0&&(r=$_);var n=-1;return e!=null&&(S0(e)?r=e:n=e),new Wt(function(i){var a=X_(t)?+t-r.now():t;a<0&&(a=0);var c=0;return r.schedule(function(){i.closed||(i.next(c++),0<=n?this.schedule(void 0,n):i.complete())},a)})}o(ml,"timer");function Cg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=q_(t),n=H_(t,1/0),i=t;return i.length?i.length===1?en(i[0]):eE(n)(Y_(i,r)):A0}o(Cg,"merge");function rE(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){return t.call(e,a,i++)&&n.next(a)}))})}o(rE,"filter");function nE(t){return Dr(function(e,r){var n=!1;e.subscribe(Or(r,function(i){n=!0,r.next(i)},function(){n||r.next(t),r.complete()}))})}o(nE,"defaultIfEmpty");function iE(t){return t<=0?function(){return A0}:Dr(function(e,r){var n=0;e.subscribe(Or(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}o(iE,"take");function oE(t){return t===void 0&&(t=K$),Dr(function(e,r){var n=!1;e.subscribe(Or(r,function(i){n=!0,r.next(i)},function(){return n?r.complete():r.error(t())}))})}o(oE,"throwIfEmpty");function K$(){return new B0}o(K$,"defaultErrorFactory");function kg(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?rE(function(i,a){return t(i,a,n)}):Nc,iE(1),r?nE(e):oE(function(){return new B0}))}}o(kg,"first");function Ig(t,e){return Dr(function(r,n){var i=e??{},a=i.leading,c=a===void 0?!0:a,u=i.trailing,m=u===void 0?!1:u,v=!1,x=null,S=null,O=!1,R=o(function(){S?.unsubscribe(),S=null,m&&(J(),O&&n.complete())},"endThrottling"),D=o(function(){S=null,O&&n.complete()},"cleanupThrottling"),P=o(function(B){return S=en(t(B)).subscribe(Or(n,R,D))},"startThrottle"),J=o(function(){if(v){v=!1;var B=x;x=null,n.next(B),!O&&P(B)}},"send");r.subscribe(Or(n,function(B){v=!0,x=B,!(S&&!S.closed)&&(c?J():P(B))},function(){O=!0,!(m&&v&&S&&!S.closed)&&n.complete()}))})}o(Ig,"throttle");var sE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(sE||(sE={}));var bl;(function(t){t[t.NOT_REQUESTED=0]="NOT_REQUESTED",t[t.PENDING=1]="PENDING",t[t.PROCESSING=2]="PROCESSING",t[t.ANCHORED=3]="ANCHORED",t[t.FAILED=4]="FAILED"})(bl||(bl={}));var Og;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(Og||(Og={}));var as=class extends Wt{constructor(e,r){super(n=>{e.subscribe(n)}),this.state$=e,this._context=r}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:r}=this.state$.value;return(0,Dg.default)(e?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Og.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,Dg.default)(this.state$.value)}async sync(e={}){e={sync:yr.PREFER_CACHE,...e};let r=await this.api.loadStream(this.id,e);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(as,"Stream");function Lc(){return t=>{}}o(Lc,"StreamStatic");var hE=Lt(cE(),1);function uE(t){let e=new AbortController;if(t.length===0)throw Error("Need abort signals to create a merged abort signal");return t.some(r=>r.aborted)?(e.abort(),e.signal):(Cg(...t.map(r=>pl(r,"abort"))).pipe(kg()).subscribe(()=>{e.abort()}),e.signal)}o(uE,"mergeAbortSignals");var gl=class{constructor(e){let r=new AbortController;if(this.signal=r.signal,e<=0){r.abort();return}this._subscription=ml(e).subscribe(()=>{r.abort()})}clear(){this._subscription?.unsubscribe()}};o(gl,"TimedAbortSignal");async function lE(t,e){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return t.addEventListener("abort",n),t.aborted&&r.abort(),e(r.signal).finally(()=>{t.removeEventListener("abort",n)})}o(lE,"abortable");var j$=60*1e3*3;async function Hr(t,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{...e.headers,"Content-Type":"application/json"}});let r=e.timeout||j$,n=new gl(r),i=e.signal?uE([e.signal,n.signal]):n.signal,a=await lE(i,c=>(0,hE.default)(String(t),{...e,signal:c})).finally(()=>n.clear());if(!a.ok){let c=await a.text();throw new Error(`HTTP request to '${t}' failed with status '${a.statusText}': ${c}`)}return a.json()}o(Hr,"fetchJson");var vl=Lt(Sc(),1);Pi();function cs(t){let e=We.asCID(t);if(e)return e;if(typeof t=="string")return We.parse(t);if(t instanceof Uint8Array)return We.decode(t);throw new Error(`${t} cannot be converted to a CID`)}o(cs,"toCID");var dE=0,Xt=class{static streamIdFromState(e){return new rt(e.type,e.log[0].cid)}static serializeCommit(e){let r=(0,vl.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=r.jws.link.toString(),r.linkedBlock=kt(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=kt(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(e)&&(r.link=r.link.toString()),Xt.isAnchorCommit(e)&&(r.proof=r.proof.toString()),r.id&&(r.id=r.id.toString()),r.prev&&(r.prev=r.prev.toString()),e.header?.model&&(r.header.model=kt(e.header.model,"base64")),r)}static deserializeCommit(e){let r=(0,vl.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=cs(r.jws.link),r.linkedBlock=Ot(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=Ot(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(r)&&(r.link=cs(r.link)),Xt.isAnchorCommit(r)&&(r.proof=cs(r.proof)),r.id&&(r.id=cs(r.id)),r.prev&&(r.prev=cs(r.prev)),r.header?.model&&(r.header.model=Ot(r.header.model,"base64")),r)}static serializeState(e){let r=(0,vl.default)(e);return r.log=r.log.map(n=>({...n,cid:n.cid.toString()})),r.anchorStatus!=null&&(r.anchorStatus=bl[r.anchorStatus]),r.anchorProof!=null&&(r.anchorProof.txHash=r.anchorProof.txHash.toString(),r.anchorProof.root=r.anchorProof.root.toString()),e.metadata?.model&&(r.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(r.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=dE&&(r.metadata.unique=kt(r.metadata.unique,"base64")),r.doctype=En.nameByCode(r.type),r}static deserializeState(e){if(!e)return null;let r=(0,vl.default)(e);return r.doctype&&(r.type=En.codeByName(r.doctype),delete r.doctype),r.log=r.log.map(n=>({...n,cid:cs(n.cid)})),r.anchorProof&&(r.anchorProof.txHash=cs(r.anchorProof.txHash),r.anchorProof.root=cs(r.anchorProof.root)),r.anchorStatus&&(r.anchorStatus=bl[r.anchorStatus]),e.metadata?.model&&(r.metadata.model=rt.fromString(e.metadata.model)),e.next?.metadata?.model&&(r.next.metadata.model=rt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=dE&&(r.metadata.unique=Ot(e.metadata.unique,"base64")),r}static statesEqual(e,r){return JSON.stringify(Xt.serializeState(e))===JSON.stringify(Xt.serializeState(r))}static isStateSupersetOf(e,r){if(e.log.length<r.log.length)return!1;for(let n in r.log)if(!e.log[n].cid.equals(r.log[n].cid))return!1;return!(e.log.length===r.log.length&&e.anchorStatus!=r.anchorStatus)}static assertCommitLinksToState(e,r){let n=this.streamIdFromState(e);if(r.id&&!r.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${r.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!r.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${r.prev}`)}static async convertCommitToSignedCommitContainer(e,r){if(Xt.isSignedCommit(e)){let n=await r.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(Xt,"StreamUtils");var yl=class extends Sg{next(e){let r=this.value;Xt.statesEqual(r,e)||super.next(e)}};o(yl,"StreamStateSubject");var G$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},jn,Rg={anchor:!0,publish:!0,pin:!0,sync:yr.PREFER_CACHE},V$={sync:yr.PREFER_CACHE},pE={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Ng(t,e){if(typeof t?.schema=="string")try{Pt.fromString(t.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:t?.controllers,family:t?.family,schema:t?.schema?.toString(),tags:t?.tags};if(e)t?.deterministic||(r.unique=kt((0,gE.randomBytes)(12),"base64")),t?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(t?.deterministic!==void 0||t?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(t?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}o(Ng,"headerFromMetadata");async function mE(t){if(!t.did)throw new Error("No DID provided");return t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`)),t.did}o(mE,"getAuthenticatedDID");async function Pg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Pg,"throwReadOnlyError");var Gn=jn=o(class extends as{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,bE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(e,r,n,i={}){i={...Rg,...i},!n?.deterministic&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let a=i.asDID?{did:i.asDID}:e,c=await jn.makeGenesis(a,r,n);return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,c,i)}static async createFromGenesis(e,r,n={}){n={...Rg,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let i=r.data?await jn._signDagJWS(e,r):r;return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,i,n)}static async deterministic(e,r,n={}){if(n={...Rg,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let i=await jn.makeGenesis(e,null,r);return e.createStreamFromGenesis(jn.STREAM_TYPE_ID,i,n)}static async load(e,r,n={}){n={...V$,...n};let i=fn.from(r);if(i.type!=jn.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${jn.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async update(e,r,n={}){n={...pE,...n};let i=n.asDID?{did:n.asDID}:this.api,a=await this.makeCommit(i,e,r),c=await this.api.applyCommit(this.id,a,n);this.state$.next(c.state)}async patch(e,r={}){r={...pE,...r};let i={header:Ng(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=await jn._signDagJWS(this.api,i),c=await this.api.applyCommit(this.id,a,r);this.state$.next(c.state)}makeReadOnly(){this.update=Pg,this.patch=Pg,this.sync=Pg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(e,r,n){let i=await this._makeRawCommit(r,n);return jn._signDagJWS(e,i)}async _makeRawCommit(e,r){r||(r={});let n=Ng(r,!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=o0.compare(this.content,e),a=this.state.log[0];return{header:n,data:i,prev:this.tip,id:a.cid}}static async makeGenesis(e,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did){let c=await mE(e);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let i=Ng(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:i};return qa(c),c}let a={data:r,header:i};return jn._signDagJWS(e,a)}static async _signDagJWS(e,r){return(await mE(e)).createDagJWS(r)}},"TileDocument");Gn.STREAM_TYPE_NAME="tile";Gn.STREAM_TYPE_ID=0;Gn=jn=G$([Lc()],Gn);var AE=Lt(xE(),1);function nF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(nF,"_checkPrivateRedeclaration");function iF(t,e){return e.get?e.get.call(t):e.value}o(iF,"_classApplyDescriptorGet");function oF(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}o(oF,"_classApplyDescriptorSet");function EE(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(EE,"_classExtractFieldDescriptor");function $g(t,e){var r=EE(t,e,"get");return iF(t,r)}o($g,"_classPrivateFieldGet");function wE(t,e,r){nF(t,e),e.set(t,r)}o(wE,"_classPrivateFieldInit");function _E(t,e,r){var n=EE(t,e,"set");return oF(t,n,r),r}o(_E,"_classPrivateFieldSet");function sF(t){return typeof t=="string"||Pt.isInstance(t)||rt.isInstance(t)?{streamId:t}:{streamId:t.streamId,genesis:t.genesis}}o(sF,"keyToQuery");function Fg(t){return typeof t=="string"?fn.from(t).toString():Pt.isInstance(t)||rt.isInstance(t)?t.toString():t.streamId.toString()}o(Fg,"keyToString");async function aF(t){let e=await Gn.makeGenesis({},null,{...t,deterministic:!0}),r=await rt.fromGenesis("tile",e);return{genesis:e,streamId:r}}o(aF,"getDeterministicQuery");var fF=o(()=>Promise.resolve([]),"tempBatchLoadFn"),F0=new WeakMap,qg=new WeakMap,xl=class extends AE.default{cache(e){if(!$g(this,qg))return!1;let r=e.id.toString();return this.clear(r).prime(r,e),!0}async create(e,r,n){let i=await Gn.create($g(this,F0),e,r,n);return this.cache(i),i}async deterministic(e,r){let n=await aF(e);try{return await super.load(n)}catch{let a=await Gn.createFromGenesis($g(this,F0),n.genesis,r);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,r,n,i){let a=Fg(e);this.clear(a);let c=await this.load({streamId:a});return await c.update(r,n,i),c}constructor(e){super(fF,{cache:!0,cacheKeyFn:Fg,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),wE(this,F0,{writable:!0,value:void 0}),wE(this,qg,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(r.map(sF),e.multiqueryTimeout);return r.map(i=>{let a=Fg(i),c=n[a];return c||new Error(`Failed to load stream: ${a}`)})},_E(this,F0,e.ceramic),_E(this,qg,!!e.cache)}};o(xl,"TileLoader");function Hg(t){return typeof t=="string"?rt.fromString(t):t}o(Hg,"typeStreamID");function SE(t,e){let r=new URL(t);for(let[n,i]of Object.entries(e))rt.isInstance(i)?r.searchParams.set(n,i.toString()):typeof i=="object"?r.searchParams.set(n,JSON.stringify(i)):r.searchParams.set(n,i);return r}o(SE,"serializeObjectToSearchParams");function zg(t){let e={};for(let[r,n]of Object.entries(t))rt.isInstance(n)?e[r]=n.toString():e[r]=n;return e}o(zg,"serializeObjectForHttpPost");var tn=class extends Wt{constructor(e,r,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=ml(0,n).pipe(Ig(()=>this._syncState(this.id,{sync:yr.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new yl(e),this._apiUrl=new URL(r)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,r){let n=await tn._load(e,this._apiUrl,r);this.state$.next(Xt.deserializeState(n))}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,r,n,i,a){let c=new URL("./streams",e),{state:u}=await Hr(c,{method:"post",body:{type:r,genesis:Xt.serializeCommit(n),opts:i}});return new tn(Xt.deserializeState(u),e,a)}static async applyCommit(e,r,n,i,a){let c=new URL("./commits",e),{state:u}=await Hr(c,{method:"post",body:{streamId:r.toString(),commit:Xt.serializeCommit(n),opts:i}});return new tn(Xt.deserializeState(u),e,a)}static async _load(e,r,n){let i=SE(new URL(`./streams/${e}`,r),n),{state:a}=await Hr(i);return a}static async load(e,r,n,i){let a=await tn._load(e,r,i);return new tn(Xt.deserializeState(a),r,n)}static async loadStreamCommits(e,r){let n=new URL(`./commits/${e}`,r),{commits:i}=await Hr(n);return i.map(a=>({cid:a.cid,value:Xt.deserializeCommit(a.value)}))}complete(){this.state$.complete()}};o(tn,"Document");var sf;(function(t){t[t.PREFER_CACHE=0]="PREFER_CACHE",t[t.SYNC_ALWAYS=1]="SYNC_ALWAYS",t[t.NEVER_SYNC=2]="NEVER_SYNC",t[t.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(sf||(sf={}));var Kg=Lt(Sc(),1);var ME;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(ME||(ME={}));var jg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(jg||(jg={}));var wl=class extends Wt{constructor(e,r){super(n=>{e.subscribe(n)}),this.state$=e,this._context=r}get id(){return new rt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:r}=this.state$.value;return(0,Kg.default)(e?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Pt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Pt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===jg.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,Kg.default)(this.state$.value)}async sync(e={}){e={sync:sf.PREFER_CACHE,...e};let r=await this.api.loadStream(this.id,e);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};o(wl,"Stream");function TE(){return t=>{}}o(TE,"StreamStatic");function CE(t){if(typeof t=="string"&&t.includes("@")){let[e,r]=t.split("@");if(!e||!r)throw new Error("Invalid accountId provided");return new Ks({address:e,chainId:r})}return new Ks(t)}o(CE,"normalizeAccountId");var cF="(?:%[0-9a-fA-F]{2})",kE=`(?:[a-zA-Z0-9._-]|${cF})`,uF="([a-z0-9]+)",lF=`((?:${kE}*:)*(${kE}+))`,IE="[a-zA-Z0-9_.:%-]",hF=`;${IE}+=${IE}*`,dF=`((${hF})*)`,pF="(/[^#?]*)?",mF="([?][^#]*)?",bF="(#.*)?",gF=new RegExp(`^did:${uF}:${lF}${dF}${pF}${mF}${bF}$`);function DE(t){if(t===""||!t)return null;let e=t.match(gF);if(e){let r={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:t};if(e[4]){let n=e[4].slice(1).split(";");r.params={};for(let i of n){let a=i.split("=");r.params[a[0]]=a[1]}}return e[6]&&(r.path=e[6]),e[7]&&(r.query=e[7].slice(1)),e[8]&&(r.fragment=e[8].slice(1)),r}return null}o(DE,"parse");var RE=Lt(Sc(),1),vF=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},af,Gg=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),OE={anchor:!1,publish:!0,sync:sf.PREFER_CACHE},Vg={anchor:!0,publish:!0},yF={sync:sf.PREFER_CACHE},ff=af=o(class extends wl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,RE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(e,r,n={}){n={...OE,...n};let i=CE(r),a=af.makeGenesis(i);return af.fromGenesis(e,a,n)}static async fromGenesis(e,r,n={}){return n={...OE,...n},e.createStreamFromGenesis(af.STREAM_TYPE_ID,r,n)}async setDid(e,r,n={}){n={...Vg,...n};let i=typeof e=="string"?e.trim():e.id;if(DE(i)?.did!==i)throw new Error(`DID is not valid: '${i}'`);let c=await r.createLink(i);return this.setDidProof(c,n)}async setDidProof(e,r={}){r={...Vg,...r};let n=this.makeCommit(e),i=await this.api.applyCommit(this.id,n,r);this.state$.next(i.state)}async clearDid(e,r={}){r={...Vg,...r};let n=await e.createLink("");return this.setDidProof(n,r)}static async load(e,r,n={}){n={...yF,...n};let i=fn.from(r);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=Gg,this.setDid=Gg,this.sync=Gg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");ff.STREAM_TYPE_NAME="caip10-link";ff.STREAM_TYPE_ID=1;ff=af=vF([TE()],ff);Pi();Aa();var m9=Lt(d9(),1),hq=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},yo,dq={sync:yr.PREFER_CACHE};async function p9(t){if(t.did==null)throw new Error("No DID provided");t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`))}o(p9,"_ensureAuthenticated");async function pq(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(pq,"throwReadOnlyError");var Xs=yo=o(class extends as{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:yo.MODEL}}static async create(e,r,n){yo.assertComplete(r);let i={publish:!0,anchor:!0,pin:!0,sync:yr.NEVER_SYNC,throwOnInvalidCommit:!0},a=await yo._makeGenesis(e,r,n);return await e.createStreamFromGenesis(yo.STREAM_TYPE_ID,a,i)}static assertComplete(e,r){if(!e.name)throw r?new Error(`Model with StreamID ${r.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw r?new Error(`Model ${e.name} (${r.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw r?new Error(`Model ${e.name} (${r.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static async load(e,r,n={}){n={...dq,...n};let i=fn.from(r);if(i.type!=yo.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${yo.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return await e.loadStream(i,n)}static async _makeGenesis(e,r,n){let i=await this._makeRawGenesis(e,r,n);return yo._signDagJWS(e,i)}static async _makeRawGenesis(e,r,n){if(r==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)await p9(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:yo.MODEL.bytes};return{data:r,header:i}}makeReadOnly(){this.sync=pq,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,r){return await p9(e),e.did.createDagJWS(r)}},"Model");Xs.STREAM_TYPE_NAME="model";Xs.STREAM_TYPE_ID=2;Xs.MODEL=function(){let t=qa("model-v1"),e=m9.default.encode(t,"identity"),r=Ho(cc,e),n=We.createV1(cc,r);return new rt("UNLOADABLE",n)}();Xs=yo=hq([Lc()],Xs);var v9=Lt(Oa(),1);var mq=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(c=t[u])&&(a=(i<3?c(a):i>3?c(e,r,a):c(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ji,bq={anchor:!0,publish:!0,pin:!0,sync:yr.NEVER_SYNC,syncTimeoutSeconds:0},gq={anchor:!1,publish:!1,pin:!0,sync:yr.PREFER_CACHE},vq={sync:yr.PREFER_CACHE},b9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function g9(t){if(t.did==null)throw new Error("No DID provided");t.did.authenticated||(await t.did.authenticate(),t.loggerProvider&&t.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${t.did.id}`))}o(g9,"_ensureAuthenticated");async function Yg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Yg,"throwReadOnlyError");var uf=Ji=o(class extends as{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,r,n,i={}){i={...bq,...i};let a=i.asDID?{did:i.asDID}:e,c=await Ji._makeGenesis(a,r,n);return e.createStreamFromGenesis(Ji.STREAM_TYPE_ID,c,i)}static async single(e,r,n={}){n={...gq,...n};let i=n.asDID?{did:n.asDID}:e;r={...r,deterministic:!0};let a=await Ji._makeGenesis(i,null,r);return e.createStreamFromGenesis(Ji.STREAM_TYPE_ID,a,n)}static async load(e,r,n={}){n={...vq,...n};let i=fn.from(r);if(i.type!=Ji.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${Ji.STREAM_TYPE_NAME}' stream, but to a ${i.typeName}`);return e.loadStream(i,n)}async replace(e,r={}){r={...b9,...r};let n=r.asDID?{did:r.asDID}:this.api,i=await this._makeCommit(n,e),a=await this.api.applyCommit(this.id,i,r);this.state$.next(a.state)}async patch(e,r={}){r={...b9,...r};let n={data:e,prev:this.tip,id:this.id.cid},i=await Ji._signDagJWS(this.api,n),a=await this.api.applyCommit(this.id,i,r);this.state$.next(a.state)}makeReadOnly(){this.replace=Yg,this.patch=Yg,this.sync=Yg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,r){let n=this._makeRawCommit(r);return Ji._signDagJWS(e,n)}_makeRawCommit(e){return{data:o0.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(e,r,n){let i=await this._makeRawGenesis(e,r,n);return n.deterministic?(qa(i),i):Ji._signDagJWS(e,i)}static async _makeRawGenesis(e,r,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 g9(e),i=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let a={controllers:[i],model:n.model.bytes};return n.deterministic||(a.unique=(0,v9.randomBytes)(12)),{data:r,header:a}}static async _signDagJWS(e,r){return await g9(e),e.did.createDagJWS(r)}},"ModelInstanceDocument");uf.STREAM_TYPE_NAME="MID";uf.STREAM_TYPE_ID=3;uf=Ji=mq([Lc()],uf);var Al=class{constructor(e){this._apiUrl=e}async add(e,r){let n={};r&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);await Hr(i,{method:"post",body:n})}async rm(e,r){let n=new URL(`./pins/${e}`,this._apiUrl);await Hr(n,{method:"delete",body:{opts:r}})}async ls(e){let r=new URL("./pins",this._apiUrl);e&&(r=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=await Hr(r),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[a++],done:!1})}}}}}};o(Al,"RemotePinApi");var Sl=class{constructor(e){this._fetchJson=Hr,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:zg(e)})).count}async query(e){let r=await this._fetchJson(this._collectionURL,{method:"POST",body:zg(e)});return{edges:r.edges.map(i=>({cursor:i.cursor,node:Xt.deserializeState(i.node)})),pageInfo:r.pageInfo}}};o(Sl,"RemoteIndexApi");var Ml=class{constructor(e,r){this._apiUrl=e,this._getDidFn=r,this._fetchJson=Hr,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,r,n){let i=n?{models:n.map(c=>c.toString())}:void 0,a=await e.createJWS({code:r,requestPath:this.getModelsUrl().pathname,requestBody:i});return`${a.signatures[0].protected}.${a.payload}.${a.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let r=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),r,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=>rt.fromString(n))}async stopIndexingModels(e){let r=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),r,e)}})}};o(Ml,"RemoteAdminApi");var yq="/api/v0/",xq="http://localhost:7007",wq={syncInterval:5e3},_q={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},Eq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},y9={sync:yr.PREFER_CACHE},Tl=class{constructor(e=xq,r={}){this._config={...wq,...r},this._apiUrl=new URL(yq,e),this._streamCache=new Map,this.context={api:this},this.pin=new Al(this._apiUrl),this.index=new Sl(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new Ml(this._apiUrl,n),this._streamConstructors={[ff.STREAM_TYPE_ID]:ff,[Xs.STREAM_TYPE_ID]:Xs,[uf.STREAM_TYPE_ID]:uf,[Gn.STREAM_TYPE_ID]:Gn}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,r,n={}){n={...Eq,...n};let i=await tn.createFromGenesis(this._apiUrl,e,r,n,this._config.syncInterval),a=this._streamCache.get(i.id.toString());return a?(Xt.statesEqual(i.state,a.state)||a.next(i.state),this.buildStreamFromDocument(a)):(this._streamCache.set(i.id.toString(),i),this.buildStreamFromDocument(i))}async loadStream(e,r={}){r={...y9,...r};let n=fn.from(e),i=this._streamCache.get(n.baseID.toString());return i?await i._syncState(n,r):(i=await tn.load(n,this._apiUrl,this._config.syncInterval,r),this._streamCache.set(i.id.toString(),i)),this.buildStreamFromDocument(i)}async multiQuery(e,r){let n=e.map(c=>({...c,streamId:typeof c.streamId=="string"?c.streamId:c.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),a=await Hr(i,{method:"post",body:{queries:n,timeout:r}});return Object.entries(a).reduce((c,u)=>{let[m,v]=u,x=Xt.deserializeState(v),S=new tn(x,this._apiUrl,this._config.syncInterval);return c[m]=this.buildStreamFromDocument(S),c},{})}loadStreamCommits(e){let r=Hg(e);return tn.loadStreamCommits(r,this._apiUrl)}async applyCommit(e,r,n={}){n={..._q,...n};let i=Hg(e),a=await tn.applyCommit(this._apiUrl,i,r,n,this._config.syncInterval),c=this._streamCache.get(i.toString());return c?(c.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(i.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,r={}){r={...y9,...r};let{anchorStatus:n}=await Hr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:r}});return n}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let r=new tn(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(r)}buildStreamFromDocument(e){let r=e.state.type,n=this._streamConstructors[r];if(!n)throw new Error(`Failed to find constructor for stream ${r}`);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 Hr(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}};o(Tl,"CeramicClient");var Ut;(function(t){t.assertEqual=i=>i;function e(i){}o(e,"assertIs"),t.assertIs=e;function r(i){throw new Error}o(r,"assertNever"),t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let c of i)a[c]=c;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),c={};for(let u of a)c[u]=i[u];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&a.push(c);return a},t.find=(i,a)=>{for(let c of i)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}o(n,"joinValues"),t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ut||(Ut={}));var Fe=Ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zs=o(t=>{switch(typeof t){case"undefined":return Fe.undefined;case"string":return Fe.string;case"number":return isNaN(t)?Fe.nan:Fe.number;case"boolean":return Fe.boolean;case"function":return Fe.function;case"bigint":return Fe.bigint;case"symbol":return Fe.symbol;case"object":return Array.isArray(t)?Fe.array:t===null?Fe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Fe.promise:typeof Map<"u"&&t instanceof Map?Fe.map:typeof Set<"u"&&t instanceof Set?Fe.set:typeof Date<"u"&&t instanceof Date?Fe.date:Fe.object;default:return Fe.unknown}},"getParsedType"),Ne=Ut.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"]),Aq=o(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Si=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 r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=o(a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let u=n,m=0;for(;m<c.path.length;){let v=c.path[m];m===c.path.length-1?(u[v]=u[v]||{_errors:[]},u[v]._errors.push(r(c))):u[v]=u[v]||{_errors:[]},u=u[v],m++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ut.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(Si,"ZodError");Si.create=t=>new Si(t);var kl=o((t,e)=>{let r;switch(t.code){case Ne.invalid_type:t.received===Fe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ne.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ut.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ut.joinValues(t.keys,", ")}`;break;case Ne.invalid_union:r="Invalid input";break;case Ne.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ut.joinValues(t.options)}`;break;case Ne.invalid_enum_value:r=`Invalid enum value. Expected ${Ut.joinValues(t.options)}, received '${t.received}'`;break;case Ne.invalid_arguments:r="Invalid function arguments";break;case Ne.invalid_return_type:r="Invalid function return type";break;case Ne.invalid_date:r="Invalid date";break;case Ne.invalid_string:typeof t.validation=="object"?"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ut.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ne.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(t.minimum)}`:r="Invalid input";break;case Ne.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(t.maximum)}`:r="Invalid input";break;case Ne.custom:r="Invalid input";break;case Ne.invalid_intersection_types:r="Intersection results could not be merged";break;case Ne.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ne.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ut.assertNever(t)}return{message:r}},"errorMap"),E9=kl;function Sq(t){E9=t}o(Sq,"setErrorMap");function G0(){return E9}o(G0,"getErrorMap");var V0=o(t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],c={...i,path:a},u="",m=n.filter(v=>!!v).slice().reverse();for(let v of m)u=v(c,{data:e,defaultError:u}).message;return{...i,path:a,message:i.message||u}},"makeIssue"),Mq=[];function Ke(t,e){let r=V0({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,G0(),kl].filter(n=>!!n)});t.common.issues.push(r)}o(Ke,"addIssueToContext");var Rr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){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,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Rr.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:c}=i;if(a.status==="aborted"||c.status==="aborted")return gt;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),(typeof c.value<"u"||i.alwaysSet)&&(n[a.value]=c.value)}return{status:e.value,value:n}}};o(Rr,"ParseStatus");var gt=Object.freeze({status:"aborted"}),A9=o(t=>({status:"dirty",value:t}),"DIRTY"),rn=o(t=>({status:"valid",value:t}),"OK"),Xg=o(t=>t.status==="aborted","isAborted"),Zg=o(t=>t.status==="dirty","isDirty"),W0=o(t=>t.status==="valid","isValid"),J0=o(t=>typeof Promise!==void 0&&t instanceof Promise,"isAsync"),Rt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Rt||(Rt={}));var Vn=class{constructor(e,r,n,i){this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(Vn,"ParseInputLazyPath");var x9=o((t,e)=>{if(W0(e))return{success:!0,data:e.value};{if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Si(t.common.issues);return{success:!1,error:r}}},"handleResult");function Tt(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||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((c,u)=>c.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:n??u.defaultError}:{message:r??u.defaultError},"customMap"),description:i}}o(Tt,"processCreateParams");var xt=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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Zs(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Zs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rr,ctx:{common:e.parent.common,data:e.data,parsedType:Zs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(J0(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zs(e)},a=this._parseSync({data:e,path:i.path,parent:i});return x9(i,a)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zs(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(J0(i)?i:Promise.resolve(i));return x9(n,a)}refine(e,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,a)=>{let c=e(i),u=o(()=>a.addIssue({code:Ne.custom,...n(i)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(m=>m?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mn({schema:this,typeName:pt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Jn.create(this)}nullable(){return Eo.create(this)}nullish(){return this.optional().nullable()}array(){return Sn.create(this)}promise(){return ds.create(this)}or(e){return na.create([this,e])}and(e){return ia.create(this,e)}transform(e){return new Mn({schema:this,typeName:pt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ua({innerType:this,defaultValue:r,typeName:pt.ZodDefault})}brand(){return new Cl({typeName:pt.ZodBranded,type:this,...Tt(void 0)})}catch(e){let r=typeof e=="function"?e:()=>e;return new mf({innerType:this,defaultValue:r,typeName:pt.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return la.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(xt,"ZodType");var Tq=/^c[^\s-]{8,}$/i,Cq=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,kq=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Iq=o(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}:\\d{2})|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Mi=class extends xt{constructor(){super(...arguments),this._regex=(e,r,n)=>this.refinement(i=>e.test(i),{validation:r,code:Ne.invalid_string,...Rt.errToObj(n)}),this.nonempty=e=>this.min(1,Rt.errToObj(e)),this.trim=()=>new Mi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Fe.string){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_type,expected:Fe.string,received:a.parsedType}),gt}let n=new Rr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let c=e.data.length>a.value,u=e.data.length<a.value;(c||u)&&(i=this._getOrReturnCtx(e,i),c?Ke(i,{code:Ne.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):u&&Ke(i,{code:Ne.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")kq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"email",code:Ne.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Cq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"uuid",code:Ne.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Tq.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"cuid",code:Ne.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ke(i,{validation:"url",code:Ne.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"regex",code:Ne.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Iq(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.invalid_string,validation:"datetime",message:a.message}),n.dirty()):Ut.assertNever(a);return{status:n.value,value:e.data}}_addCheck(e){return new Mi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Rt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Rt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Rt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Rt.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...Rt.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Rt.errToObj(r)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Rt.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Rt.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Rt.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Rt.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Rt.errToObj(r)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};o(Mi,"ZodString");Mi.create=t=>{var e;return new Mi({checks:[],typeName:pt.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tt(t)})};function Dq(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)}o(Dq,"floatSafeRemainder");var Yi=class extends xt{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)!==Fe.number){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_type,expected:Fe.number,received:a.parsedType}),gt}let n,i=new Rr;for(let a of this._def.checks)a.kind==="int"?Ut.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Dq(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:Ne.not_finite,message:a.message}),i.dirty()):Ut.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Rt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Rt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Rt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Rt.toString(r))}setLimit(e,r,n,i){return new Yi({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Rt.toString(i)}]})}_addCheck(e){return new Yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Rt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Rt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Rt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Rt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Rt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Rt.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Rt.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};o(Yi,"ZodNumber");Yi.create=t=>new Yi({checks:[],typeName:pt.ZodNumber,coerce:t?.coerce||!1,...Tt(t)});var Qs=class extends xt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Fe.bigint){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.bigint,received:n.parsedType}),gt}return rn(e.data)}};o(Qs,"ZodBigInt");Qs.create=t=>{var e;return new Qs({typeName:pt.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tt(t)})};var ea=class extends xt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Fe.boolean){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.boolean,received:n.parsedType}),gt}return rn(e.data)}};o(ea,"ZodBoolean");ea.create=t=>new ea({typeName:pt.ZodBoolean,coerce:t?.coerce||!1,...Tt(t)});var xo=class extends xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Fe.date){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_type,expected:Fe.date,received:a.parsedType}),gt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Ke(a,{code:Ne.invalid_date}),gt}let n=new Rr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:Ne.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Ut.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xo({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Rt.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Rt.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};o(xo,"ZodDate");xo.create=t=>new xo({checks:[],coerce:t?.coerce||!1,typeName:pt.ZodDate,...Tt(t)});var lf=class extends xt{_parse(e){if(this._getType(e)!==Fe.symbol){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.symbol,received:n.parsedType}),gt}return rn(e.data)}};o(lf,"ZodSymbol");lf.create=t=>new lf({typeName:pt.ZodSymbol,...Tt(t)});var ta=class extends xt{_parse(e){if(this._getType(e)!==Fe.undefined){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.undefined,received:n.parsedType}),gt}return rn(e.data)}};o(ta,"ZodUndefined");ta.create=t=>new ta({typeName:pt.ZodUndefined,...Tt(t)});var ra=class extends xt{_parse(e){if(this._getType(e)!==Fe.null){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.null,received:n.parsedType}),gt}return rn(e.data)}};o(ra,"ZodNull");ra.create=t=>new ra({typeName:pt.ZodNull,...Tt(t)});var ls=class extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return rn(e.data)}};o(ls,"ZodAny");ls.create=t=>new ls({typeName:pt.ZodAny,...Tt(t)});var wo=class extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rn(e.data)}};o(wo,"ZodUnknown");wo.create=t=>new wo({typeName:pt.ZodUnknown,...Tt(t)});var Ti=class extends xt{_parse(e){let r=this._getOrReturnCtx(e);return Ke(r,{code:Ne.invalid_type,expected:Fe.never,received:r.parsedType}),gt}};o(Ti,"ZodNever");Ti.create=t=>new Ti({typeName:pt.ZodNever,...Tt(t)});var hf=class extends xt{_parse(e){if(this._getType(e)!==Fe.undefined){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.void,received:n.parsedType}),gt}return rn(e.data)}};o(hf,"ZodVoid");hf.create=t=>new hf({typeName:pt.ZodVoid,...Tt(t)});var Sn=class extends xt{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==Fe.array)return Ke(r,{code:Ne.invalid_type,expected:Fe.array,received:r.parsedType}),gt;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,u=r.data.length<i.exactLength.value;(c||u)&&(Ke(r,{code:c?Ne.too_big:Ne.too_small,minimum:u?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Ke(r,{code:Ne.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Ke(r,{code:Ne.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all(r.data.map((c,u)=>i.type._parseAsync(new Vn(r,c,r.path,u)))).then(c=>Rr.mergeArray(n,c));let a=r.data.map((c,u)=>i.type._parseSync(new Vn(r,c,r.path,u)));return Rr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new Sn({...this._def,minLength:{value:e,message:Rt.toString(r)}})}max(e,r){return new Sn({...this._def,maxLength:{value:e,message:Rt.toString(r)}})}length(e,r){return new Sn({...this._def,exactLength:{value:e,message:Rt.toString(r)}})}nonempty(e){return this.min(1,e)}};o(Sn,"ZodArray");Sn.create=(t,e)=>new Sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pt.ZodArray,...Tt(e)});var Y0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Y0||(Y0={}));var w9=o(t=>e=>new er({...t,shape:()=>({...t.shape(),...e})}),"AugmentFactory");function qc(t){if(t instanceof er){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Jn.create(qc(n))}return new er({...t._def,shape:()=>e})}else return t instanceof Sn?Sn.create(qc(t.element)):t instanceof Jn?Jn.create(qc(t.unwrap())):t instanceof Eo?Eo.create(qc(t.unwrap())):t instanceof Wn?Wn.create(t.items.map(e=>qc(e))):t}o(qc,"deepPartialify");var er=class extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=w9(this._def),this.extend=w9(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ut.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Fe.object){let v=this._getOrReturnCtx(e);return Ke(v,{code:Ne.invalid_type,expected:Fe.object,received:v.parsedType}),gt}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ti&&this._def.unknownKeys==="strip"))for(let v in i.data)c.includes(v)||u.push(v);let m=[];for(let v of c){let x=a[v],S=i.data[v];m.push({key:{status:"valid",value:v},value:x._parse(new Vn(i,S,i.path,v)),alwaysSet:v in i.data})}if(this._def.catchall instanceof Ti){let v=this._def.unknownKeys;if(v==="passthrough")for(let x of u)m.push({key:{status:"valid",value:x},value:{status:"valid",value:i.data[x]}});else if(v==="strict")u.length>0&&(Ke(i,{code:Ne.unrecognized_keys,keys:u}),n.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let v=this._def.catchall;for(let x of u){let S=i.data[x];m.push({key:{status:"valid",value:x},value:v._parse(new Vn(i,S,i.path,x)),alwaysSet:x in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let v=[];for(let x of m){let S=await x.key;v.push({key:S,value:await x.value,alwaysSet:x.alwaysSet})}return v}).then(v=>Rr.mergeObjectSync(n,v)):Rr.mergeObjectSync(n,m)}get shape(){return this._def.shape()}strict(e){return Rt.errToObj,new er({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,c,u;let m=(c=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(u=Rt.errToObj(e).message)!==null&&u!==void 0?u:m}:{message:m}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}setKey(e,r){return this.augment({[e]:r})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Y0.mergeShapes(this._def.shape(),e._def.shape()),typeName:pt.ZodObject})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let r={};return Ut.objectKeys(e).map(n=>{this.shape[n]&&(r[n]=this.shape[n])}),new er({...this._def,shape:()=>r})}omit(e){let r={};return Ut.objectKeys(this.shape).map(n=>{Ut.objectKeys(e).indexOf(n)===-1&&(r[n]=this.shape[n])}),new er({...this._def,shape:()=>r})}deepPartial(){return qc(this)}partial(e){let r={};if(e)return Ut.objectKeys(this.shape).map(n=>{Ut.objectKeys(e).indexOf(n)===-1?r[n]=this.shape[n]:r[n]=this.shape[n].optional()}),new er({...this._def,shape:()=>r});for(let n in this.shape){let i=this.shape[n];r[n]=i.optional()}return new er({...this._def,shape:()=>r})}required(e){let r={};if(e)Ut.objectKeys(this.shape).map(n=>{if(Ut.objectKeys(e).indexOf(n)===-1)r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Jn;)a=a._def.innerType;r[n]=a}});else for(let n in this.shape){let a=this.shape[n];for(;a instanceof Jn;)a=a._def.innerType;r[n]=a}return new er({...this._def,shape:()=>r})}keyof(){return S9(Ut.objectKeys(this.shape))}};o(er,"ZodObject");er.create=(t,e)=>new er({shape:()=>t,unknownKeys:"strip",catchall:Ti.create(),typeName:pt.ZodObject,...Tt(e)});er.strictCreate=(t,e)=>new er({shape:()=>t,unknownKeys:"strict",catchall:Ti.create(),typeName:pt.ZodObject,...Tt(e)});er.lazycreate=(t,e)=>new er({shape:t,unknownKeys:"strip",catchall:Ti.create(),typeName:pt.ZodObject,...Tt(e)});var na=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let u of a)if(u.result.status==="valid")return u.result;for(let u of a)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let c=a.map(u=>new Si(u.ctx.common.issues));return Ke(r,{code:Ne.invalid_union,unionErrors:c}),gt}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async a=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let a,c=[];for(let m of n){let v={...r,common:{...r.common,issues:[]},parent:null},x=m._parseSync({data:r.data,path:r.path,parent:v});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:v}),v.common.issues.length&&c.push(v.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let u=c.map(m=>new Si(m));return Ke(r,{code:Ne.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(na,"ZodUnion");na.create=(t,e)=>new na({options:t,typeName:pt.ZodUnion,...Tt(e)});var j0=o(t=>t instanceof sa?j0(t.schema):t instanceof Mn?j0(t.innerType()):t instanceof aa?[t.value]:t instanceof fa?t.options:t instanceof ca?Object.keys(t.enum):t instanceof ua?j0(t._def.innerType):t instanceof ta?[void 0]:t instanceof ra?[null]:null,"getDiscriminator"),df=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.object)return Ke(r,{code:Ne.invalid_type,expected:Fe.object,received:r.parsedType}),gt;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(Ke(r,{code:Ne.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,r,n){let i=new Map;for(let a of r){let c=j0(a.shape[e]);if(!c)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of c){if(i.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);i.set(u,a)}}return new df({typeName:pt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Tt(n)})}};o(df,"ZodDiscriminatedUnion");function Qg(t,e){let r=Zs(t),n=Zs(e);if(t===e)return{valid:!0,data:t};if(r===Fe.object&&n===Fe.object){let i=Ut.objectKeys(e),a=Ut.objectKeys(t).filter(u=>i.indexOf(u)!==-1),c={...t,...e};for(let u of a){let m=Qg(t[u],e[u]);if(!m.valid)return{valid:!1};c[u]=m.data}return{valid:!0,data:c}}else if(r===Fe.array&&n===Fe.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let c=t[a],u=e[a],m=Qg(c,u);if(!m.valid)return{valid:!1};i.push(m.data)}return{valid:!0,data:i}}else return r===Fe.date&&n===Fe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}o(Qg,"mergeValues");var ia=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=o((a,c)=>{if(Xg(a)||Xg(c))return gt;let u=Qg(a.value,c.value);return u.valid?((Zg(a)||Zg(c))&&r.dirty(),{status:r.value,value:u.data}):(Ke(n,{code:Ne.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(([a,c])=>i(a,c)):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(ia,"ZodIntersection");ia.create=(t,e,r)=>new ia({left:t,right:e,typeName:pt.ZodIntersection,...Tt(r)});var Wn=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.array)return Ke(n,{code:Ne.invalid_type,expected:Fe.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return Ke(n,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&(Ke(n,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=n.data.map((c,u)=>{let m=this._def.items[u]||this._def.rest;return m?m._parse(new Vn(n,c,n.path,u)):null}).filter(c=>!!c);return n.common.async?Promise.all(a).then(c=>Rr.mergeArray(r,c)):Rr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Wn({...this._def,rest:e})}};o(Wn,"ZodTuple");Wn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wn({items:t,typeName:pt.ZodTuple,rest:null,...Tt(e)})};var oa=class extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.object)return Ke(n,{code:Ne.invalid_type,expected:Fe.object,received:n.parsedType}),gt;let i=[],a=this._def.keyType,c=this._def.valueType;for(let u in n.data)i.push({key:a._parse(new Vn(n,u,n.path,u)),value:c._parse(new Vn(n,n.data[u],n.path,u))});return n.common.async?Rr.mergeObjectAsync(r,i):Rr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xt?new oa({keyType:e,valueType:r,typeName:pt.ZodRecord,...Tt(n)}):new oa({keyType:Mi.create(),valueType:e,typeName:pt.ZodRecord,...Tt(r)})}};o(oa,"ZodRecord");var pf=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.map)return Ke(n,{code:Ne.invalid_type,expected:Fe.map,received:n.parsedType}),gt;let i=this._def.keyType,a=this._def.valueType,c=[...n.data.entries()].map(([u,m],v)=>({key:i._parse(new Vn(n,u,n.path,[v,"key"])),value:a._parse(new Vn(n,m,n.path,[v,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let m of c){let v=await m.key,x=await m.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&r.dirty(),u.set(v.value,x.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let m of c){let v=m.key,x=m.value;if(v.status==="aborted"||x.status==="aborted")return gt;(v.status==="dirty"||x.status==="dirty")&&r.dirty(),u.set(v.value,x.value)}return{status:r.value,value:u}}}};o(pf,"ZodMap");pf.create=(t,e,r)=>new pf({valueType:e,keyType:t,typeName:pt.ZodMap,...Tt(r)});var _o=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Fe.set)return Ke(n,{code:Ne.invalid_type,expected:Fe.set,received:n.parsedType}),gt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Ke(n,{code:Ne.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Ke(n,{code:Ne.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function c(m){let v=new Set;for(let x of m){if(x.status==="aborted")return gt;x.status==="dirty"&&r.dirty(),v.add(x.value)}return{status:r.value,value:v}}o(c,"finalizeSet");let u=[...n.data.values()].map((m,v)=>a._parse(new Vn(n,m,n.path,v)));return n.common.async?Promise.all(u).then(m=>c(m)):c(u)}min(e,r){return new _o({...this._def,minSize:{value:e,message:Rt.toString(r)}})}max(e,r){return new _o({...this._def,maxSize:{value:e,message:Rt.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};o(_o,"ZodSet");_o.create=(t,e)=>new _o({valueType:t,minSize:null,maxSize:null,typeName:pt.ZodSet,...Tt(e)});var hs=class extends xt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.function)return Ke(r,{code:Ne.invalid_type,expected:Fe.function,received:r.parsedType}),gt;function n(u,m){return V0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G0(),kl].filter(v=>!!v),issueData:{code:Ne.invalid_arguments,argumentsError:m}})}o(n,"makeArgsIssue");function i(u,m){return V0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G0(),kl].filter(v=>!!v),issueData:{code:Ne.invalid_return_type,returnTypeError:m}})}o(i,"makeReturnsIssue");let a={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof ds?rn(async(...u)=>{let m=new Si([]),v=await this._def.args.parseAsync(u,a).catch(O=>{throw m.addIssue(n(u,O)),m}),x=await c(...v);return await this._def.returns._def.type.parseAsync(x,a).catch(O=>{throw m.addIssue(i(x,O)),m})}):rn((...u)=>{let m=this._def.args.safeParse(u,a);if(!m.success)throw new Si([n(u,m.error)]);let v=c(...m.data),x=this._def.returns.safeParse(v,a);if(!x.success)throw new Si([i(v,x.error)]);return x.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new hs({...this._def,args:Wn.create(e).rest(wo.create())})}returns(e){return new hs({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new hs({args:e||Wn.create([]).rest(wo.create()),returns:r||wo.create(),typeName:pt.ZodFunction,...Tt(n)})}};o(hs,"ZodFunction");var sa=class extends xt{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(sa,"ZodLazy");sa.create=(t,e)=>new sa({getter:t,typeName:pt.ZodLazy,...Tt(e)});var aa=class extends xt{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Ke(r,{code:Ne.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(aa,"ZodLiteral");aa.create=(t,e)=>new aa({value:t,typeName:pt.ZodLiteral,...Tt(e)});function S9(t,e){return new fa({values:t,typeName:pt.ZodEnum,...Tt(e)})}o(S9,"createZodEnum");var fa=class extends xt{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{expected:Ut.joinValues(n),received:r.parsedType,code:Ne.invalid_type}),gt}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{received:r.data,code:Ne.invalid_enum_value,options:n}),gt}return rn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}};o(fa,"ZodEnum");fa.create=S9;var ca=class extends xt{_parse(e){let r=Ut.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Fe.string&&n.parsedType!==Fe.number){let i=Ut.objectValues(r);return Ke(n,{expected:Ut.joinValues(i),received:n.parsedType,code:Ne.invalid_type}),gt}if(r.indexOf(e.data)===-1){let i=Ut.objectValues(r);return Ke(n,{received:n.data,code:Ne.invalid_enum_value,options:i}),gt}return rn(e.data)}get enum(){return this._def.values}};o(ca,"ZodNativeEnum");ca.create=(t,e)=>new ca({values:t,typeName:pt.ZodNativeEnum,...Tt(e)});var ds=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Fe.promise&&r.common.async===!1)return Ke(r,{code:Ne.invalid_type,expected:Fe.promise,received:r.parsedType}),gt;let n=r.parsedType===Fe.promise?r.data:Promise.resolve(r.data);return rn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(ds,"ZodPromise");ds.create=(t,e)=>new ds({type:t,typeName:pt.ZodPromise,...Tt(e)});var Mn=class extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let c=i.transform(n.data);return n.common.async?Promise.resolve(c).then(u=>this._def.schema._parseAsync({data:u,path:n.path,parent:n})):this._def.schema._parseSync({data:c,path:n.path,parent:n})}let a={addIssue:c=>{Ke(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="refinement"){let c=o(u=>{let m=i.refinement(u,a);if(n.common.async)return Promise.resolve(m);if(m 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"&&r.dirty(),c(u.value),{status:r.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"&&r.dirty(),c(u.value).then(()=>({status:r.value,value:u.value}))))}if(i.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!W0(c))return c;let u=i.transform(c.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>W0(c)?Promise.resolve(i.transform(c.value,a)).then(u=>({status:r.value,value:u})):c);Ut.assertNever(i)}};o(Mn,"ZodEffects");Mn.create=(t,e,r)=>new Mn({schema:t,typeName:pt.ZodEffects,effect:e,...Tt(r)});Mn.createWithPreprocess=(t,e,r)=>new Mn({schema:e,effect:{type:"preprocess",transform:t},typeName:pt.ZodEffects,...Tt(r)});var Jn=class extends xt{_parse(e){return this._getType(e)===Fe.undefined?rn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Jn,"ZodOptional");Jn.create=(t,e)=>new Jn({innerType:t,typeName:pt.ZodOptional,...Tt(e)});var Eo=class extends xt{_parse(e){return this._getType(e)===Fe.null?rn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Eo,"ZodNullable");Eo.create=(t,e)=>new Eo({innerType:t,typeName:pt.ZodNullable,...Tt(e)});var ua=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Fe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(ua,"ZodDefault");ua.create=(t,e)=>new ua({innerType:t,typeName:pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tt(e)});var mf=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.innerType._parse({data:r.data,path:r.path,parent:r});return J0(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.defaultValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};o(mf,"ZodCatch");mf.create=(t,e)=>new mf({innerType:t,typeName:pt.ZodCatch,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tt(e)});var bf=class extends xt{_parse(e){if(this._getType(e)!==Fe.nan){let n=this._getOrReturnCtx(e);return Ke(n,{code:Ne.invalid_type,expected:Fe.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}};o(bf,"ZodNaN");bf.create=t=>new bf({typeName:pt.ZodNaN,...Tt(t)});var Oq=Symbol("zod_brand"),Cl=class extends xt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(Cl,"ZodBranded");var la=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?gt:a.status==="dirty"?(r.dirty(),A9(a.value)):this._def.out._parseAsync({data:a.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"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new la({in:e,out:r,typeName:pt.ZodPipeline})}};o(la,"ZodPipeline");var M9=o((t,e={},r)=>t?ls.create().superRefine((n,i)=>{if(!t(n)){let a=typeof e=="function"?e(n):e,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:r})}}):ls.create(),"custom"),Rq={object:er.lazycreate},pt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline"})(pt||(pt={}));var Nq=o((t,e={message:`Input not instance of ${t.name}`})=>M9(r=>r instanceof t,e,!0),"instanceOfType"),T9=Mi.create,C9=Yi.create,Pq=bf.create,Lq=Qs.create,k9=ea.create,Bq=xo.create,Uq=lf.create,$q=ta.create,Fq=ra.create,qq=ls.create,Hq=wo.create,zq=Ti.create,Kq=hf.create,jq=Sn.create,Gq=er.create,Vq=er.strictCreate,Wq=na.create,Jq=df.create,Yq=ia.create,Xq=Wn.create,Zq=oa.create,Qq=pf.create,eH=_o.create,tH=hs.create,rH=sa.create,nH=aa.create,iH=fa.create,oH=ca.create,sH=ds.create,_9=Mn.create,aH=Jn.create,fH=Eo.create,cH=Mn.createWithPreprocess,uH=la.create,lH=o(()=>T9().optional(),"ostring"),hH=o(()=>C9().optional(),"onumber"),dH=o(()=>k9().optional(),"oboolean"),pH={string:t=>Mi.create({...t,coerce:!0}),number:t=>Yi.create({...t,coerce:!0}),boolean:t=>ea.create({...t,coerce:!0}),bigint:t=>Qs.create({...t,coerce:!0}),date:t=>xo.create({...t,coerce:!0})},mH=gt,L=Object.freeze({__proto__:null,defaultErrorMap:kl,setErrorMap:Sq,getErrorMap:G0,makeIssue:V0,EMPTY_PATH:Mq,addIssueToContext:Ke,ParseStatus:Rr,INVALID:gt,DIRTY:A9,OK:rn,isAborted:Xg,isDirty:Zg,isValid:W0,isAsync:J0,get util(){return Ut},ZodParsedType:Fe,getParsedType:Zs,ZodType:xt,ZodString:Mi,ZodNumber:Yi,ZodBigInt:Qs,ZodBoolean:ea,ZodDate:xo,ZodSymbol:lf,ZodUndefined:ta,ZodNull:ra,ZodAny:ls,ZodUnknown:wo,ZodNever:Ti,ZodVoid:hf,ZodArray:Sn,get objectUtil(){return Y0},ZodObject:er,ZodUnion:na,ZodDiscriminatedUnion:df,ZodIntersection:ia,ZodTuple:Wn,ZodRecord:oa,ZodMap:pf,ZodSet:_o,ZodFunction:hs,ZodLazy:sa,ZodLiteral:aa,ZodEnum:fa,ZodNativeEnum:ca,ZodPromise:ds,ZodEffects:Mn,ZodTransformer:Mn,ZodOptional:Jn,ZodNullable:Eo,ZodDefault:ua,ZodCatch:mf,ZodNaN:bf,BRAND:Oq,ZodBranded:Cl,ZodPipeline:la,custom:M9,Schema:xt,ZodSchema:xt,late:Rq,get ZodFirstPartyTypeKind(){return pt},coerce:pH,any:qq,array:jq,bigint:Lq,boolean:k9,date:Bq,discriminatedUnion:Jq,effect:_9,enum:iH,function:tH,instanceof:Nq,intersection:Yq,lazy:rH,literal:nH,map:Qq,nan:Pq,nativeEnum:oH,never:zq,null:Fq,nullable:fH,number:C9,object:Gq,oboolean:dH,onumber:hH,optional:aH,ostring:lH,pipeline:uH,preprocess:cH,promise:sH,record:Zq,set:eH,strictObject:Vq,string:T9,symbol:Uq,transformer:_9,tuple:Xq,undefined:$q,union:Wq,unknown:Hq,void:Kq,NEVER:mH,ZodIssueCode:Ne,quotelessJson:Aq,ZodError:Si});var Z0=L.array(L.string().or(L.record(L.any()))),Zte=L.object({type:L.string().optional(),narrative:L.string().optional()}),Q0=L.string().or(L.object({id:L.string(),type:L.string(),caption:L.string().optional()})),bH=L.object({type:L.string().min(1).or(L.string().array().nonempty()),latitude:L.number(),longitude:L.number()}),gH=L.object({type:L.string().min(1).or(L.string().array().nonempty()),addressCountry:L.string().optional(),addressCountryCode:L.string().optional(),addressRegion:L.string().optional(),addressLocality:L.string().optional(),streetAddress:L.string().optional(),postOfficeBoxNumber:L.string().optional(),postalCode:L.string().optional(),geo:bH.optional()}),vH=L.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(L.string()),D9=L.object({type:L.string().min(1).or(L.string().array().nonempty()),identifier:L.string(),identifierType:vH}),Il=L.string().or(L.object({id:L.string().optional(),type:L.string().or(L.string().array().nonempty().optional()),name:L.string().optional(),url:L.string().optional(),phone:L.string().optional(),description:L.string().optional(),endorsement:L.any().array().optional(),image:Q0.optional(),email:L.string().email().optional(),address:gH.optional(),otherIdentifier:D9.array().optional(),official:L.string().optional(),parentOrg:L.any().optional(),familyName:L.string().optional(),givenName:L.string().optional(),additionalName:L.string().optional(),patronymicName:L.string().optional(),honorificPrefix:L.string().optional(),honorificSuffix:L.string().optional(),familyNamePrefix:L.string().optional(),dateOfBirth:L.string().optional()}).catchall(L.any())),e2=L.object({id:L.string().optional()}).catchall(L.any()),yH=L.object({type:L.string(),id:L.string()}).catchall(L.any()),xH=L.object({id:L.string(),type:L.string()}).catchall(L.any()),wH=L.object({id:L.string(),type:L.string()}).catchall(L.any()),X0=L.object({"@context":Z0,id:L.string().optional(),type:L.string().array().nonempty(),issuer:Il,issuanceDate:L.string(),expirationDate:L.string().optional(),credentialSubject:e2.or(e2.array()),credentialStatus:yH.optional(),credentialSchema:xH.array().optional(),refreshService:wH.optional()}).catchall(L.any()),Ao=L.object({type:L.string(),created:L.string(),challenge:L.string().optional(),domain:L.string().optional(),nonce:L.string().optional(),proofPurpose:L.string(),verificationMethod:L.string(),jws:L.string().optional()}).catchall(L.any()),Dl=X0.extend({proof:Ao.or(Ao.array())}),_H=L.object({"@context":Z0,id:L.string().optional(),type:L.string().or(L.string().array().nonempty()),verifiableCredential:Dl.or(Dl.array()).optional(),holder:L.string().optional()}).catchall(L.any()),r2=_H.extend({proof:Ao.or(Ao.array())}),O9=L.object({kty:L.string(),crv:L.string(),x:L.string(),y:L.string().optional(),n:L.string().optional(),d:L.string()}),EH=L.object({alg:L.string(),iv:L.string(),tag:L.string(),epk:O9.partial().optional(),kid:L.string().optional(),apv:L.string().optional(),apu:L.string().optional()}),AH=L.object({header:EH,encrypted_key:L.string()}),SH=L.object({protected:L.string(),iv:L.string(),ciphertext:L.string(),tag:L.string(),aad:L.string().optional(),recipients:AH.array().optional()}),gf=L.string().or(L.object({"@context":Z0.optional(),id:L.string(),type:L.string(),controller:L.string(),publicKeyJwk:O9.optional(),publicKeyBase58:L.string().optional(),blockChainAccountId:L.string().optional()}).catchall(L.any())),MH=L.object({id:L.string(),type:L.string().or(L.string().array().nonempty()),serviceEndpoint:L.any().or(L.any().array().nonempty())}).catchall(L.any()),tre=L.object({"@context":Z0,id:L.string(),alsoKnownAs:L.string().optional(),controller:L.string().or(L.string().array().nonempty()).optional(),verificationMethod:gf.array().optional(),authentication:gf.array().optional(),assertionMethod:gf.array().optional(),keyAgreement:gf.array().optional(),capabilityInvocation:gf.array().optional(),capabilityDelegation:gf.array().optional(),publicKey:gf.array().optional(),service:MH.array().optional(),proof:Ao.or(Ao.array()).optional()}).catchall(L.any()),TH=L.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(L.string()),ep=L.object({type:L.string().array().nonempty(),targetCode:L.string().optional(),targetDescription:L.string().optional(),targetName:L.string(),targetFramework:L.string().optional(),targetType:TH.optional(),targetUrl:L.string()}),CH=L.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"]),kH=CH.or(L.string()),IH=L.object({id:L.string().optional(),narrative:L.string().optional()}).catchall(L.any()),DH=L.object({id:L.string(),type:L.string().array().nonempty(),endorsementComment:L.string().optional()}),OH=X0.extend({credentialSubject:DH,proof:Ao.or(Ao.array()).optional()}),RH=L.object({id:L.string(),"@language":L.string().optional(),version:L.string().optional()}),NH=L.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(L.string()),PH=L.object({id:L.string(),type:L.string().array().nonempty(),alignment:ep.array().optional(),description:L.string().optional(),level:L.string().optional(),name:L.string(),points:L.string().optional()}).catchall(L.any()),LH=L.object({id:L.string(),type:L.string().array().nonempty(),alignment:ep.array().optional(),allowedValue:L.string().array().optional(),name:L.string(),requiredLevel:L.string().optional(),requiredValue:L.string().optional(),resultType:NH,rubricCriterionLevel:PH.array().optional(),valueMax:L.string().optional(),valueMin:L.string().optional()}).catchall(L.any()),BH=L.object({id:L.string().optional(),type:L.string().array().nonempty(),alignment:ep.array().optional(),achievementType:kH.optional(),creator:Il.optional(),creditsAvailable:L.number().optional(),criteria:IH,description:L.string(),endorsement:OH.array().optional(),fieldOfStudy:L.string().optional(),humanCode:L.string().optional(),image:Q0.optional(),"@language":L.string().optional(),name:L.string(),otherIdentifier:D9.array().optional(),related:RH.array().optional(),resultDescription:LH.array().optional(),specialization:L.string().optional(),tag:L.string().array().optional(),version:L.string().optional()}).catchall(L.any()),UH=L.object({type:L.string(),hashed:L.boolean(),identityHash:L.string(),identityType:L.string(),salt:L.string().optional()}),$H=L.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),FH=L.object({type:L.string().array().nonempty(),achievedLevel:L.string().optional(),alignment:ep.array().optional(),resultDescription:L.string().optional(),status:$H.optional(),value:L.string().optional()}).catchall(L.any()),I9=L.object({id:L.string().optional(),type:L.string().array().nonempty(),activityEndDate:L.string().optional(),activityStartDate:L.string().optional(),creditsEarned:L.number().optional(),achievement:BH.optional(),identifier:UH.array().optional(),image:Q0.optional(),licenseNumber:L.string().optional(),narrative:L.string().optional(),result:FH.array().optional(),role:L.string().optional(),source:Il.optional(),term:L.string().optional()}).catchall(L.any()),qH=L.object({id:L.string().optional(),type:L.string().array().nonempty(),narrative:L.string().optional(),name:L.string().optional(),description:L.string().optional(),genre:L.string().optional(),audience:L.string().optional()}).catchall(L.any()),HH=X0.extend({name:L.string().optional(),description:L.string().optional(),image:Q0.optional(),credentialSubject:I9.or(I9.array()),endorsement:X0.array().optional(),evidence:qH.array().optional()}),nre=HH.extend({proof:Ao.or(Ao.array())}),ore=L.object({checks:L.string().array(),warnings:L.string().array(),errors:L.string().array()}),R9=L.enum(["Success","Failed","Error"]),sre=R9.enum,are=L.object({check:L.string(),status:R9,message:L.string().optional(),details:L.string().optional()}),fre=L.object({title:L.string().optional(),createdAt:L.string().optional(),issuer:Il.optional(),issuee:Il.optional(),credentialSubject:e2.optional()}),cre=L.object({id:L.string(),uri:L.string()}).catchall(L.any()),hre=L.object({limit:L.number(),cursor:L.string().optional(),sort:L.string().optional()}),vf=L.object({cursor:L.string().optional(),hasMore:L.boolean()}),N9=L.object({encryptedRecord:SH,fields:L.string().array()}).catchall(L.any()),dre=vf.extend({records:N9.array()}),zH=N9.extend({id:L.string()}),pre=vf.extend({records:zH.array()}),Hc=L.object({profileId:L.string().min(3).max(40),displayName:L.string().default(""),shortBio:L.string().default(""),bio:L.string().default(""),did:L.string(),email:L.string().optional(),image:L.string().optional(),heroImage:L.string().optional(),websiteLink:L.string().optional(),isServiceProfile:L.boolean().default(!1).optional(),type:L.string().optional(),notificationsWebhook:L.string().url().startsWith("https://").optional()}),bre=vf.extend({records:Hc.array()}),gre=L.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),vre=L.object({uri:L.string(),to:L.string(),from:L.string(),sent:L.string().datetime(),received:L.string().datetime().optional()}),KH=L.enum(["DRAFT","LIVE"]),yre=L.object({uri:L.string(),name:L.string().optional(),type:L.string().optional(),category:L.string().optional(),status:KH.optional(),autoConnectRecipients:L.boolean().optional()}),xre=L.object({to:Hc,from:L.string(),received:L.string().optional()}),wre=L.object({endpoint:L.string(),name:L.string(),did:L.string().optional()}),_re=L.object({ttlSeconds:L.number().optional(),totalUses:L.number().optional()}),jH=L.object({endpoint:L.string()}),Ere=L.object({signingAuthority:jH,relationship:L.object({name:L.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:L.string()})}),GH=L.enum(["live","stale","withdrawn"]),VH=L.object({read:L.object({anonymize:L.boolean().optional(),credentials:L.object({categories:L.record(L.object({required:L.boolean()})).default({})}).default({}),personal:L.record(L.object({required:L.boolean()})).default({})}).default({}),write:L.object({credentials:L.object({categories:L.record(L.object({required:L.boolean()})).default({})}).default({}),personal:L.record(L.object({required:L.boolean()})).default({})}).default({})}),P9=L.object({contract:VH,owner:Hc,name:L.string(),subtitle:L.string().optional(),description:L.string().optional(),reasonForAccessing:L.string().optional(),image:L.string().optional(),uri:L.string(),createdAt:L.string(),updatedAt:L.string(),expiresAt:L.string().optional()}),Are=vf.extend({records:P9.omit({owner:!0}).array()}),WH=L.object({credentials:L.object({categories:L.record(L.string().array()).default({})}),personal:L.record(L.string()).default({}),date:L.string()}),Sre=vf.extend({records:WH.array()}),L9=L.object({sharing:L.boolean().optional(),shared:L.string().array().optional(),shareAll:L.boolean().optional(),shareUntil:L.string().optional()}),B9=L.object({read:L.object({anonymize:L.boolean().optional(),credentials:L.object({shareAll:L.boolean().optional(),sharing:L.boolean().optional(),categories:L.record(L9).default({})}).default({}),personal:L.record(L.string()).default({})}).default({}),write:L.object({credentials:L.object({categories:L.record(L.boolean()).default({})}).default({}),personal:L.record(L.boolean()).default({})}).default({})}),Mre=vf.extend({records:L.object({expiresAt:L.string().optional(),oneTime:L.boolean().optional(),terms:B9,contract:P9,uri:L.string(),consenter:Hc,status:GH}).array()}),Tre=L.object({read:L.object({anonymize:L.boolean().optional(),credentials:L.object({categories:L.record(L.object({required:L.boolean().optional()})).optional()}).optional(),personal:L.record(L.object({required:L.boolean().optional()})).optional()}).optional(),write:L.object({credentials:L.object({categories:L.record(L.object({required:L.boolean().optional()})).optional()}).optional(),personal:L.record(L.object({required:L.boolean().optional()})).optional()}).optional()}),Cre=L.object({anonymize:L.boolean().optional(),credentials:L.object({categories:L.record(L.boolean()).optional()}).optional(),personal:L.record(L.boolean()).optional()}),JH=L.object({read:L.object({anonymize:L.boolean().optional(),credentials:L.object({shareAll:L.boolean().optional(),sharing:L.boolean().optional(),categories:L.record(L9.optional()).optional()}).optional(),personal:L.record(L.string()).optional()}).optional(),write:L.object({credentials:L.object({categories:L.record(L.boolean()).optional()}).optional(),personal:L.record(L.boolean()).optional()}).optional()}),t2=L.enum(["consent","update","sync","withdraw"]),kre=L.object({terms:JH.optional(),action:t2.or(t2.array()).optional(),date:L.object({$gt:L.string()}).or(L.object({$lt:L.string()})).or(L.object({$eq:L.string()})).optional(),expiresAt:L.object({$gt:L.string()}).or(L.object({$lt:L.string()})).or(L.object({$eq:L.string()})).optional(),oneTime:L.boolean().optional()}),U9=L.object({expiresAt:L.string().optional(),oneTime:L.boolean().optional(),terms:B9.optional(),id:L.string(),action:t2,date:L.string()}),Ire=vf.extend({records:U9.array()}),YH=L.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),XH=L.object({title:L.string().optional(),body:L.string().optional()}),ZH=L.object({vcUris:L.array(L.string()).optional(),vpUris:L.array(L.string()).optional(),transaction:U9.optional()}),Dre=L.object({type:YH,to:Hc.partial().and(L.object({did:L.string()})),from:Hc.partial().and(L.object({did:L.string()})),message:XH.optional(),data:ZH.optional(),sent:L.string().datetime().optional()});var tp=o(t=>`lc:ceramic:${t}`,"streamIdToCeramicURI");var n2=L.string().refine(t=>t.split(":").length===3&&t.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(t=>t.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var rp=o(async(t,{ceramicEndpoint:e,defaultContentFamily:r})=>{let n=new Tl(e),i=o(async(R,D,P,J)=>t.invoke.didResolver(R,J),"learnCardResolver"),a={...y8.getResolver(),web:i},c=new Va({resolver:a});n.did=c;let u=t.invoke.getKey(),m=new rl(r8(u));n.did.setProvider(m),await n.did.authenticate();let v=new xl({ceramic:n}),x=o(async(R,D={},P={},J)=>{if(!R)throw new Error("content is required");if(D.controllers||(D.controllers=[n.did.id]),D.family||(D.family=r),"pin"in P||(P.pin=!0),J?.encrypt){t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",J);let W=J?.recipients||[];J?.controllersCanDecrypt&&(W=[...W,...D.controllers]),R=await n?.did?.createDagJWE(R,$9.default.uniq(W))}return t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,D,P),(await Gn.create(n,R,D,P)).id.toString()},"publishContentToCeramic"),S=o(async R=>{let D=(await v.load(R))?.content;if(t.debug?.("learnCard.read.get.readContentFromCeramic",D),D?.ciphertext)try{return await c.decryptDagJWE(D)}catch(P){throw t.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",P),new Error("Could not decrypt credential - DID not authorized.")}return D},"readContentFromCeramic"),O=o(async(R,D)=>(await Dl.or(r2).parseAsync(R),tp(await x(R,{},{},D))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,D)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(D)),uploadEncrypted:async(R,D,P)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(D,{encrypt:!0,controllersCanDecrypt:!0,...P?{recipients:P.recipients}:{}}))},read:{get:async(R,D)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!D)return;let P=await n2.spa(D);if(!P.success)return;let J=P.data.split(":")[2];try{return await Dl.or(r2).parseAsync(await S(J))}catch(B){R.debug?.(B);return}}},methods:{publishContentToCeramic:async(R,D,P)=>tp(await x(D,{},{},P)),readContentFromCeramic:async(R,D)=>S(D),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var QH=rp;
|
|
818
818
|
/*!
|
|
819
819
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
820
820
|
* (c) 2017-2021 Joachim Wester
|