@learncard/ceramic-plugin 1.0.3 → 1.0.4
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 +264 -570
- package/dist/ceramic-plugin.cjs.development.js.map +3 -3
- package/dist/ceramic-plugin.cjs.production.min.js +86 -86
- package/dist/ceramic-plugin.cjs.production.min.js.map +3 -3
- package/dist/ceramic-plugin.esm.js +264 -570
- package/dist/ceramic-plugin.esm.js.map +3 -3
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var uI=Object.create;var tu=Object.defineProperty;var lI=Object.getOwnPropertyDescriptor;var hI=Object.getOwnPropertyNames;var dI=Object.getPrototypeOf,pI=Object.prototype.hasOwnProperty;var o=(t,e)=>tu(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)tu(t,r,{get:e[r],enumerable:!0})},Ey=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hI(e))!pI.call(t,i)&&i!==r&&tu(t,i,{get:()=>e[i],enumerable:!(n=lI(e,i))||n.enumerable});return t};var Pt=(t,e,r)=>(r=t!=null?uI(dI(t)):{},Ey(e||!t||!t.__esModule?tu(r,"default",{value:t,enumerable:!0}):r,t)),mh=t=>Ey(tu({},"__esModule",{value:!0}),t);var Ay=De((Of,ru)=>{(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,p="__lodash_placeholder__",v=1,y=2,S=4,O=1,R=2,I=1,N=2,J=4,L=8,V=16,Z=32,Y=64,oe=128,K=256,q=512,j=30,le="...",T=800,h=16,x=1,b=2,l=3,m=1/0,_=9007199254740991,A=17976931348623157e292,E=0/0,g=4294967295,C=g-1,P=g>>>1,w=[["ary",oe],["bind",I],["bindKey",N],["curry",L],["curryRight",V],["flip",q],["partial",Z],["partialRight",Y],["rearg",K]],k="[object Arguments]",he="[object Array]",D="[object AsyncFunction]",Q="[object Boolean]",se="[object Date]",F="[object DOMException]",$="[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]",G="[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]",U="[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",bf="A-Z\\xc0-\\xd6\\xd8-\\xde",gf="\\ufe0e\\ufe0f",vf=To+Co+ko+Io,np="['\u2019]",u7="["+ti+"]",i2="["+vf+"]",kl="["+Xi+"]",o2="\\d+",l7="["+Zi+"]",s2="["+Qi+"]",a2="[^"+ti+vf+o2+Zi+Qi+bf+"]",ip="\\ud83c[\\udffb-\\udfff]",h7="(?:"+kl+"|"+ip+")",f2="[^"+ti+"]",op="(?:\\ud83c[\\udde6-\\uddff]){2}",sp="[\\ud800-\\udbff][\\udc00-\\udfff]",yf="["+bf+"]",c2="\\u200d",u2="(?:"+s2+"|"+a2+")",d7="(?:"+yf+"|"+a2+")",l2="(?:"+np+"(?:d|ll|m|re|s|t|ve))?",h2="(?:"+np+"(?:D|LL|M|RE|S|T|VE))?",d2=h7+"?",p2="["+gf+"]?",p7="(?:"+c2+"(?:"+[f2,op,sp].join("|")+")"+p2+d2+")*",m7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",b7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",m2=p2+d2+p7,g7="(?:"+[l7,op,sp].join("|")+")"+m2,v7="(?:"+[f2+kl+"?",kl,op,sp,u7].join("|")+")",y7=RegExp(np,"g"),x7=RegExp(kl,"g"),ap=RegExp(ip+"(?="+ip+")|"+v7+m2,"g"),w7=RegExp([yf+"?"+s2+"+"+l2+"(?="+[i2,yf,"$"].join("|")+")",d7+"+"+h2+"(?="+[i2,yf+u2,"$"].join("|")+")",yf+"?"+u2+"+"+l2,yf+"+"+h2,b7,m7,o2,g7].join("|"),"g"),_7=RegExp("["+c2+ti+Xi+gf+"]"),E7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,A7=["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"],S7=-1,ir={};ir[ie]=ir[U]=ir[X]=ir[me]=ir[ye]=ir[we]=ir[ke]=ir[It]=ir[Ue]=!0,ir[k]=ir[he]=ir[pr]=ir[Q]=ir[ue]=ir[se]=ir[$]=ir[ee]=ir[ae]=ir[Ae]=ir[re]=ir[ve]=ir[G]=ir[pe]=ir[Re]=!1;var tr={};tr[k]=tr[he]=tr[pr]=tr[ue]=tr[Q]=tr[se]=tr[ie]=tr[U]=tr[X]=tr[me]=tr[ye]=tr[ae]=tr[Ae]=tr[re]=tr[ve]=tr[G]=tr[pe]=tr[Ce]=tr[we]=tr[ke]=tr[It]=tr[Ue]=!0,tr[$]=tr[ee]=tr[Re]=!1;var M7={\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"},T7={"&":"&","<":"<",">":">",'"':""","'":"'"},C7={"&":"&","<":"<",">":">",""":'"',"'":"'"},k7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I7=parseFloat,D7=parseInt,b2=typeof global=="object"&&global&&global.Object===Object&&global,O7=typeof self=="object"&&self&&self.Object===Object&&self,Er=b2||O7||Function("return this")(),fp=typeof Of=="object"&&Of&&!Of.nodeType&&Of,la=fp&&typeof ru=="object"&&ru&&!ru.nodeType&&ru,g2=la&&la.exports===fp,cp=g2&&b2.process,ri=function(){try{var de=la&&la.require&&la.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 R7(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(R7,"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 N7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(N7,"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 hs(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(hs,"arrayFilter");function Il(de,Ee){var xe=de==null?0:de.length;return!!xe&&xf(de,Ee,0)>-1}o(Il,"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 ds(de,Ee){for(var xe=-1,qe=Ee.length,bt=de.length;++xe<qe;)de[bt+xe]=Ee[xe];return de}o(ds,"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 P7(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(P7,"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 L7=dp("length");function B7(de){return de.split("")}o(B7,"asciiToArray");function U7(de){return de.match(lt)||[]}o(U7,"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 Dl(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(Dl,"baseFindIndex");function xf(de,Ee,xe){return Ee===Ee?Y7(de,Ee,xe):Dl(de,M2,xe)}o(xf,"baseIndexOf");function $7(de,Ee,xe,qe){for(var bt=xe-1,Ht=de.length;++bt<Ht;)if(qe(de[bt],Ee))return bt;return-1}o($7,"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 F7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(F7,"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 q7(de,Ee){return sr(Ee,function(xe){return[xe,de[xe]]})}o(q7,"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 Fc(de,Ee){return de.has(Ee)}o(Fc,"cacheHas");function I2(de,Ee){for(var xe=-1,qe=de.length;++xe<qe&&xf(Ee,de[xe],0)>-1;);return xe}o(I2,"charsStartIndex");function D2(de,Ee){for(var xe=de.length;xe--&&xf(Ee,de[xe],0)>-1;);return xe}o(D2,"charsEndIndex");function H7(de,Ee){for(var xe=de.length,qe=0;xe--;)de[xe]===Ee&&++qe;return qe}o(H7,"countHolders");var z7=pp(M7),K7=pp(T7);function j7(de){return"\\"+k7[de]}o(j7,"escapeStringChar");function G7(de,Ee){return de==null?t:de[Ee]}o(G7,"getValue");function wf(de){return _7.test(de)}o(wf,"hasUnicode");function V7(de){return E7.test(de)}o(V7,"hasUnicodeWord");function W7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(W7,"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 ps(de,Ee){for(var xe=-1,qe=de.length,bt=0,Ht=[];++xe<qe;){var xr=de[xe];(xr===Ee||xr===p)&&(de[xe]=p,Ht[bt++]=xe)}return Ht}o(ps,"replaceHolders");function Ol(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=qe}),xe}o(Ol,"setToArray");function J7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=[qe,qe]}),xe}o(J7,"setToPairs");function Y7(de,Ee,xe){for(var qe=xe-1,bt=de.length;++qe<bt;)if(de[qe]===Ee)return qe;return-1}o(Y7,"strictIndexOf");function X7(de,Ee,xe){for(var qe=xe+1;qe--;)if(de[qe]===Ee)return qe;return qe}o(X7,"strictLastIndexOf");function _f(de){return wf(de)?Q7(de):L7(de)}o(_f,"stringSize");function Ci(de){return wf(de)?eA(de):B7(de)}o(Ci,"stringToArray");function R2(de){for(var Ee=de.length;Ee--&&Zn.test(de.charAt(Ee)););return Ee}o(R2,"trimmedEndIndex");var Z7=pp(C7);function Q7(de){for(var Ee=ap.lastIndex=0;ap.test(de);)++Ee;return Ee}o(Q7,"unicodeSize");function eA(de){return de.match(ap)||[]}o(eA,"unicodeToArray");function tA(de){return de.match(w7)||[]}o(tA,"unicodeWords");var rA=o(function de(Ee){Ee=Ee==null?Er:ms.defaults(Er.Object(),Ee,ms.pick(Er,A7));var xe=Ee.Array,qe=Ee.Date,bt=Ee.Error,Ht=Ee.Function,xr=Ee.Math,Zt=Ee.Object,yp=Ee.RegExp,nA=Ee.String,ii=Ee.TypeError,Rl=xe.prototype,iA=Ht.prototype,Ef=Zt.prototype,Nl=Ee["__core-js_shared__"],Pl=iA.toString,Vt=Ef.hasOwnProperty,oA=0,N2=function(){var s=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ll=Ef.toString,sA=Pl.call(Zt),aA=Er._,fA=yp("^"+Pl.call(Vt).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bl=g2?Ee.Buffer:t,bs=Ee.Symbol,Ul=Ee.Uint8Array,P2=Bl?Bl.allocUnsafe:t,$l=O2(Zt.getPrototypeOf,Zt),L2=Zt.create,B2=Ef.propertyIsEnumerable,Fl=Rl.splice,U2=bs?bs.isConcatSpreadable:t,qc=bs?bs.iterator:t,ha=bs?bs.toStringTag:t,ql=function(){try{var s=ga(Zt,"defineProperty");return s({},"",{}),s}catch{}}(),cA=Ee.clearTimeout!==Er.clearTimeout&&Ee.clearTimeout,uA=qe&&qe.now!==Er.Date.now&&qe.now,lA=Ee.setTimeout!==Er.setTimeout&&Ee.setTimeout,Hl=xr.ceil,zl=xr.floor,xp=Zt.getOwnPropertySymbols,hA=Bl?Bl.isBuffer:t,$2=Ee.isFinite,dA=Rl.join,pA=O2(Zt.keys,Zt),wr=xr.max,Kr=xr.min,mA=qe.now,bA=Ee.parseInt,F2=xr.random,gA=Rl.reverse,wp=ga(Ee,"DataView"),Hc=ga(Ee,"Map"),_p=ga(Ee,"Promise"),Af=ga(Ee,"Set"),zc=ga(Ee,"WeakMap"),Kc=ga(Zt,"create"),Kl=zc&&new zc,Sf={},vA=va(wp),yA=va(Hc),xA=va(_p),wA=va(Af),_A=va(zc),jl=bs?bs.prototype:t,jc=jl?jl.valueOf:t,q2=jl?jl.toString:t;function H(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(H,"lodash");var Mf=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 Gl(){}o(Gl,"baseLodash");function oi(s,f){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=t}o(oi,"LodashWrapper"),H.templateSettings={escape:Yn,evaluate:ot,interpolate:et,variable:"",imports:{_:H}},H.prototype=Gl.prototype,H.prototype.constructor=H,oi.prototype=Mf(Gl.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 EA(){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(EA,"lazyClone");function AA(){if(this.__filtered__){var s=new Dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}o(AA,"lazyReverse");function SA(){var s=this.__wrapped__.value(),f=this.__dir__,d=vt(s),M=f<0,B=d?s.length:0,z=BS(0,B,this.__views__),te=z.start,fe=z.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 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==x)continue e;break e}}Ze[Le++]=Qe}return Ze}o(SA,"lazyValue"),Dt.prototype=Mf(Gl.prototype),Dt.prototype.constructor=Dt;function da(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(da,"Hash");function MA(){this.__data__=Kc?Kc(null):{},this.size=0}o(MA,"hashClear");function TA(s){var f=this.has(s)&&delete this.__data__[s];return this.size-=f?1:0,f}o(TA,"hashDelete");function CA(s){var f=this.__data__;if(Kc){var d=f[s];return d===c?t:d}return Vt.call(f,s)?f[s]:t}o(CA,"hashGet");function kA(s){var f=this.__data__;return Kc?f[s]!==t:Vt.call(f,s)}o(kA,"hashHas");function IA(s,f){var d=this.__data__;return this.size+=this.has(s)?0:1,d[s]=Kc&&f===t?c:f,this}o(IA,"hashSet"),da.prototype.clear=MA,da.prototype.delete=TA,da.prototype.get=CA,da.prototype.has=kA,da.prototype.set=IA;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 DA(){this.__data__=[],this.size=0}o(DA,"listCacheClear");function OA(s){var f=this.__data__,d=Vl(f,s);if(d<0)return!1;var M=f.length-1;return d==M?f.pop():Fl.call(f,d,1),--this.size,!0}o(OA,"listCacheDelete");function RA(s){var f=this.__data__,d=Vl(f,s);return d<0?t:f[d][1]}o(RA,"listCacheGet");function NA(s){return Vl(this.__data__,s)>-1}o(NA,"listCacheHas");function PA(s,f){var d=this.__data__,M=Vl(d,s);return M<0?(++this.size,d.push([s,f])):d[M][1]=f,this}o(PA,"listCacheSet"),Do.prototype.clear=DA,Do.prototype.delete=OA,Do.prototype.get=RA,Do.prototype.has=NA,Do.prototype.set=PA;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 LA(){this.size=0,this.__data__={hash:new da,map:new(Hc||Do),string:new da}}o(LA,"mapCacheClear");function BA(s){var f=oh(this,s).delete(s);return this.size-=f?1:0,f}o(BA,"mapCacheDelete");function UA(s){return oh(this,s).get(s)}o(UA,"mapCacheGet");function $A(s){return oh(this,s).has(s)}o($A,"mapCacheHas");function FA(s,f){var d=oh(this,s),M=d.size;return d.set(s,f),this.size+=d.size==M?0:1,this}o(FA,"mapCacheSet"),Oo.prototype.clear=LA,Oo.prototype.delete=BA,Oo.prototype.get=UA,Oo.prototype.has=$A,Oo.prototype.set=FA;function pa(s){var f=-1,d=s==null?0:s.length;for(this.__data__=new Oo;++f<d;)this.add(s[f])}o(pa,"SetCache");function qA(s){return this.__data__.set(s,c),this}o(qA,"setCacheAdd");function HA(s){return this.__data__.has(s)}o(HA,"setCacheHas"),pa.prototype.add=pa.prototype.push=qA,pa.prototype.has=HA;function ki(s){var f=this.__data__=new Do(s);this.size=f.size}o(ki,"Stack");function zA(){this.__data__=new Do,this.size=0}o(zA,"stackClear");function KA(s){var f=this.__data__,d=f.delete(s);return this.size=f.size,d}o(KA,"stackDelete");function jA(s){return this.__data__.get(s)}o(jA,"stackGet");function GA(s){return this.__data__.has(s)}o(GA,"stackHas");function VA(s,f){var d=this.__data__;if(d instanceof Do){var M=d.__data__;if(!Hc||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(VA,"stackSet"),ki.prototype.clear=zA,ki.prototype.delete=KA,ki.prototype.get=jA,ki.prototype.has=GA,ki.prototype.set=VA;function H2(s,f){var d=vt(s),M=!d&&ya(s),B=!d&&!M&&ws(s),z=!d&&!M&&!B&&If(s),te=d||M||B||z,fe=te?bp(s.length,nA):[],be=fe.length;for(var Me in s)(f||Vt.call(s,Me))&&!(te&&(Me=="length"||B&&(Me=="offset"||Me=="parent")||z&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||Lo(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 WA(s,f){return sh(pn(s),ma(f,0,s.length))}o(WA,"arraySampleSize");function JA(s){return sh(pn(s))}o(JA,"arrayShuffle");function Ep(s,f,d){(d!==t&&!Ii(s[f],d)||d===t&&!(f in s))&&Ro(s,f,d)}o(Ep,"assignMergeValue");function Gc(s,f,d){var M=s[f];(!(Vt.call(s,f)&&Ii(M,d))||d===t&&!(f in s))&&Ro(s,f,d)}o(Gc,"assignValue");function Vl(s,f){for(var d=s.length;d--;)if(Ii(s[d][0],f))return d;return-1}o(Vl,"assocIndexOf");function YA(s,f,d,M){return gs(s,function(B,z,te){f(M,B,d(B),te)}),M}o(YA,"baseAggregator");function K2(s,f){return s&&to(f,Ar(f),s)}o(K2,"baseAssign");function XA(s,f){return s&&to(f,bn(f),s)}o(XA,"baseAssignIn");function Ro(s,f,d){f=="__proto__"&&ql?ql(s,f,{configurable:!0,enumerable:!0,value:d,writable:!0}):s[f]=d}o(Ro,"baseAssignValue");function Ap(s,f){for(var d=-1,M=f.length,B=xe(M),z=s==null;++d<M;)B[d]=z?t:im(s,f[d]);return B}o(Ap,"baseAt");function ma(s,f,d){return s===s&&(d!==t&&(s=s<=d?s:d),f!==t&&(s=s>=f?s:f)),s}o(ma,"baseClamp");function si(s,f,d,M,B,z){var te,fe=f&v,be=f&y,Me=f&S;if(d&&(te=B?d(s,M,B,z):d(s)),te!==t)return te;if(!ar(s))return s;var Te=vt(s);if(Te){if(te=$S(s),!fe)return pn(s,te)}else{var Ie=jr(s),Le=Ie==ee||Ie==ne;if(ws(s))return pv(s,fe);if(Ie==re||Ie==k||Le&&!B){if(te=be||Le?{}:Rv(s),!fe)return be?CS(s,XA(te,s)):TS(s,K2(te,s))}else{if(!tr[Ie])return B?s:{};te=FS(s,Ie,fe)}}z||(z=new ki);var ze=z.get(s);if(ze)return ze;z.set(s,te),fy(s)?s.forEach(function(Qe){te.add(si(Qe,f,d,Qe,s,z))}):sy(s)&&s.forEach(function(Qe,Ct){te.set(Ct,si(Qe,f,d,Ct,s,z))});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]),Gc(te,Ct,si(Qe,f,d,Ct,s,z))}),te}o(si,"baseClone");function ZA(s){var f=Ar(s);return function(d){return j2(d,s,f)}}o(ZA,"baseConforms");function j2(s,f,d){var M=d.length;if(s==null)return!M;for(s=Zt(s);M--;){var B=d[M],z=f[B],te=s[B];if(te===t&&!(B in s)||!z(te))return!1}return!0}o(j2,"baseConformsTo");function G2(s,f,d){if(typeof s!="function")throw new ii(i);return Qc(function(){s.apply(t,d)},f)}o(G2,"baseDelay");function Vc(s,f,d,M){var B=-1,z=Il,te=!0,fe=s.length,be=[],Me=f.length;if(!fe)return be;d&&(f=sr(f,In(d))),M?(z=up,te=!1):f.length>=r&&(z=Fc,te=!1,f=new pa(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 z(f,Ie,M)||be.push(Te)}return be}o(Vc,"baseDifference");var gs=yv(eo),V2=yv(Mp,!0);function QA(s,f){var d=!0;return gs(s,function(M,B,z){return d=!!f(M,B,z),d}),d}o(QA,"baseEvery");function Wl(s,f,d){for(var M=-1,B=s.length;++M<B;){var z=s[M],te=f(z);if(te!=null&&(fe===t?te===te&&!On(te):d(te,fe)))var fe=te,be=z}return be}o(Wl,"baseExtremum");function eS(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:uy(M);d<M;)s[d++]=f;return s}o(eS,"baseFill");function W2(s,f){var d=[];return gs(s,function(M,B,z){f(M,B,z)&&d.push(M)}),d}o(W2,"baseFilter");function Pr(s,f,d,M,B){var z=-1,te=s.length;for(d||(d=HS),B||(B=[]);++z<te;){var fe=s[z];f>0&&d(fe)?f>1?Pr(fe,f-1,d,M,B):ds(B,fe):M||(B[B.length]=fe)}return B}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 Jl(s,f){return hs(f,function(d){return Bo(s[d])})}o(Jl,"baseFunctions");function ba(s,f){f=ys(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(ba,"baseGet");function Y2(s,f,d){var M=f(s);return vt(s)?M:ds(M,d(s))}o(Y2,"baseGetAllKeys");function nn(s){return s==null?s===t?He:ge:ha&&ha in Zt(s)?LS(s):JS(s)}o(nn,"baseGetTag");function Tp(s,f){return s>f}o(Tp,"baseGt");function tS(s,f){return s!=null&&Vt.call(s,f)}o(tS,"baseHas");function rS(s,f){return s!=null&&f in Zt(s)}o(rS,"baseHasIn");function nS(s,f,d){return s>=Kr(f,d)&&s<wr(f,d)}o(nS,"baseInRange");function Cp(s,f,d){for(var M=d?up:Il,B=s[0].length,z=s.length,te=z,fe=xe(z),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 pa(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?Fc(Le,Ze):M(Me,Ze,d))){for(te=z;--te;){var _t=fe[te];if(!(_t?Fc(_t,Ze):M(s[te],Ze,d)))continue e}Le&&Le.push(Ze),Me.push(ze)}}return Me}o(Cp,"baseIntersection");function iS(s,f,d,M){return eo(s,function(B,z,te){f(M,d(B),z,te)}),M}o(iS,"baseInverter");function Wc(s,f,d){f=ys(f,s),s=Bv(s,f);var M=s==null?s:s[ro(fi(f))];return M==null?t:kn(M,s,d)}o(Wc,"baseInvoke");function X2(s){return fr(s)&&nn(s)==k}o(X2,"baseIsArguments");function oS(s){return fr(s)&&nn(s)==pr}o(oS,"baseIsArrayBuffer");function sS(s){return fr(s)&&nn(s)==se}o(sS,"baseIsDate");function Jc(s,f,d,M,B){return s===f?!0:s==null||f==null||!fr(s)&&!fr(f)?s!==s&&f!==f:aS(s,f,d,M,Jc,B)}o(Jc,"baseIsEqual");function aS(s,f,d,M,B,z){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&&ws(s)){if(!ws(f))return!1;te=!0,Te=!1}if(Le&&!Te)return z||(z=new ki),te||If(s)?Iv(s,f,d,M,B,z):NS(s,f,be,d,M,B,z);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 z||(z=new ki),B(_t,Qe,d,M,z)}}return Le?(z||(z=new ki),PS(s,f,d,M,B,z)):!1}o(aS,"baseIsEqualDeep");function fS(s){return fr(s)&&jr(s)==ae}o(fS,"baseIsMap");function kp(s,f,d,M){var B=d.length,z=B,te=!M;if(s==null)return!z;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<z;){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?Jc(Te,Me,O|R,M,Ie):Le))return!1}}return!0}o(kp,"baseIsMatch");function Z2(s){if(!ar(s)||KS(s))return!1;var f=Bo(s)?fA:qt;return f.test(va(s))}o(Z2,"baseIsNative");function cS(s){return fr(s)&&nn(s)==ve}o(cS,"baseIsRegExp");function uS(s){return fr(s)&&jr(s)==G}o(uS,"baseIsSet");function lS(s){return fr(s)&&hh(s.length)&&!!ir[nn(s)]}o(lS,"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(!Zc(s))return pA(s);var f=[];for(var d in Zt(s))Vt.call(s,d)&&d!="constructor"&&f.push(d);return f}o(Ip,"baseKeys");function hS(s){if(!ar(s))return WS(s);var f=Zc(s),d=[];for(var M in s)M=="constructor"&&(f||!Vt.call(s,M))||d.push(M);return d}o(hS,"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 gs(s,function(B,z,te){M[++d]=f(B,z,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):Jc(f,M,O|R)}}o(rv,"baseMatchesProperty");function Yl(s,f,d,M,B){s!==f&&Sp(f,function(z,te){if(B||(B=new ki),ar(z))dS(s,f,te,d,Yl,M,B);else{var fe=M?M(Yp(s,te),z,te+"",s,f,B):t;fe===t&&(fe=z),Ep(s,te,fe)}},bn)}o(Yl,"baseMerge");function dS(s,f,d,M,B,z,te){var fe=Yp(s,d),be=Yp(f,d),Me=te.get(be);if(Me){Ep(s,d,Me);return}var Te=z?z(fe,be,d+"",s,f,te):t,Ie=Te===t;if(Ie){var Le=vt(be),ze=!Le&&ws(be),Ze=!Le&&!ze&&If(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=[]:eu(be)||ya(be)?(Te=fe,ya(fe)?Te=ly(fe):(!ar(fe)||Bo(fe))&&(Te=Rv(be))):Ie=!1}Ie&&(te.set(be,Te),B(Te,be,M,z,te),te.delete(be)),Ep(s,d,Te)}o(dS,"baseMergeDeep");function nv(s,f){var d=s.length;if(!!d)return f+=f<0?d:0,Lo(f,d)?s[f]:t}o(nv,"baseNth");function iv(s,f,d){f.length?f=sr(f,function(z){return vt(z)?function(te){return ba(te,z.length===1?z[0]:z)}:z}):f=[gn];var M=-1;f=sr(f,In(Ye()));var B=ev(s,function(z,te,fe){var be=sr(f,function(Me){return Me(z)});return{criteria:be,index:++M,value:z}});return F7(B,function(z,te){return MS(z,te,d)})}o(iv,"baseOrderBy");function pS(s,f){return ov(s,f,function(d,M){return om(s,M)})}o(pS,"basePick");function ov(s,f,d){for(var M=-1,B=f.length,z={};++M<B;){var te=f[M],fe=ba(s,te);d(fe,te)&&Yc(z,ys(te,s),fe)}return z}o(ov,"basePickBy");function mS(s){return function(f){return ba(f,s)}}o(mS,"basePropertyDeep");function Op(s,f,d,M){var B=M?$7:xf,z=-1,te=f.length,fe=s;for(s===f&&(f=pn(f)),d&&(fe=sr(s,In(d)));++z<te;)for(var be=0,Me=f[z],Te=d?d(Me):Me;(be=B(fe,Te,be,M))>-1;)fe!==s&&Fl.call(fe,be,1),Fl.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 B=f[d];if(d==M||B!==z){var z=B;Lo(B)?Fl.call(s,B,1):Lp(s,B)}}return s}o(sv,"basePullAt");function Rp(s,f){return s+zl(F2()*(f-s+1))}o(Rp,"baseRandom");function bS(s,f,d,M){for(var B=-1,z=wr(Hl((f-s)/(d||1)),0),te=xe(z);z--;)te[M?z:++B]=s,s+=d;return te}o(bS,"baseRange");function Np(s,f){var d="";if(!s||f<1||f>_)return d;do f%2&&(d+=s),f=zl(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 gS(s){return z2(Df(s))}o(gS,"baseSample");function vS(s,f){var d=Df(s);return sh(d,ma(f,0,d.length))}o(vS,"baseSampleSize");function Yc(s,f,d,M){if(!ar(s))return s;f=ys(f,s);for(var B=-1,z=f.length,te=z-1,fe=s;fe!=null&&++B<z;){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])?[]:{})}Gc(fe,be,Me),fe=fe[be]}return s}o(Yc,"baseSet");var av=Kl?function(s,f){return Kl.set(s,f),s}:gn,yS=ql?function(s,f){return ql(s,"toString",{configurable:!0,enumerable:!1,value:am(f),writable:!0})}:gn;function xS(s){return sh(Df(s))}o(xS,"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 z=xe(B);++M<B;)z[M]=s[M+f];return z}o(ai,"baseSlice");function wS(s,f){var d;return gs(s,function(M,B,z){return d=f(M,B,z),!d}),!!d}o(wS,"baseSome");function Xl(s,f,d){var M=0,B=s==null?M:s.length;if(typeof f=="number"&&f===f&&B<=P){for(;M<B;){var z=M+B>>>1,te=s[z];te!==null&&!On(te)&&(d?te<=f:te<f)?M=z+1:B=z}return B}return Pp(s,f,gn,d)}o(Xl,"baseSortedIndex");function Pp(s,f,d,M){var B=0,z=s==null?0:s.length;if(z===0)return 0;f=d(f);for(var te=f!==f,fe=f===null,be=On(f),Me=f===t;B<z;){var Te=zl((B+z)/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:z=Te}return Kr(z,C)}o(Pp,"baseSortedIndexBy");function fv(s,f){for(var d=-1,M=s.length,B=0,z=[];++d<M;){var te=s[d],fe=f?f(te):te;if(!d||!Ii(fe,be)){var be=fe;z[B++]=te===0?0:te}}return z}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==-m?"-0":f}o(Dn,"baseToString");function vs(s,f,d){var M=-1,B=Il,z=s.length,te=!0,fe=[],be=fe;if(d)te=!1,B=up;else if(z>=r){var Me=f?null:OS(s);if(Me)return Ol(Me);te=!1,B=Fc,be=new pa}else be=f?[]:fe;e:for(;++M<z;){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(vs,"baseUniq");function Lp(s,f){return f=ys(f,s),s=Bv(s,f),s==null||delete s[ro(fi(f))]}o(Lp,"baseUnset");function uv(s,f,d,M){return Yc(s,f,d(ba(s,f)),M)}o(uv,"baseUpdate");function Zl(s,f,d,M){for(var B=s.length,z=M?B:-1;(M?z--:++z<B)&&f(s[z],z,s););return d?ai(s,M?0:z,M?z+1:B):ai(s,M?z+1:0,M?B:z)}o(Zl,"baseWhile");function lv(s,f){var d=s;return d instanceof Dt&&(d=d.value()),lp(f,function(M,B){return B.func.apply(B.thisArg,ds([M],B.args))},d)}o(lv,"baseWrapperValue");function Bp(s,f,d){var M=s.length;if(M<2)return M?vs(s[0]):[];for(var B=-1,z=xe(M);++B<M;)for(var te=s[B],fe=-1;++fe<M;)fe!=B&&(z[B]=Vc(z[B]||te,s[fe],f,d));return vs(Pr(z,1),f,d)}o(Bp,"baseXor");function hv(s,f,d){for(var M=-1,B=s.length,z=f.length,te={};++M<B;){var fe=M<z?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 ys(s,f){return vt(s)?s:Wp(s,f)?[s]:qv(Kt(s))}o(ys,"castPath");var _S=St;function xs(s,f,d){var M=s.length;return d=d===t?M:d,!f&&d>=M?s:ai(s,f,d)}o(xs,"castSlice");var dv=cA||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 Ul(f).set(new Ul(s)),f}o(Fp,"cloneArrayBuffer");function ES(s,f){var d=f?Fp(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.byteLength)}o(ES,"cloneDataView");function AS(s){var f=new s.constructor(s.source,tt.exec(s));return f.lastIndex=s.lastIndex,f}o(AS,"cloneRegExp");function SS(s){return jc?Zt(jc.call(s)):{}}o(SS,"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,B=s===s,z=On(s),te=f!==t,fe=f===null,be=f===f,Me=On(f);if(!fe&&!Me&&!z&&s>f||z&&te&&be&&!fe&&!Me||M&&te&&be||!d&&be||!B)return 1;if(!M&&!z&&!Me&&s<f||Me&&d&&B&&!M&&!z||fe&&d&&B||!te&&B||!be)return-1}return 0}o(bv,"compareAscending");function MS(s,f,d){for(var M=-1,B=s.criteria,z=f.criteria,te=B.length,fe=d.length;++M<te;){var be=bv(B[M],z[M]);if(be){if(M>=fe)return be;var Me=d[M];return be*(Me=="desc"?-1:1)}}return s.index-f.index}o(MS,"compareMultiple");function gv(s,f,d,M){for(var B=-1,z=s.length,te=d.length,fe=-1,be=f.length,Me=wr(z-te,0),Te=xe(be+Me),Ie=!M;++fe<be;)Te[fe]=f[fe];for(;++B<te;)(Ie||B<z)&&(Te[d[B]]=s[B]);for(;Me--;)Te[fe++]=s[B++];return Te}o(gv,"composeArgs");function vv(s,f,d,M){for(var B=-1,z=s.length,te=-1,fe=d.length,be=-1,Me=f.length,Te=wr(z-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<z)&&(Ie[ze+d[te]]=s[B++]);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 B=!d;d||(d={});for(var z=-1,te=f.length;++z<te;){var fe=f[z],be=M?M(d[fe],s[fe],fe,d,s):t;be===t&&(be=s[fe]),B?Ro(d,fe,be):Gc(d,fe,be)}return d}o(to,"copyObject");function TS(s,f){return to(s,Vp(s),f)}o(TS,"copySymbols");function CS(s,f){return to(s,Dv(s),f)}o(CS,"copySymbolsIn");function Ql(s,f){return function(d,M){var B=vt(d)?R7:YA,z=f?f():{};return B(d,s,Ye(M,2),z)}}o(Ql,"createAggregator");function Tf(s){return St(function(f,d){var M=-1,B=d.length,z=B>1?d[B-1]:t,te=B>2?d[2]:t;for(z=s.length>3&&typeof z=="function"?(B--,z):t,te&&on(d[0],d[1],te)&&(z=B<3?t:z,B=1),f=Zt(f);++M<B;){var fe=d[M];fe&&s(f,fe,M,z)}return f})}o(Tf,"createAssigner");function yv(s,f){return function(d,M){if(d==null)return d;if(!mn(d))return s(d,M);for(var B=d.length,z=f?B:-1,te=Zt(d);(f?z--:++z<B)&&M(te[z],z,te)!==!1;);return d}}o(yv,"createBaseEach");function xv(s){return function(f,d,M){for(var B=-1,z=Zt(f),te=M(f),fe=te.length;fe--;){var be=te[s?fe:++B];if(d(z[be],be,z)===!1)break}return f}}o(xv,"createBaseFor");function kS(s,f,d){var M=f&I,B=Xc(s);function z(){var te=this&&this!==Er&&this instanceof z?B:s;return te.apply(M?d:this,arguments)}return o(z,"wrapper"),z}o(kS,"createBind");function wv(s){return function(f){f=Kt(f);var d=wf(f)?Ci(f):t,M=d?d[0]:f.charAt(0),B=d?xs(d,1).join(""):f.slice(1);return M[s]()+B}}o(wv,"createCaseFirst");function Cf(s){return function(f){return lp(yy(vy(f).replace(y7,"")),s,"")}}o(Cf,"createCompounder");function Xc(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=Mf(s.prototype),M=s.apply(d,f);return ar(M)?M:d}}o(Xc,"createCtor");function IS(s,f,d){var M=Xc(s);function B(){for(var z=arguments.length,te=xe(z),fe=z,be=kf(B);fe--;)te[fe]=arguments[fe];var Me=z<3&&te[0]!==be&&te[z-1]!==be?[]:ps(te,be);if(z-=Me.length,z<d)return Mv(s,f,eh,B.placeholder,t,te,Me,t,t,d-z);var Te=this&&this!==Er&&this instanceof B?M:s;return kn(Te,this,te)}return o(B,"wrapper"),B}o(IS,"createCurry");function _v(s){return function(f,d,M){var B=Zt(f);if(!mn(f)){var z=Ye(d,3);f=Ar(f),d=o(function(fe){return z(B[fe],fe,B)},"predicate")}var te=s(f,d,M);return te>-1?B[z?f[te]:te]:t}}o(_v,"createFind");function Ev(s){return Po(function(f){var d=f.length,M=d,B=oi.prototype.thru;for(s&&f.reverse();M--;){var z=f[M];if(typeof z!="function")throw new ii(i);if(B&&!te&&ih(z)=="wrapper")var te=new oi([],!0)}for(M=te?M:d;++M<d;){z=f[M];var fe=ih(z),be=fe=="wrapper"?jp(z):t;be&&Jp(be[0])&&be[1]==(oe|L|Z|K)&&!be[4].length&&be[9]==1?te=te[ih(be[0])].apply(te,be[3]):te=z.length==1&&Jp(z)?te[fe]():te.thru(z)}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 eh(s,f,d,M,B,z,te,fe,be,Me){var Te=f&oe,Ie=f&I,Le=f&N,ze=f&(L|V),Ze=f&q,_t=Le?t:Xc(s);function Qe(){for(var Ct=arguments.length,Nt=xe(Ct),Rn=Ct;Rn--;)Nt[Rn]=arguments[Rn];if(ze)var sn=kf(Qe),Nn=H7(Nt,sn);if(M&&(Nt=gv(Nt,M,B,ze)),z&&(Nt=vv(Nt,z,te,ze)),Ct-=Nn,ze&&Ct<Me){var br=ps(Nt,sn);return Mv(s,f,eh,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=YS(Nt,fe):Ze&&Ct>1&&Nt.reverse(),Te&&be<Ct&&(Nt.length=be),this&&this!==Er&&this instanceof Qe&&($o=_t||Xc($o)),$o.apply(Di,Nt)}return o(Qe,"wrapper"),Qe}o(eh,"createHybrid");function Av(s,f){return function(d,M){return iS(d,s,f(M),{})}}o(Av,"createInverter");function th(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=cv(d),M=cv(M)),B=s(d,M)}return B}}o(th,"createMathOperation");function qp(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(qp,"createOver");function rh(s,f){f=f===t?" ":Dn(f);var d=f.length;if(d<2)return d?Np(f,s):f;var M=Np(f,Hl(s/_f(f)));return wf(f)?xs(Ci(M),0,s).join(""):M.slice(0,s)}o(rh,"createPadding");function DS(s,f,d,M){var B=f&I,z=Xc(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?z: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(DS,"createPartial");function Sv(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),bS(f,d,M,s)}}o(Sv,"createRange");function nh(s){return function(f,d){return typeof f=="string"&&typeof d=="string"||(f=ci(f),d=ci(d)),s(f,d)}}o(nh,"createRelationalOperation");function Mv(s,f,d,M,B,z,te,fe,be,Me){var Te=f&L,Ie=Te?te:t,Le=Te?t:te,ze=Te?z:t,Ze=Te?t:z;f|=Te?Z:Y,f&=~(Te?Y:Z),f&J||(f&=~(I|N));var _t=[s,f,B,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 B=(Kt(d)+"e").split("e"),z=f(B[0]+"e"+(+B[1]+M));return B=(Kt(z)+"e").split("e"),+(B[0]+"e"+(+B[1]-M))}return f(d)}}o(Hp,"createRound");var OS=Af&&1/Ol(new Af([,-0]))[1]==m?function(s){return new Af(s)}:um;function Tv(s){return function(f){var d=jr(f);return d==ae?vp(f):d==G?J7(f):q7(f,s(f))}}o(Tv,"createToPairs");function No(s,f,d,M,B,z,te,fe){var be=f&N;if(!be&&typeof s!="function")throw new ii(i);var Me=M?M.length:0;if(Me||(f&=~(Z|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:jp(s),ze=[s,f,d,M,B,Te,Ie,z,te,fe];if(Le&&VS(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|V)&&(f&=~(L|V)),!f||f==I)var Ze=kS(s,f,d);else f==L||f==V?Ze=IS(s,f,fe):(f==Z||f==(I|Z))&&!B.length?Ze=DS(s,f,d,M):Ze=eh.apply(t,ze);var _t=Le?av:Uv;return $v(_t(Ze,ze),s,f)}o(No,"createWrap");function Cv(s,f,d,M){return s===t||Ii(s,Ef[d])&&!Vt.call(M,d)?f:s}o(Cv,"customDefaultsAssignIn");function kv(s,f,d,M,B,z){return ar(s)&&ar(f)&&(z.set(f,s),Yl(s,f,t,kv,z),z.delete(f)),s}o(kv,"customDefaultsMerge");function RS(s){return eu(s)?t:s}o(RS,"customOmitClone");function Iv(s,f,d,M,B,z){var te=d&O,fe=s.length,be=f.length;if(fe!=be&&!(te&&be>fe))return!1;var Me=z.get(s),Te=z.get(f);if(Me&&Te)return Me==f&&Te==s;var Ie=-1,Le=!0,ze=d&R?new pa:t;for(z.set(s,f),z.set(f,s);++Ie<fe;){var Ze=s[Ie],_t=f[Ie];if(M)var Qe=te?M(_t,Ze,Ie,f,s,z):M(Ze,_t,Ie,s,f,z);if(Qe!==t){if(Qe)continue;Le=!1;break}if(ze){if(!hp(f,function(Ct,Nt){if(!Fc(ze,Nt)&&(Ze===Ct||B(Ze,Ct,d,M,z)))return ze.push(Nt)})){Le=!1;break}}else if(!(Ze===_t||B(Ze,_t,d,M,z))){Le=!1;break}}return z.delete(s),z.delete(f),Le}o(Iv,"equalArrays");function NS(s,f,d,M,B,z,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||!z(new Ul(s),new Ul(f)));case Q:case se:case Ae:return Ii(+s,+f);case $:return s.name==f.name&&s.message==f.message;case ve:case pe:return s==f+"";case ae:var fe=vp;case G:var be=M&O;if(fe||(fe=Ol),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,B,z,te);return te.delete(s),Te;case Ce:if(jc)return jc.call(s)==jc.call(f)}return!1}o(NS,"equalByTag");function PS(s,f,d,M,B,z){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=z.get(s),Ze=z.get(f);if(ze&&Ze)return ze==f&&Ze==s;var _t=!0;z.set(s,f),z.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,z):M(Ct,Nt,Le,s,f,z);if(!(Rn===t?Ct===Nt||B(Ct,Nt,d,M,z):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 z.delete(s),z.delete(f),_t}o(PS,"equalObjects");function Po(s){return Xp(Lv(s,t,jv),s+"")}o(Po,"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=Kl?function(s){return Kl.get(s)}:um;function ih(s){for(var f=s.name+"",d=Sf[f],M=Vt.call(Sf,f)?d.length:0;M--;){var B=d[M],z=B.func;if(z==null||z==s)return B.name}return f}o(ih,"getFuncName");function kf(s){var f=Vt.call(H,"placeholder")?H:s;return f.placeholder}o(kf,"getHolder");function Ye(){var s=H.iteratee||fm;return s=s===fm?Q2:s,arguments.length?s(arguments[0],arguments[1]):s}o(Ye,"getIteratee");function oh(s,f){var d=s.__data__;return zS(f)?d[typeof f=="string"?"string":"hash"]:d.map}o(oh,"getMapData");function Gp(s){for(var f=Ar(s),d=f.length;d--;){var M=f[d],B=s[M];f[d]=[M,B,Nv(B)]}return f}o(Gp,"getMatchData");function ga(s,f){var d=G7(s,f);return Z2(d)?d:t}o(ga,"getNative");function LS(s){var f=Vt.call(s,ha),d=s[ha];try{s[ha]=t;var M=!0}catch{}var B=Ll.call(s);return M&&(f?s[ha]=d:delete s[ha]),B}o(LS,"getRawTag");var Vp=xp?function(s){return s==null?[]:(s=Zt(s),hs(xp(s),function(f){return B2.call(s,f)}))}:lm,Dv=xp?function(s){for(var f=[];s;)ds(f,Vp(s)),s=$l(s);return f}:lm,jr=nn;(wp&&jr(new wp(new ArrayBuffer(1)))!=ue||Hc&&jr(new Hc)!=ae||_p&&jr(_p.resolve())!=Se||Af&&jr(new Af)!=G||zc&&jr(new zc)!=Re)&&(jr=o(function(s){var f=nn(s),d=f==re?s.constructor:t,M=d?va(d):"";if(M)switch(M){case vA:return ue;case yA:return ae;case xA:return Se;case wA:return G;case _A:return Re}return f},"getTag"));function BS(s,f,d){for(var M=-1,B=d.length;++M<B;){var z=d[M],te=z.size;switch(z.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(BS,"getView");function US(s){var f=s.match(ut);return f?f[1].split(Qn):[]}o(US,"getWrapDetails");function Ov(s,f,d){f=ys(f,s);for(var M=-1,B=f.length,z=!1;++M<B;){var te=ro(f[M]);if(!(z=s!=null&&d(s,te)))break;s=s[te]}return z||++M!=B?z:(B=s==null?0:s.length,!!B&&hh(B)&&Lo(te,B)&&(vt(s)||ya(s)))}o(Ov,"hasPath");function $S(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($S,"initCloneArray");function Rv(s){return typeof s.constructor=="function"&&!Zc(s)?Mf($l(s)):{}}o(Rv,"initCloneObject");function FS(s,f,d){var M=s.constructor;switch(f){case pr:return Fp(s);case Q:case se:return new M(+s);case ue:return ES(s,d);case ie:case U: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 AS(s);case G:return new M;case Ce:return SS(s)}}o(FS,"initCloneByTag");function qS(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 Rk=Object.create;var tu=Object.defineProperty;var Nk=Object.getOwnPropertyDescriptor;var Pk=Object.getOwnPropertyNames;var Lk=Object.getPrototypeOf,Bk=Object.prototype.hasOwnProperty;var o=(t,e)=>tu(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)tu(t,r,{get:e[r],enumerable:!0})},yy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pk(e))!Bk.call(t,i)&&i!==r&&tu(t,i,{get:()=>e[i],enumerable:!(n=Nk(e,i))||n.enumerable});return t};var Lt=(t,e,r)=>(r=t!=null?Rk(Lk(t)):{},yy(e||!t||!t.__esModule?tu(r,"default",{value:t,enumerable:!0}):r,t)),mh=t=>yy(tu({},"__esModule",{value:!0}),t);var xy=De((Rf,ru)=>{(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,K=256,q=512,j=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",q],["partial",Q],["partialRight",Y],["rearg",K]],k="[object Arguments]",he="[object Array]",I="[object AsyncFunction]",Z="[object Boolean]",se="[object Date]",F="[object DOMException]",$="[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]",G="[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]",U="[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",gf="A-Z\\xc0-\\xd6\\xd8-\\xde",vf="\\ufe0e\\ufe0f",yf=To+Co+ko+Io,Q0="['\u2019]",R9="["+ti+"]",e2="["+yf+"]",kl="["+Xi+"]",t2="\\d+",N9="["+Zi+"]",r2="["+Qi+"]",n2="[^"+ti+yf+t2+Zi+Qi+gf+"]",ep="\\ud83c[\\udffb-\\udfff]",P9="(?:"+kl+"|"+ep+")",i2="[^"+ti+"]",tp="(?:\\ud83c[\\udde6-\\uddff]){2}",rp="[\\ud800-\\udbff][\\udc00-\\udfff]",xf="["+gf+"]",o2="\\u200d",s2="(?:"+r2+"|"+n2+")",L9="(?:"+xf+"|"+n2+")",a2="(?:"+Q0+"(?:d|ll|m|re|s|t|ve))?",f2="(?:"+Q0+"(?:D|LL|M|RE|S|T|VE))?",c2=P9+"?",u2="["+vf+"]?",B9="(?:"+o2+"(?:"+[i2,tp,rp].join("|")+")"+u2+c2+")*",U9="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$9="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",l2=u2+c2+B9,F9="(?:"+[N9,tp,rp].join("|")+")"+l2,q9="(?:"+[i2+kl+"?",kl,tp,rp,R9].join("|")+")",H9=RegExp(Q0,"g"),z9=RegExp(kl,"g"),np=RegExp(ep+"(?="+ep+")|"+q9+l2,"g"),K9=RegExp([xf+"?"+r2+"+"+a2+"(?="+[e2,xf,"$"].join("|")+")",L9+"+"+f2+"(?="+[e2,xf+s2,"$"].join("|")+")",xf+"?"+s2+"+"+a2,xf+"+"+f2,$9,U9,t2,F9].join("|"),"g"),j9=RegExp("["+o2+ti+Xi+vf+"]"),G9=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,V9=["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"],W9=-1,ir={};ir[ie]=ir[U]=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[$]=ir[ee]=ir[ae]=ir[Ae]=ir[re]=ir[ve]=ir[G]=ir[pe]=ir[Re]=!1;var tr={};tr[k]=tr[he]=tr[pr]=tr[ue]=tr[Z]=tr[se]=tr[ie]=tr[U]=tr[X]=tr[me]=tr[ye]=tr[ae]=tr[Ae]=tr[re]=tr[ve]=tr[G]=tr[pe]=tr[Ce]=tr[we]=tr[ke]=tr[It]=tr[Ue]=!0,tr[$]=tr[ee]=tr[Re]=!1;var J9={\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"},Y9={"&":"&","<":"<",">":">",'"':""","'":"'"},X9={"&":"&","<":"<",">":">",""":'"',"'":"'"},Z9={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Q9=parseFloat,e7=parseInt,h2=typeof global=="object"&&global&&global.Object===Object&&global,t7=typeof self=="object"&&self&&self.Object===Object&&self,Er=h2||t7||Function("return this")(),ip=typeof Rf=="object"&&Rf&&!Rf.nodeType&&Rf,ha=ip&&typeof ru=="object"&&ru&&!ru.nodeType&&ru,d2=ha&&ha.exports===ip,op=d2&&h2.process,ri=function(){try{var de=ha&&ha.require&&ha.require("util").types;return de||op&&op.binding&&op.binding("util")}catch{}}(),p2=ri&&ri.isArrayBuffer,m2=ri&&ri.isDate,b2=ri&&ri.isMap,g2=ri&&ri.isRegExp,v2=ri&&ri.isSet,y2=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 r7(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(r7,"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 n7(de,Ee){for(var xe=de==null?0:de.length;xe--&&Ee(de[xe],xe,de)!==!1;);return de}o(n7,"arrayEachRight");function x2(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(x2,"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 Il(de,Ee){var xe=de==null?0:de.length;return!!xe&&wf(de,Ee,0)>-1}o(Il,"arrayIncludes");function sp(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(sp,"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 ap(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(ap,"arrayReduce");function i7(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(i7,"arrayReduceRight");function fp(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(fp,"arraySome");var o7=cp("length");function s7(de){return de.split("")}o(s7,"asciiToArray");function a7(de){return de.match(lt)||[]}o(a7,"asciiWords");function w2(de,Ee,xe){var qe;return xe(de,function(bt,Ht,xr){if(Ee(bt,Ht,xr))return qe=Ht,!1}),qe}o(w2,"baseFindKey");function Dl(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(Dl,"baseFindIndex");function wf(de,Ee,xe){return Ee===Ee?y7(de,Ee,xe):Dl(de,_2,xe)}o(wf,"baseIndexOf");function f7(de,Ee,xe,qe){for(var bt=xe-1,Ht=de.length;++bt<Ht;)if(qe(de[bt],Ee))return bt;return-1}o(f7,"baseIndexOfWith");function _2(de){return de!==de}o(_2,"baseIsNaN");function E2(de,Ee){var xe=de==null?0:de.length;return xe?lp(de,Ee)/xe:E}o(E2,"baseMean");function cp(de){return function(Ee){return Ee==null?t:Ee[de]}}o(cp,"baseProperty");function up(de){return function(Ee){return de==null?t:de[Ee]}}o(up,"basePropertyOf");function A2(de,Ee,xe,qe,bt){return bt(de,function(Ht,xr,Zt){xe=qe?(qe=!1,Ht):Ee(xe,Ht,xr,Zt)}),xe}o(A2,"baseReduce");function c7(de,Ee){var xe=de.length;for(de.sort(Ee);xe--;)de[xe]=de[xe].value;return de}o(c7,"baseSortBy");function lp(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(lp,"baseSum");function hp(de,Ee){for(var xe=-1,qe=Array(de);++xe<de;)qe[xe]=Ee(xe);return qe}o(hp,"baseTimes");function u7(de,Ee){return sr(Ee,function(xe){return[xe,de[xe]]})}o(u7,"baseToPairs");function S2(de){return de&&de.slice(0,k2(de)+1).replace(Xe,"")}o(S2,"baseTrim");function In(de){return function(Ee){return de(Ee)}}o(In,"baseUnary");function dp(de,Ee){return sr(Ee,function(xe){return de[xe]})}o(dp,"baseValues");function Fc(de,Ee){return de.has(Ee)}o(Fc,"cacheHas");function M2(de,Ee){for(var xe=-1,qe=de.length;++xe<qe&&wf(Ee,de[xe],0)>-1;);return xe}o(M2,"charsStartIndex");function T2(de,Ee){for(var xe=de.length;xe--&&wf(Ee,de[xe],0)>-1;);return xe}o(T2,"charsEndIndex");function l7(de,Ee){for(var xe=de.length,qe=0;xe--;)de[xe]===Ee&&++qe;return qe}o(l7,"countHolders");var h7=up(J9),d7=up(Y9);function p7(de){return"\\"+Z9[de]}o(p7,"escapeStringChar");function m7(de,Ee){return de==null?t:de[Ee]}o(m7,"getValue");function _f(de){return j9.test(de)}o(_f,"hasUnicode");function b7(de){return G9.test(de)}o(b7,"hasUnicodeWord");function g7(de){for(var Ee,xe=[];!(Ee=de.next()).done;)xe.push(Ee.value);return xe}o(g7,"iteratorToArray");function pp(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe,bt){xe[++Ee]=[bt,qe]}),xe}o(pp,"mapToArray");function C2(de,Ee){return function(xe){return de(Ee(xe))}}o(C2,"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 Ol(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=qe}),xe}o(Ol,"setToArray");function v7(de){var Ee=-1,xe=Array(de.size);return de.forEach(function(qe){xe[++Ee]=[qe,qe]}),xe}o(v7,"setToPairs");function y7(de,Ee,xe){for(var qe=xe-1,bt=de.length;++qe<bt;)if(de[qe]===Ee)return qe;return-1}o(y7,"strictIndexOf");function x7(de,Ee,xe){for(var qe=xe+1;qe--;)if(de[qe]===Ee)return qe;return qe}o(x7,"strictLastIndexOf");function Ef(de){return _f(de)?_7(de):o7(de)}o(Ef,"stringSize");function Ci(de){return _f(de)?E7(de):s7(de)}o(Ci,"stringToArray");function k2(de){for(var Ee=de.length;Ee--&&Zn.test(de.charAt(Ee)););return Ee}o(k2,"trimmedEndIndex");var w7=up(X9);function _7(de){for(var Ee=np.lastIndex=0;np.test(de);)++Ee;return Ee}o(_7,"unicodeSize");function E7(de){return de.match(np)||[]}o(E7,"unicodeToArray");function A7(de){return de.match(K9)||[]}o(A7,"unicodeWords");var S7=o(function de(Ee){Ee=Ee==null?Er:bs.defaults(Er.Object(),Ee,bs.pick(Er,V9));var xe=Ee.Array,qe=Ee.Date,bt=Ee.Error,Ht=Ee.Function,xr=Ee.Math,Zt=Ee.Object,mp=Ee.RegExp,M7=Ee.String,ii=Ee.TypeError,Rl=xe.prototype,T7=Ht.prototype,Af=Zt.prototype,Nl=Ee["__core-js_shared__"],Pl=T7.toString,Vt=Af.hasOwnProperty,C7=0,I2=function(){var s=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ll=Af.toString,k7=Pl.call(Zt),I7=Er._,D7=mp("^"+Pl.call(Vt).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bl=d2?Ee.Buffer:t,gs=Ee.Symbol,Ul=Ee.Uint8Array,D2=Bl?Bl.allocUnsafe:t,$l=C2(Zt.getPrototypeOf,Zt),O2=Zt.create,R2=Af.propertyIsEnumerable,Fl=Rl.splice,N2=gs?gs.isConcatSpreadable:t,qc=gs?gs.iterator:t,da=gs?gs.toStringTag:t,ql=function(){try{var s=va(Zt,"defineProperty");return s({},"",{}),s}catch{}}(),O7=Ee.clearTimeout!==Er.clearTimeout&&Ee.clearTimeout,R7=qe&&qe.now!==Er.Date.now&&qe.now,N7=Ee.setTimeout!==Er.setTimeout&&Ee.setTimeout,Hl=xr.ceil,zl=xr.floor,bp=Zt.getOwnPropertySymbols,P7=Bl?Bl.isBuffer:t,P2=Ee.isFinite,L7=Rl.join,B7=C2(Zt.keys,Zt),wr=xr.max,Kr=xr.min,U7=qe.now,$7=Ee.parseInt,L2=xr.random,F7=Rl.reverse,gp=va(Ee,"DataView"),Hc=va(Ee,"Map"),vp=va(Ee,"Promise"),Sf=va(Ee,"Set"),zc=va(Ee,"WeakMap"),Kc=va(Zt,"create"),Kl=zc&&new zc,Mf={},q7=ya(gp),H7=ya(Hc),z7=ya(vp),K7=ya(Sf),j7=ya(zc),jl=gs?gs.prototype:t,jc=jl?jl.valueOf:t,B2=jl?jl.toString:t;function H(s){if(fr(s)&&!vt(s)&&!(s instanceof Dt)){if(s instanceof oi)return s;if(Vt.call(s,"__wrapped__"))return Uv(s)}return new oi(s)}o(H,"lodash");var Tf=function(){function s(){}return o(s,"object"),function(f){if(!ar(f))return{};if(O2)return O2(f);s.prototype=f;var d=new s;return s.prototype=t,d}}();function Gl(){}o(Gl,"baseLodash");function oi(s,f){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=t}o(oi,"LodashWrapper"),H.templateSettings={escape:Yn,evaluate:ot,interpolate:et,variable:"",imports:{_:H}},H.prototype=Gl.prototype,H.prototype.constructor=H,oi.prototype=Tf(Gl.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 G7(){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(G7,"lazyClone");function V7(){if(this.__filtered__){var s=new Dt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}o(V7,"lazyReverse");function W7(){var s=this.__wrapped__.value(),f=this.__dir__,d=vt(s),M=f<0,B=d?s.length:0,z=sS(0,B,this.__views__),te=z.start,fe=z.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 av(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(W7,"lazyValue"),Dt.prototype=Tf(Gl.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 J7(){this.__data__=Kc?Kc(null):{},this.size=0}o(J7,"hashClear");function Y7(s){var f=this.has(s)&&delete this.__data__[s];return this.size-=f?1:0,f}o(Y7,"hashDelete");function X7(s){var f=this.__data__;if(Kc){var d=f[s];return d===c?t:d}return Vt.call(f,s)?f[s]:t}o(X7,"hashGet");function Z7(s){var f=this.__data__;return Kc?f[s]!==t:Vt.call(f,s)}o(Z7,"hashHas");function Q7(s,f){var d=this.__data__;return this.size+=this.has(s)?0:1,d[s]=Kc&&f===t?c:f,this}o(Q7,"hashSet"),pa.prototype.clear=J7,pa.prototype.delete=Y7,pa.prototype.get=X7,pa.prototype.has=Z7,pa.prototype.set=Q7;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 eA(){this.__data__=[],this.size=0}o(eA,"listCacheClear");function tA(s){var f=this.__data__,d=Vl(f,s);if(d<0)return!1;var M=f.length-1;return d==M?f.pop():Fl.call(f,d,1),--this.size,!0}o(tA,"listCacheDelete");function rA(s){var f=this.__data__,d=Vl(f,s);return d<0?t:f[d][1]}o(rA,"listCacheGet");function nA(s){return Vl(this.__data__,s)>-1}o(nA,"listCacheHas");function iA(s,f){var d=this.__data__,M=Vl(d,s);return M<0?(++this.size,d.push([s,f])):d[M][1]=f,this}o(iA,"listCacheSet"),Do.prototype.clear=eA,Do.prototype.delete=tA,Do.prototype.get=rA,Do.prototype.has=nA,Do.prototype.set=iA;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 oA(){this.size=0,this.__data__={hash:new pa,map:new(Hc||Do),string:new pa}}o(oA,"mapCacheClear");function sA(s){var f=oh(this,s).delete(s);return this.size-=f?1:0,f}o(sA,"mapCacheDelete");function aA(s){return oh(this,s).get(s)}o(aA,"mapCacheGet");function fA(s){return oh(this,s).has(s)}o(fA,"mapCacheHas");function cA(s,f){var d=oh(this,s),M=d.size;return d.set(s,f),this.size+=d.size==M?0:1,this}o(cA,"mapCacheSet"),Oo.prototype.clear=oA,Oo.prototype.delete=sA,Oo.prototype.get=aA,Oo.prototype.has=fA,Oo.prototype.set=cA;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 uA(s){return this.__data__.set(s,c),this}o(uA,"setCacheAdd");function lA(s){return this.__data__.has(s)}o(lA,"setCacheHas"),ma.prototype.add=ma.prototype.push=uA,ma.prototype.has=lA;function ki(s){var f=this.__data__=new Do(s);this.size=f.size}o(ki,"Stack");function hA(){this.__data__=new Do,this.size=0}o(hA,"stackClear");function dA(s){var f=this.__data__,d=f.delete(s);return this.size=f.size,d}o(dA,"stackDelete");function pA(s){return this.__data__.get(s)}o(pA,"stackGet");function mA(s){return this.__data__.has(s)}o(mA,"stackHas");function bA(s,f){var d=this.__data__;if(d instanceof Do){var M=d.__data__;if(!Hc||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(bA,"stackSet"),ki.prototype.clear=hA,ki.prototype.delete=dA,ki.prototype.get=pA,ki.prototype.has=mA,ki.prototype.set=bA;function U2(s,f){var d=vt(s),M=!d&&xa(s),B=!d&&!M&&_s(s),z=!d&&!M&&!B&&Df(s),te=d||M||B||z,fe=te?hp(s.length,M7):[],be=fe.length;for(var Me in s)(f||Vt.call(s,Me))&&!(te&&(Me=="length"||B&&(Me=="offset"||Me=="parent")||z&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||Lo(Me,be)))&&fe.push(Me);return fe}o(U2,"arrayLikeKeys");function $2(s){var f=s.length;return f?s[kp(0,f-1)]:t}o($2,"arraySample");function gA(s,f){return sh(pn(s),ba(f,0,s.length))}o(gA,"arraySampleSize");function vA(s){return sh(pn(s))}o(vA,"arrayShuffle");function yp(s,f,d){(d!==t&&!Ii(s[f],d)||d===t&&!(f in s))&&Ro(s,f,d)}o(yp,"assignMergeValue");function Gc(s,f,d){var M=s[f];(!(Vt.call(s,f)&&Ii(M,d))||d===t&&!(f in s))&&Ro(s,f,d)}o(Gc,"assignValue");function Vl(s,f){for(var d=s.length;d--;)if(Ii(s[d][0],f))return d;return-1}o(Vl,"assocIndexOf");function yA(s,f,d,M){return vs(s,function(B,z,te){f(M,B,d(B),te)}),M}o(yA,"baseAggregator");function F2(s,f){return s&&to(f,Ar(f),s)}o(F2,"baseAssign");function xA(s,f){return s&&to(f,bn(f),s)}o(xA,"baseAssignIn");function Ro(s,f,d){f=="__proto__"&&ql?ql(s,f,{configurable:!0,enumerable:!0,value:d,writable:!0}):s[f]=d}o(Ro,"baseAssignValue");function xp(s,f){for(var d=-1,M=f.length,B=xe(M),z=s==null;++d<M;)B[d]=z?t:em(s,f[d]);return B}o(xp,"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,z){var te,fe=f&v,be=f&x,Me=f&S;if(d&&(te=B?d(s,M,B,z):d(s)),te!==t)return te;if(!ar(s))return s;var Te=vt(s);if(Te){if(te=fS(s),!fe)return pn(s,te)}else{var Ie=jr(s),Le=Ie==ee||Ie==ne;if(_s(s))return uv(s,fe);if(Ie==re||Ie==k||Le&&!B){if(te=be||Le?{}:kv(s),!fe)return be?XA(s,xA(te,s)):YA(s,F2(te,s))}else{if(!tr[Ie])return B?s:{};te=cS(s,Ie,fe)}}z||(z=new ki);var ze=z.get(s);if(ze)return ze;z.set(s,te),iy(s)?s.forEach(function(Qe){te.add(si(Qe,f,d,Qe,s,z))}):ry(s)&&s.forEach(function(Qe,Ct){te.set(Ct,si(Qe,f,d,Ct,s,z))});var Ze=Me?be?Fp:$p:be?bn:Ar,_t=Te?t:Ze(s);return ni(_t||s,function(Qe,Ct){_t&&(Ct=Qe,Qe=s[Ct]),Gc(te,Ct,si(Qe,f,d,Ct,s,z))}),te}o(si,"baseClone");function wA(s){var f=Ar(s);return function(d){return q2(d,s,f)}}o(wA,"baseConforms");function q2(s,f,d){var M=d.length;if(s==null)return!M;for(s=Zt(s);M--;){var B=d[M],z=f[B],te=s[B];if(te===t&&!(B in s)||!z(te))return!1}return!0}o(q2,"baseConformsTo");function H2(s,f,d){if(typeof s!="function")throw new ii(i);return Qc(function(){s.apply(t,d)},f)}o(H2,"baseDelay");function Vc(s,f,d,M){var B=-1,z=Il,te=!0,fe=s.length,be=[],Me=f.length;if(!fe)return be;d&&(f=sr(f,In(d))),M?(z=sp,te=!1):f.length>=r&&(z=Fc,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 z(f,Ie,M)||be.push(Te)}return be}o(Vc,"baseDifference");var vs=mv(eo),z2=mv(_p,!0);function _A(s,f){var d=!0;return vs(s,function(M,B,z){return d=!!f(M,B,z),d}),d}o(_A,"baseEvery");function Wl(s,f,d){for(var M=-1,B=s.length;++M<B;){var z=s[M],te=f(z);if(te!=null&&(fe===t?te===te&&!On(te):d(te,fe)))var fe=te,be=z}return be}o(Wl,"baseExtremum");function EA(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:sy(M);d<M;)s[d++]=f;return s}o(EA,"baseFill");function K2(s,f){var d=[];return vs(s,function(M,B,z){f(M,B,z)&&d.push(M)}),d}o(K2,"baseFilter");function Pr(s,f,d,M,B){var z=-1,te=s.length;for(d||(d=lS),B||(B=[]);++z<te;){var fe=s[z];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 wp=bv(),j2=bv(!0);function eo(s,f){return s&&wp(s,f,Ar)}o(eo,"baseForOwn");function _p(s,f){return s&&j2(s,f,Ar)}o(_p,"baseForOwnRight");function Jl(s,f){return ds(f,function(d){return Bo(s[d])})}o(Jl,"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 G2(s,f,d){var M=f(s);return vt(s)?M:ps(M,d(s))}o(G2,"baseGetAllKeys");function nn(s){return s==null?s===t?He:ge:da&&da in Zt(s)?oS(s):vS(s)}o(nn,"baseGetTag");function Ep(s,f){return s>f}o(Ep,"baseGt");function AA(s,f){return s!=null&&Vt.call(s,f)}o(AA,"baseHas");function SA(s,f){return s!=null&&f in Zt(s)}o(SA,"baseHasIn");function MA(s,f,d){return s>=Kr(f,d)&&s<wr(f,d)}o(MA,"baseInRange");function Ap(s,f,d){for(var M=d?sp:Il,B=s[0].length,z=s.length,te=z,fe=xe(z),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?Fc(Le,Ze):M(Me,Ze,d))){for(te=z;--te;){var _t=fe[te];if(!(_t?Fc(_t,Ze):M(s[te],Ze,d)))continue e}Le&&Le.push(Ze),Me.push(ze)}}return Me}o(Ap,"baseIntersection");function TA(s,f,d,M){return eo(s,function(B,z,te){f(M,d(B),z,te)}),M}o(TA,"baseInverter");function Wc(s,f,d){f=xs(f,s),s=Rv(s,f);var M=s==null?s:s[ro(fi(f))];return M==null?t:kn(M,s,d)}o(Wc,"baseInvoke");function V2(s){return fr(s)&&nn(s)==k}o(V2,"baseIsArguments");function CA(s){return fr(s)&&nn(s)==pr}o(CA,"baseIsArrayBuffer");function kA(s){return fr(s)&&nn(s)==se}o(kA,"baseIsDate");function Jc(s,f,d,M,B){return s===f?!0:s==null||f==null||!fr(s)&&!fr(f)?s!==s&&f!==f:IA(s,f,d,M,Jc,B)}o(Jc,"baseIsEqual");function IA(s,f,d,M,B,z){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 z||(z=new ki),te||Df(s)?Mv(s,f,d,M,B,z):nS(s,f,be,d,M,B,z);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 z||(z=new ki),B(_t,Qe,d,M,z)}}return Le?(z||(z=new ki),iS(s,f,d,M,B,z)):!1}o(IA,"baseIsEqualDeep");function DA(s){return fr(s)&&jr(s)==ae}o(DA,"baseIsMap");function Sp(s,f,d,M){var B=d.length,z=B,te=!M;if(s==null)return!z;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<z;){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?Jc(Te,Me,O|R,M,Ie):Le))return!1}}return!0}o(Sp,"baseIsMatch");function W2(s){if(!ar(s)||dS(s))return!1;var f=Bo(s)?D7:qt;return f.test(ya(s))}o(W2,"baseIsNative");function OA(s){return fr(s)&&nn(s)==ve}o(OA,"baseIsRegExp");function RA(s){return fr(s)&&jr(s)==G}o(RA,"baseIsSet");function NA(s){return fr(s)&&hh(s.length)&&!!ir[nn(s)]}o(NA,"baseIsTypedArray");function J2(s){return typeof s=="function"?s:s==null?gn:typeof s=="object"?vt(s)?Z2(s[0],s[1]):X2(s):gy(s)}o(J2,"baseIteratee");function Mp(s){if(!Zc(s))return B7(s);var f=[];for(var d in Zt(s))Vt.call(s,d)&&d!="constructor"&&f.push(d);return f}o(Mp,"baseKeys");function PA(s){if(!ar(s))return gS(s);var f=Zc(s),d=[];for(var M in s)M=="constructor"&&(f||!Vt.call(s,M))||d.push(M);return d}o(PA,"baseKeysIn");function Tp(s,f){return s<f}o(Tp,"baseLt");function Y2(s,f){var d=-1,M=mn(s)?xe(s.length):[];return vs(s,function(B,z,te){M[++d]=f(B,z,te)}),M}o(Y2,"baseMap");function X2(s){var f=Hp(s);return f.length==1&&f[0][2]?Dv(f[0][0],f[0][1]):function(d){return d===s||Sp(d,s,f)}}o(X2,"baseMatches");function Z2(s,f){return Kp(s)&&Iv(f)?Dv(ro(s),f):function(d){var M=em(d,s);return M===t&&M===f?tm(d,s):Jc(f,M,O|R)}}o(Z2,"baseMatchesProperty");function Yl(s,f,d,M,B){s!==f&&wp(f,function(z,te){if(B||(B=new ki),ar(z))LA(s,f,te,d,Yl,M,B);else{var fe=M?M(Gp(s,te),z,te+"",s,f,B):t;fe===t&&(fe=z),yp(s,te,fe)}},bn)}o(Yl,"baseMerge");function LA(s,f,d,M,B,z,te){var fe=Gp(s,d),be=Gp(f,d),Me=te.get(be);if(Me){yp(s,d,Me);return}var Te=z?z(fe,be,d+"",s,f,te):t,Ie=Te===t;if(Ie){var Le=vt(be),ze=!Le&&_s(be),Ze=!Le&&!ze&&Df(be);Te=be,Le||ze||Ze?vt(fe)?Te=fe:mr(fe)?Te=pn(fe):ze?(Ie=!1,Te=uv(be,!0)):Ze?(Ie=!1,Te=lv(be,!0)):Te=[]:eu(be)||xa(be)?(Te=fe,xa(fe)?Te=ay(fe):(!ar(fe)||Bo(fe))&&(Te=kv(be))):Ie=!1}Ie&&(te.set(be,Te),B(Te,be,M,z,te),te.delete(be)),yp(s,d,Te)}o(LA,"baseMergeDeep");function Q2(s,f){var d=s.length;if(!!d)return f+=f<0?d:0,Lo(f,d)?s[f]:t}o(Q2,"baseNth");function ev(s,f,d){f.length?f=sr(f,function(z){return vt(z)?function(te){return ga(te,z.length===1?z[0]:z)}:z}):f=[gn];var M=-1;f=sr(f,In(Ye()));var B=Y2(s,function(z,te,fe){var be=sr(f,function(Me){return Me(z)});return{criteria:be,index:++M,value:z}});return c7(B,function(z,te){return JA(z,te,d)})}o(ev,"baseOrderBy");function BA(s,f){return tv(s,f,function(d,M){return tm(s,M)})}o(BA,"basePick");function tv(s,f,d){for(var M=-1,B=f.length,z={};++M<B;){var te=f[M],fe=ga(s,te);d(fe,te)&&Yc(z,xs(te,s),fe)}return z}o(tv,"basePickBy");function UA(s){return function(f){return ga(f,s)}}o(UA,"basePropertyDeep");function Cp(s,f,d,M){var B=M?f7:wf,z=-1,te=f.length,fe=s;for(s===f&&(f=pn(f)),d&&(fe=sr(s,In(d)));++z<te;)for(var be=0,Me=f[z],Te=d?d(Me):Me;(be=B(fe,Te,be,M))>-1;)fe!==s&&Fl.call(fe,be,1),Fl.call(s,be,1);return s}o(Cp,"basePullAll");function rv(s,f){for(var d=s?f.length:0,M=d-1;d--;){var B=f[d];if(d==M||B!==z){var z=B;Lo(B)?Fl.call(s,B,1):Op(s,B)}}return s}o(rv,"basePullAt");function kp(s,f){return s+zl(L2()*(f-s+1))}o(kp,"baseRandom");function $A(s,f,d,M){for(var B=-1,z=wr(Hl((f-s)/(d||1)),0),te=xe(z);z--;)te[M?z:++B]=s,s+=d;return te}o($A,"baseRange");function Ip(s,f){var d="";if(!s||f<1||f>_)return d;do f%2&&(d+=s),f=zl(f/2),f&&(s+=s);while(f);return d}o(Ip,"baseRepeat");function St(s,f){return Vp(Ov(s,f,gn),s+"")}o(St,"baseRest");function FA(s){return $2(Of(s))}o(FA,"baseSample");function qA(s,f){var d=Of(s);return sh(d,ba(f,0,d.length))}o(qA,"baseSampleSize");function Yc(s,f,d,M){if(!ar(s))return s;f=xs(f,s);for(var B=-1,z=f.length,te=z-1,fe=s;fe!=null&&++B<z;){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])?[]:{})}Gc(fe,be,Me),fe=fe[be]}return s}o(Yc,"baseSet");var nv=Kl?function(s,f){return Kl.set(s,f),s}:gn,HA=ql?function(s,f){return ql(s,"toString",{configurable:!0,enumerable:!1,value:nm(f),writable:!0})}:gn;function zA(s){return sh(Of(s))}o(zA,"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 z=xe(B);++M<B;)z[M]=s[M+f];return z}o(ai,"baseSlice");function KA(s,f){var d;return vs(s,function(M,B,z){return d=f(M,B,z),!d}),!!d}o(KA,"baseSome");function Xl(s,f,d){var M=0,B=s==null?M:s.length;if(typeof f=="number"&&f===f&&B<=N){for(;M<B;){var z=M+B>>>1,te=s[z];te!==null&&!On(te)&&(d?te<=f:te<f)?M=z+1:B=z}return B}return Dp(s,f,gn,d)}o(Xl,"baseSortedIndex");function Dp(s,f,d,M){var B=0,z=s==null?0:s.length;if(z===0)return 0;f=d(f);for(var te=f!==f,fe=f===null,be=On(f),Me=f===t;B<z;){var Te=zl((B+z)/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:z=Te}return Kr(z,C)}o(Dp,"baseSortedIndexBy");function iv(s,f){for(var d=-1,M=s.length,B=0,z=[];++d<M;){var te=s[d],fe=f?f(te):te;if(!d||!Ii(fe,be)){var be=fe;z[B++]=te===0?0:te}}return z}o(iv,"baseSortedUniq");function ov(s){return typeof s=="number"?s:On(s)?E:+s}o(ov,"baseToNumber");function Dn(s){if(typeof s=="string")return s;if(vt(s))return sr(s,Dn)+"";if(On(s))return B2?B2.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=Il,z=s.length,te=!0,fe=[],be=fe;if(d)te=!1,B=sp;else if(z>=r){var Me=f?null:tS(s);if(Me)return Ol(Me);te=!1,B=Fc,be=new ma}else be=f?[]:fe;e:for(;++M<z;){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 Op(s,f){return f=xs(f,s),s=Rv(s,f),s==null||delete s[ro(fi(f))]}o(Op,"baseUnset");function sv(s,f,d,M){return Yc(s,f,d(ga(s,f)),M)}o(sv,"baseUpdate");function Zl(s,f,d,M){for(var B=s.length,z=M?B:-1;(M?z--:++z<B)&&f(s[z],z,s););return d?ai(s,M?0:z,M?z+1:B):ai(s,M?z+1:0,M?B:z)}o(Zl,"baseWhile");function av(s,f){var d=s;return d instanceof Dt&&(d=d.value()),ap(f,function(M,B){return B.func.apply(B.thisArg,ps([M],B.args))},d)}o(av,"baseWrapperValue");function Rp(s,f,d){var M=s.length;if(M<2)return M?ys(s[0]):[];for(var B=-1,z=xe(M);++B<M;)for(var te=s[B],fe=-1;++fe<M;)fe!=B&&(z[B]=Vc(z[B]||te,s[fe],f,d));return ys(Pr(z,1),f,d)}o(Rp,"baseXor");function fv(s,f,d){for(var M=-1,B=s.length,z=f.length,te={};++M<B;){var fe=M<z?f[M]:t;d(te,s[M],fe)}return te}o(fv,"baseZipObject");function Np(s){return mr(s)?s:[]}o(Np,"castArrayLikeObject");function Pp(s){return typeof s=="function"?s:gn}o(Pp,"castFunction");function xs(s,f){return vt(s)?s:Kp(s,f)?[s]:Bv(Kt(s))}o(xs,"castPath");var jA=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 cv=O7||function(s){return Er.clearTimeout(s)};function uv(s,f){if(f)return s.slice();var d=s.length,M=D2?D2(d):new s.constructor(d);return s.copy(M),M}o(uv,"cloneBuffer");function Lp(s){var f=new s.constructor(s.byteLength);return new Ul(f).set(new Ul(s)),f}o(Lp,"cloneArrayBuffer");function GA(s,f){var d=f?Lp(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.byteLength)}o(GA,"cloneDataView");function VA(s){var f=new s.constructor(s.source,tt.exec(s));return f.lastIndex=s.lastIndex,f}o(VA,"cloneRegExp");function WA(s){return jc?Zt(jc.call(s)):{}}o(WA,"cloneSymbol");function lv(s,f){var d=f?Lp(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.length)}o(lv,"cloneTypedArray");function hv(s,f){if(s!==f){var d=s!==t,M=s===null,B=s===s,z=On(s),te=f!==t,fe=f===null,be=f===f,Me=On(f);if(!fe&&!Me&&!z&&s>f||z&&te&&be&&!fe&&!Me||M&&te&&be||!d&&be||!B)return 1;if(!M&&!z&&!Me&&s<f||Me&&d&&B&&!M&&!z||fe&&d&&B||!te&&B||!be)return-1}return 0}o(hv,"compareAscending");function JA(s,f,d){for(var M=-1,B=s.criteria,z=f.criteria,te=B.length,fe=d.length;++M<te;){var be=hv(B[M],z[M]);if(be){if(M>=fe)return be;var Me=d[M];return be*(Me=="desc"?-1:1)}}return s.index-f.index}o(JA,"compareMultiple");function dv(s,f,d,M){for(var B=-1,z=s.length,te=d.length,fe=-1,be=f.length,Me=wr(z-te,0),Te=xe(be+Me),Ie=!M;++fe<be;)Te[fe]=f[fe];for(;++B<te;)(Ie||B<z)&&(Te[d[B]]=s[B]);for(;Me--;)Te[fe++]=s[B++];return Te}o(dv,"composeArgs");function pv(s,f,d,M){for(var B=-1,z=s.length,te=-1,fe=d.length,be=-1,Me=f.length,Te=wr(z-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<z)&&(Ie[ze+d[te]]=s[B++]);return Ie}o(pv,"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 z=-1,te=f.length;++z<te;){var fe=f[z],be=M?M(d[fe],s[fe],fe,d,s):t;be===t&&(be=s[fe]),B?Ro(d,fe,be):Gc(d,fe,be)}return d}o(to,"copyObject");function YA(s,f){return to(s,zp(s),f)}o(YA,"copySymbols");function XA(s,f){return to(s,Tv(s),f)}o(XA,"copySymbolsIn");function Ql(s,f){return function(d,M){var B=vt(d)?r7:yA,z=f?f():{};return B(d,s,Ye(M,2),z)}}o(Ql,"createAggregator");function Cf(s){return St(function(f,d){var M=-1,B=d.length,z=B>1?d[B-1]:t,te=B>2?d[2]:t;for(z=s.length>3&&typeof z=="function"?(B--,z):t,te&&on(d[0],d[1],te)&&(z=B<3?t:z,B=1),f=Zt(f);++M<B;){var fe=d[M];fe&&s(f,fe,M,z)}return f})}o(Cf,"createAssigner");function mv(s,f){return function(d,M){if(d==null)return d;if(!mn(d))return s(d,M);for(var B=d.length,z=f?B:-1,te=Zt(d);(f?z--:++z<B)&&M(te[z],z,te)!==!1;);return d}}o(mv,"createBaseEach");function bv(s){return function(f,d,M){for(var B=-1,z=Zt(f),te=M(f),fe=te.length;fe--;){var be=te[s?fe:++B];if(d(z[be],be,z)===!1)break}return f}}o(bv,"createBaseFor");function ZA(s,f,d){var M=f&D,B=Xc(s);function z(){var te=this&&this!==Er&&this instanceof z?B:s;return te.apply(M?d:this,arguments)}return o(z,"wrapper"),z}o(ZA,"createBind");function gv(s){return function(f){f=Kt(f);var d=_f(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(gv,"createCaseFirst");function kf(s){return function(f){return ap(my(py(f).replace(H9,"")),s,"")}}o(kf,"createCompounder");function Xc(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=Tf(s.prototype),M=s.apply(d,f);return ar(M)?M:d}}o(Xc,"createCtor");function QA(s,f,d){var M=Xc(s);function B(){for(var z=arguments.length,te=xe(z),fe=z,be=If(B);fe--;)te[fe]=arguments[fe];var Me=z<3&&te[0]!==be&&te[z-1]!==be?[]:ms(te,be);if(z-=Me.length,z<d)return _v(s,f,eh,B.placeholder,t,te,Me,t,t,d-z);var Te=this&&this!==Er&&this instanceof B?M:s;return kn(Te,this,te)}return o(B,"wrapper"),B}o(QA,"createCurry");function vv(s){return function(f,d,M){var B=Zt(f);if(!mn(f)){var z=Ye(d,3);f=Ar(f),d=o(function(fe){return z(B[fe],fe,B)},"predicate")}var te=s(f,d,M);return te>-1?B[z?f[te]:te]:t}}o(vv,"createFind");function yv(s){return Po(function(f){var d=f.length,M=d,B=oi.prototype.thru;for(s&&f.reverse();M--;){var z=f[M];if(typeof z!="function")throw new ii(i);if(B&&!te&&ih(z)=="wrapper")var te=new oi([],!0)}for(M=te?M:d;++M<d;){z=f[M];var fe=ih(z),be=fe=="wrapper"?qp(z):t;be&&jp(be[0])&&be[1]==(oe|L|Q|K)&&!be[4].length&&be[9]==1?te=te[ih(be[0])].apply(te,be[3]):te=z.length==1&&jp(z)?te[fe]():te.thru(z)}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(yv,"createFlow");function eh(s,f,d,M,B,z,te,fe,be,Me){var Te=f&oe,Ie=f&D,Le=f&P,ze=f&(L|W),Ze=f&q,_t=Le?t:Xc(s);function Qe(){for(var Ct=arguments.length,Nt=xe(Ct),Rn=Ct;Rn--;)Nt[Rn]=arguments[Rn];if(ze)var sn=If(Qe),Nn=l7(Nt,sn);if(M&&(Nt=dv(Nt,M,B,ze)),z&&(Nt=pv(Nt,z,te,ze)),Ct-=Nn,ze&&Ct<Me){var br=ms(Nt,sn);return _v(s,f,eh,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=yS(Nt,fe):Ze&&Ct>1&&Nt.reverse(),Te&&be<Ct&&(Nt.length=be),this&&this!==Er&&this instanceof Qe&&($o=_t||Xc($o)),$o.apply(Di,Nt)}return o(Qe,"wrapper"),Qe}o(eh,"createHybrid");function xv(s,f){return function(d,M){return TA(d,s,f(M),{})}}o(xv,"createInverter");function th(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=ov(d),M=ov(M)),B=s(d,M)}return B}}o(th,"createMathOperation");function Bp(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(Bp,"createOver");function rh(s,f){f=f===t?" ":Dn(f);var d=f.length;if(d<2)return d?Ip(f,s):f;var M=Ip(f,Hl(s/Ef(f)));return _f(f)?ws(Ci(M),0,s).join(""):M.slice(0,s)}o(rh,"createPadding");function eS(s,f,d,M){var B=f&D,z=Xc(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?z: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(eS,"createPartial");function wv(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),$A(f,d,M,s)}}o(wv,"createRange");function nh(s){return function(f,d){return typeof f=="string"&&typeof d=="string"||(f=ci(f),d=ci(d)),s(f,d)}}o(nh,"createRelationalOperation");function _v(s,f,d,M,B,z,te,fe,be,Me){var Te=f&L,Ie=Te?te:t,Le=Te?t:te,ze=Te?z:t,Ze=Te?t:z;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 jp(s)&&Nv(Qe,_t),Qe.placeholder=M,Pv(Qe,s,f)}o(_v,"createRecurry");function Up(s){var f=xr[s];return function(d,M){if(d=ci(d),M=M==null?0:Kr(wt(M),292),M&&P2(d)){var B=(Kt(d)+"e").split("e"),z=f(B[0]+"e"+(+B[1]+M));return B=(Kt(z)+"e").split("e"),+(B[0]+"e"+(+B[1]-M))}return f(d)}}o(Up,"createRound");var tS=Sf&&1/Ol(new Sf([,-0]))[1]==p?function(s){return new Sf(s)}:sm;function Ev(s){return function(f){var d=jr(f);return d==ae?pp(f):d==G?v7(f):u7(f,s(f))}}o(Ev,"createToPairs");function No(s,f,d,M,B,z,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:qp(s),ze=[s,f,d,M,B,Te,Ie,z,te,fe];if(Le&&bS(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=ZA(s,f,d);else f==L||f==W?Ze=QA(s,f,fe):(f==Q||f==(D|Q))&&!B.length?Ze=eS(s,f,d,M):Ze=eh.apply(t,ze);var _t=Le?nv:Nv;return Pv(_t(Ze,ze),s,f)}o(No,"createWrap");function Av(s,f,d,M){return s===t||Ii(s,Af[d])&&!Vt.call(M,d)?f:s}o(Av,"customDefaultsAssignIn");function Sv(s,f,d,M,B,z){return ar(s)&&ar(f)&&(z.set(f,s),Yl(s,f,t,Sv,z),z.delete(f)),s}o(Sv,"customDefaultsMerge");function rS(s){return eu(s)?t:s}o(rS,"customOmitClone");function Mv(s,f,d,M,B,z){var te=d&O,fe=s.length,be=f.length;if(fe!=be&&!(te&&be>fe))return!1;var Me=z.get(s),Te=z.get(f);if(Me&&Te)return Me==f&&Te==s;var Ie=-1,Le=!0,ze=d&R?new ma:t;for(z.set(s,f),z.set(f,s);++Ie<fe;){var Ze=s[Ie],_t=f[Ie];if(M)var Qe=te?M(_t,Ze,Ie,f,s,z):M(Ze,_t,Ie,s,f,z);if(Qe!==t){if(Qe)continue;Le=!1;break}if(ze){if(!fp(f,function(Ct,Nt){if(!Fc(ze,Nt)&&(Ze===Ct||B(Ze,Ct,d,M,z)))return ze.push(Nt)})){Le=!1;break}}else if(!(Ze===_t||B(Ze,_t,d,M,z))){Le=!1;break}}return z.delete(s),z.delete(f),Le}o(Mv,"equalArrays");function nS(s,f,d,M,B,z,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||!z(new Ul(s),new Ul(f)));case Z:case se:case Ae:return Ii(+s,+f);case $:return s.name==f.name&&s.message==f.message;case ve:case pe:return s==f+"";case ae:var fe=pp;case G:var be=M&O;if(fe||(fe=Ol),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=Mv(fe(s),fe(f),M,B,z,te);return te.delete(s),Te;case Ce:if(jc)return jc.call(s)==jc.call(f)}return!1}o(nS,"equalByTag");function iS(s,f,d,M,B,z){var te=d&O,fe=$p(s),be=fe.length,Me=$p(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=z.get(s),Ze=z.get(f);if(ze&&Ze)return ze==f&&Ze==s;var _t=!0;z.set(s,f),z.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,z):M(Ct,Nt,Le,s,f,z);if(!(Rn===t?Ct===Nt||B(Ct,Nt,d,M,z):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 z.delete(s),z.delete(f),_t}o(iS,"equalObjects");function Po(s){return Vp(Ov(s,t,qv),s+"")}o(Po,"flatRest");function $p(s){return G2(s,Ar,zp)}o($p,"getAllKeys");function Fp(s){return G2(s,bn,Tv)}o(Fp,"getAllKeysIn");var qp=Kl?function(s){return Kl.get(s)}:sm;function ih(s){for(var f=s.name+"",d=Mf[f],M=Vt.call(Mf,f)?d.length:0;M--;){var B=d[M],z=B.func;if(z==null||z==s)return B.name}return f}o(ih,"getFuncName");function If(s){var f=Vt.call(H,"placeholder")?H:s;return f.placeholder}o(If,"getHolder");function Ye(){var s=H.iteratee||im;return s=s===im?J2:s,arguments.length?s(arguments[0],arguments[1]):s}o(Ye,"getIteratee");function oh(s,f){var d=s.__data__;return hS(f)?d[typeof f=="string"?"string":"hash"]:d.map}o(oh,"getMapData");function Hp(s){for(var f=Ar(s),d=f.length;d--;){var M=f[d],B=s[M];f[d]=[M,B,Iv(B)]}return f}o(Hp,"getMatchData");function va(s,f){var d=m7(s,f);return W2(d)?d:t}o(va,"getNative");function oS(s){var f=Vt.call(s,da),d=s[da];try{s[da]=t;var M=!0}catch{}var B=Ll.call(s);return M&&(f?s[da]=d:delete s[da]),B}o(oS,"getRawTag");var zp=bp?function(s){return s==null?[]:(s=Zt(s),ds(bp(s),function(f){return R2.call(s,f)}))}:am,Tv=bp?function(s){for(var f=[];s;)ps(f,zp(s)),s=$l(s);return f}:am,jr=nn;(gp&&jr(new gp(new ArrayBuffer(1)))!=ue||Hc&&jr(new Hc)!=ae||vp&&jr(vp.resolve())!=Se||Sf&&jr(new Sf)!=G||zc&&jr(new zc)!=Re)&&(jr=o(function(s){var f=nn(s),d=f==re?s.constructor:t,M=d?ya(d):"";if(M)switch(M){case q7:return ue;case H7:return ae;case z7:return Se;case K7:return G;case j7:return Re}return f},"getTag"));function sS(s,f,d){for(var M=-1,B=d.length;++M<B;){var z=d[M],te=z.size;switch(z.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(sS,"getView");function aS(s){var f=s.match(ut);return f?f[1].split(Qn):[]}o(aS,"getWrapDetails");function Cv(s,f,d){f=xs(f,s);for(var M=-1,B=f.length,z=!1;++M<B;){var te=ro(f[M]);if(!(z=s!=null&&d(s,te)))break;s=s[te]}return z||++M!=B?z:(B=s==null?0:s.length,!!B&&hh(B)&&Lo(te,B)&&(vt(s)||xa(s)))}o(Cv,"hasPath");function fS(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(fS,"initCloneArray");function kv(s){return typeof s.constructor=="function"&&!Zc(s)?Tf($l(s)):{}}o(kv,"initCloneObject");function cS(s,f,d){var M=s.constructor;switch(f){case pr:return Lp(s);case Z:case se:return new M(+s);case ue:return GA(s,d);case ie:case U:case X:case me:case ye:case we:case ke:case It:case Ue:return lv(s,d);case ae:return new M;case Ae:case pe:return new M(s);case ve:return VA(s);case G:return new M;case Ce:return WA(s)}}o(cS,"initCloneByTag");function uS(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(qS,"insertWrapDetails");function HS(s){return vt(s)||ya(s)||!!(U2&&s&&s[U2])}o(HS,"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 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 zS(s){var f=typeof s;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?s!=="__proto__":s===null}o(zS,"isKeyable");function Jp(s){var f=ih(s),d=H[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 KS(s){return!!N2&&N2 in s}o(KS,"isMasked");var jS=Nl?Bo:hm;function Zc(s){var f=s&&s.constructor,d=typeof f=="function"&&f.prototype||Ef;return s===d}o(Zc,"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 GS(s){var f=uh(s,function(M){return d.size===u&&d.clear(),M}),d=f.cache;return f}o(GS,"memoizeCapped");function VS(s,f){var d=s[1],M=f[1],B=d|M,z=B<(I|N|oe),te=M==oe&&d==L||M==oe&&d==K&&s[7].length<=f[8]||M==(oe|K)&&f[7].length<=f[8]&&d==L;if(!(z||te))return s;M&I&&(s[2]=f[2],B|=d&I?0:J);var fe=f[3];if(fe){var be=s[3];s[3]=be?gv(be,fe,f[4]):fe,s[4]=be?ps(s[3],p):f[4]}return fe=f[5],fe&&(be=s[5],s[5]=be?vv(be,fe,f[6]):fe,s[6]=be?ps(s[5],p):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(VS,"mergeData");function WS(s){var f=[];if(s!=null)for(var d in Zt(s))f.push(d);return f}o(WS,"nativeKeysIn");function JS(s){return Ll.call(s)}o(JS,"objectToString");function Lv(s,f,d){return f=wr(f===t?s.length-1:f,0),function(){for(var M=arguments,B=-1,z=wr(M.length-f,0),te=xe(z);++B<z;)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(Lv,"overRest");function Bv(s,f){return f.length<2?s:ba(s,ai(f,0,-1))}o(Bv,"parent");function YS(s,f){for(var d=s.length,M=Kr(f.length,d),B=pn(s);M--;){var z=f[M];s[M]=Lo(z,d)?B[z]:t}return s}o(YS,"reorder");function Yp(s,f){if(!(f==="constructor"&&typeof s[f]=="function")&&f!="__proto__")return s[f]}o(Yp,"safeGet");var Uv=Fv(av),Qc=lA||function(s,f){return Er.setTimeout(s,f)},Xp=Fv(yS);function $v(s,f,d){var M=f+"";return Xp(s,qS(M,XS(US(M),d)))}o($v,"setWrapToString");function Fv(s){var f=0,d=0;return function(){var M=mA(),B=h-(M-d);if(d=M,B>0){if(++f>=T)return arguments[0]}else f=0;return s.apply(t,arguments)}}o(Fv,"shortOut");function sh(s,f){var d=-1,M=s.length,B=M-1;for(f=f===t?M:f;++d<f;){var z=Rp(d,B),te=s[z];s[z]=s[d],s[d]=te}return s.length=f,s}o(sh,"shuffleSelf");var qv=GS(function(s){var f=[];return s.charCodeAt(0)===46&&f.push(""),s.replace(at,function(d,M,B,z){f.push(B?z.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==-m?"-0":f}o(ro,"toKey");function va(s){if(s!=null){try{return Pl.call(s)}catch{}try{return s+""}catch{}}return""}o(va,"toSource");function XS(s,f){return ni(w,function(d){var M="_."+d[0];f&d[1]&&!Il(s,M)&&s.push(M)}),s.sort()}o(XS,"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 ZS(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,z=0,te=xe(Hl(M/f));B<M;)te[z++]=ai(s,B,B+=f);return te}o(ZS,"chunk");function QS(s){for(var f=-1,d=s==null?0:s.length,M=0,B=[];++f<d;){var z=s[f];z&&(B[M++]=z)}return B}o(QS,"compact");function eM(){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 ds(vt(d)?pn(d):[d],Pr(f,1))}o(eM,"concat");var tM=St(function(s,f){return mr(s)?Vc(s,Pr(f,1,mr,!0)):[]}),rM=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Vc(s,Pr(f,1,mr,!0),Ye(d,2)):[]}),nM=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Vc(s,Pr(f,1,mr,!0),t,d):[]});function iM(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(iM,"drop");function oM(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(oM,"dropRight");function sM(s,f){return s&&s.length?Zl(s,Ye(f,3),!0,!0):[]}o(sM,"dropRightWhile");function aM(s,f){return s&&s.length?Zl(s,Ye(f,3),!0):[]}o(aM,"dropWhile");function fM(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),eS(s,f,d,M)):[]}o(fM,"fill");function zv(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)),Dl(s,Ye(f,3),B)}o(zv,"findIndex");function Kv(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)),Dl(s,Ye(f,3),B,!0)}o(Kv,"findLastIndex");function jv(s){var f=s==null?0:s.length;return f?Pr(s,1):[]}o(jv,"flatten");function cM(s){var f=s==null?0:s.length;return f?Pr(s,m):[]}o(cM,"flattenDeep");function uM(s,f){var d=s==null?0:s.length;return d?(f=f===t?1:wt(f),Pr(s,f)):[]}o(uM,"flattenDepth");function lM(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(lM,"fromPairs");function Gv(s){return s&&s.length?s[0]:t}o(Gv,"head");function hM(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)),xf(s,f,B)}o(hM,"indexOf");function dM(s){var f=s==null?0:s.length;return f?ai(s,0,-1):[]}o(dM,"initial");var pM=St(function(s){var f=sr(s,Up);return f.length&&f[0]===s[0]?Cp(f):[]}),mM=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)):[]}),bM=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 gM(s,f){return s==null?"":dA.call(s,f)}o(gM,"join");function fi(s){var f=s==null?0:s.length;return f?s[f-1]:t}o(fi,"last");function vM(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?X7(s,f,B):Dl(s,M2,B,!0)}o(vM,"lastIndexOf");function yM(s,f){return s&&s.length?nv(s,wt(f)):t}o(yM,"nth");var xM=St(Vv);function Vv(s,f){return s&&s.length&&f&&f.length?Op(s,f):s}o(Vv,"pullAll");function wM(s,f,d){return s&&s.length&&f&&f.length?Op(s,f,Ye(d,2)):s}o(wM,"pullAllBy");function _M(s,f,d){return s&&s.length&&f&&f.length?Op(s,f,t,d):s}o(_M,"pullAllWith");var EM=Po(function(s,f){var d=s==null?0:s.length,M=Ap(s,f);return sv(s,sr(f,function(B){return Lo(B,d)?+B:B}).sort(bv)),M});function AM(s,f){var d=[];if(!(s&&s.length))return d;var M=-1,B=[],z=s.length;for(f=Ye(f,3);++M<z;){var te=s[M];f(te,M,s)&&(d.push(te),B.push(M))}return sv(s,B),d}o(AM,"remove");function Zp(s){return s==null?s:gA.call(s)}o(Zp,"reverse");function SM(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(SM,"slice");function MM(s,f){return Xl(s,f)}o(MM,"sortedIndex");function TM(s,f,d){return Pp(s,f,Ye(d,2))}o(TM,"sortedIndexBy");function CM(s,f){var d=s==null?0:s.length;if(d){var M=Xl(s,f);if(M<d&&Ii(s[M],f))return M}return-1}o(CM,"sortedIndexOf");function kM(s,f){return Xl(s,f,!0)}o(kM,"sortedLastIndex");function IM(s,f,d){return Pp(s,f,Ye(d,2),!0)}o(IM,"sortedLastIndexBy");function DM(s,f){var d=s==null?0:s.length;if(d){var M=Xl(s,f,!0)-1;if(Ii(s[M],f))return M}return-1}o(DM,"sortedLastIndexOf");function OM(s){return s&&s.length?fv(s):[]}o(OM,"sortedUniq");function RM(s,f){return s&&s.length?fv(s,Ye(f,2)):[]}o(RM,"sortedUniqBy");function NM(s){var f=s==null?0:s.length;return f?ai(s,1,f):[]}o(NM,"tail");function PM(s,f,d){return s&&s.length?(f=d||f===t?1:wt(f),ai(s,0,f<0?0:f)):[]}o(PM,"take");function LM(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(LM,"takeRight");function BM(s,f){return s&&s.length?Zl(s,Ye(f,3),!1,!0):[]}o(BM,"takeRightWhile");function UM(s,f){return s&&s.length?Zl(s,Ye(f,3)):[]}o(UM,"takeWhile");var $M=St(function(s){return vs(Pr(s,1,mr,!0))}),FM=St(function(s){var f=fi(s);return mr(f)&&(f=t),vs(Pr(s,1,mr,!0),Ye(f,2))}),qM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,vs(Pr(s,1,mr,!0),t,f)});function HM(s){return s&&s.length?vs(s):[]}o(HM,"uniq");function zM(s,f){return s&&s.length?vs(s,Ye(f,2)):[]}o(zM,"uniqBy");function KM(s,f){return f=typeof f=="function"?f:t,s&&s.length?vs(s,t,f):[]}o(KM,"uniqWith");function Qp(s){if(!(s&&s.length))return[];var f=0;return s=hs(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 jM=St(function(s,f){return mr(s)?Vc(s,f):[]}),GM=St(function(s){return Bp(hs(s,mr))}),VM=St(function(s){var f=fi(s);return mr(f)&&(f=t),Bp(hs(s,mr),Ye(f,2))}),WM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,Bp(hs(s,mr),t,f)}),JM=St(Qp);function YM(s,f){return hv(s||[],f||[],Gc)}o(YM,"zipObject");function XM(s,f){return hv(s||[],f||[],Yc)}o(XM,"zipObjectDeep");var ZM=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=H(s);return f.__chain__=!0,f}o(Jv,"chain");function QM(s,f){return f(s),s}o(QM,"tap");function ah(s,f){return f(s)}o(ah,"thru");var eT=Po(function(s){var f=s.length,d=f?s[0]:0,M=this.__wrapped__,B=o(function(z){return Ap(z,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:ah,args:[B],thisArg:t}),new oi(M,this.__chain__).thru(function(z){return f&&!z.length&&z.push(t),z}))});function tT(){return Jv(this)}o(tT,"wrapperChain");function rT(){return new oi(this.value(),this.__chain__)}o(rT,"wrapperCommit");function nT(){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(nT,"wrapperNext");function iT(){return this}o(iT,"wrapperToIterator");function oT(s){for(var f,d=this;d instanceof Gl;){var M=Hv(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(oT,"wrapperPlant");function sT(){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:ah,args:[Zp],thisArg:t}),new oi(f,this.__chain__)}return this.thru(Zp)}o(sT,"wrapperReverse");function aT(){return lv(this.__wrapped__,this.__actions__)}o(aT,"wrapperValue");var fT=Ql(function(s,f,d){Vt.call(s,d)?++s[d]:Ro(s,d,1)});function cT(s,f,d){var M=vt(s)?A2:QA;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(cT,"every");function uT(s,f){var d=vt(s)?hs:W2;return d(s,Ye(f,3))}o(uT,"filter");var lT=_v(zv),hT=_v(Kv);function dT(s,f){return Pr(fh(s,f),1)}o(dT,"flatMap");function pT(s,f){return Pr(fh(s,f),m)}o(pT,"flatMapDeep");function mT(s,f,d){return d=d===t?1:wt(d),Pr(fh(s,f),d)}o(mT,"flatMapDepth");function Yv(s,f){var d=vt(s)?ni:gs;return d(s,Ye(f,3))}o(Yv,"forEach");function Xv(s,f){var d=vt(s)?N7:V2;return d(s,Ye(f,3))}o(Xv,"forEachRight");var bT=Ql(function(s,f,d){Vt.call(s,d)?s[d].push(f):Ro(s,d,[f])});function gT(s,f,d,M){s=mn(s)?s:Df(s),d=d&&!M?wt(d):0;var B=s.length;return d<0&&(d=wr(B+d,0)),dh(s)?d<=B&&s.indexOf(f,d)>-1:!!B&&xf(s,f,d)>-1}o(gT,"includes");var vT=St(function(s,f,d){var M=-1,B=typeof f=="function",z=mn(s)?xe(s.length):[];return gs(s,function(te){z[++M]=B?kn(f,te,d):Wc(te,f,d)}),z}),yT=Ql(function(s,f,d){Ro(s,d,f)});function fh(s,f){var d=vt(s)?sr:ev;return d(s,Ye(f,3))}o(fh,"map");function xT(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(xT,"orderBy");var wT=Ql(function(s,f,d){s[d?0:1].push(f)},function(){return[[],[]]});function _T(s,f,d){var M=vt(s)?lp:C2,B=arguments.length<3;return M(s,Ye(f,4),d,B,gs)}o(_T,"reduce");function ET(s,f,d){var M=vt(s)?P7:C2,B=arguments.length<3;return M(s,Ye(f,4),d,B,V2)}o(ET,"reduceRight");function AT(s,f){var d=vt(s)?hs:W2;return d(s,lh(Ye(f,3)))}o(AT,"reject");function ST(s){var f=vt(s)?z2:gS;return f(s)}o(ST,"sample");function MT(s,f,d){(d?on(s,f,d):f===t)?f=1:f=wt(f);var M=vt(s)?WA:vS;return M(s,f)}o(MT,"sampleSize");function TT(s){var f=vt(s)?JA:xS;return f(s)}o(TT,"shuffle");function CT(s){if(s==null)return 0;if(mn(s))return dh(s)?_f(s):s.length;var f=jr(s);return f==ae||f==G?s.size:Ip(s).length}o(CT,"size");function kT(s,f,d){var M=vt(s)?hp:wS;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(kT,"some");var IT=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),[])}),ch=uA||function(){return Er.Date.now()};function DT(s,f){if(typeof f!="function")throw new ii(i);return s=wt(s),function(){if(--s<1)return f.apply(this,arguments)}}o(DT,"after");function Zv(s,f,d){return f=d?t:f,f=s&&f==null?s.length:f,No(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=I;if(d.length){var B=ps(d,kf(em));M|=Z}return No(s,M,f,d,B)}),ey=St(function(s,f,d){var M=I|N;if(d.length){var B=ps(d,kf(ey));M|=Z}return No(f,M,s,d,B)});function ty(s,f,d){f=d?t:f;var M=No(s,L,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=No(s,V,t,t,t,t,t,f);return M.placeholder=ry.placeholder,M}o(ry,"curryRight");function ny(s,f,d){var M,B,z,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,z=Ie?wr(ci(d.maxWait)||0,f):z,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=Qc(Ct,f),Te?ze(br):te}o(Ze,"leadingEdge");function _t(br){var Di=br-be,$o=br-Me,_y=f-Di;return Ie?Kr(_y,z-$o):_y}o(_t,"remainingWait");function Qe(br){var Di=br-be,$o=br-Me;return be===t||Di>=f||Di<0||Ie&&$o>=z}o(Qe,"shouldInvoke");function Ct(){var br=ch();if(Qe(br))return Nt(br);fe=Qc(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&&dv(fe),Me=0,M=be=B=fe=t}o(Rn,"cancel");function sn(){return fe===t?te:Nt(ch())}o(sn,"flush");function Nn(){var br=ch(),Di=Qe(br);if(M=arguments,B=this,be=br,Di){if(fe===t)return Ze(be);if(Ie)return dv(fe),fe=Qc(Ct,f),ze(be)}return fe===t&&(fe=Qc(Ct,f)),te}return o(Nn,"debounced"),Nn.cancel=Rn,Nn.flush=sn,Nn}o(ny,"debounce");var OT=St(function(s,f){return G2(s,1,f)}),RT=St(function(s,f,d){return G2(s,ci(f)||0,d)});function NT(s){return No(s,q)}o(NT,"flip");function uh(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],z=d.cache;if(z.has(B))return z.get(B);var te=s.apply(this,M);return d.cache=z.set(B,te)||z,te},"memoized");return d.cache=new(uh.Cache||Oo),d}o(uh,"memoize"),uh.Cache=Oo;function lh(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(lh,"negate");function PT(s){return Qv(2,s)}o(PT,"once");var LT=_S(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,z=Kr(M.length,d);++B<z;)M[B]=f[B].call(this,M[B]);return kn(s,this,M)})}),tm=St(function(s,f){var d=ps(f,kf(tm));return No(s,Z,t,f,d)}),iy=St(function(s,f){var d=ps(f,kf(iy));return No(s,Y,t,f,d)}),BT=Po(function(s,f){return No(s,K,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 $T(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=xs(d,0,f);return M&&ds(B,M),kn(s,this,B)})}o($T,"spread");function FT(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),ny(s,f,{leading:M,maxWait:f,trailing:B})}o(FT,"throttle");function qT(s){return Zv(s,1)}o(qT,"unary");function HT(s,f){return tm($p(f),s)}o(HT,"wrap");function zT(){if(!arguments.length)return[];var s=arguments[0];return vt(s)?s:[s]}o(zT,"castArray");function KT(s){return si(s,S)}o(KT,"clone");function jT(s,f){return f=typeof f=="function"?f:t,si(s,S,f)}o(jT,"cloneWith");function GT(s){return si(s,v|S)}o(GT,"cloneDeep");function VT(s,f){return f=typeof f=="function"?f:t,si(s,v|S,f)}o(VT,"cloneDeepWith");function WT(s,f){return f==null||j2(s,f,Ar(f))}o(WT,"conformsTo");function Ii(s,f){return s===f||s!==s&&f!==f}o(Ii,"eq");var JT=nh(Tp),YT=nh(function(s,f){return s>=f}),ya=X2(function(){return arguments}())?X2:function(s){return fr(s)&&Vt.call(s,"callee")&&!B2.call(s,"callee")},vt=xe.isArray,XT=v2?In(v2):oS;function mn(s){return s!=null&&hh(s.length)&&!Bo(s)}o(mn,"isArrayLike");function mr(s){return fr(s)&&mn(s)}o(mr,"isArrayLikeObject");function ZT(s){return s===!0||s===!1||fr(s)&&nn(s)==Q}o(ZT,"isBoolean");var ws=hA||hm,QT=y2?In(y2):sS;function eC(s){return fr(s)&&s.nodeType===1&&!eu(s)}o(eC,"isElement");function tC(s){if(s==null)return!0;if(mn(s)&&(vt(s)||typeof s=="string"||typeof s.splice=="function"||ws(s)||If(s)||ya(s)))return!s.length;var f=jr(s);if(f==ae||f==G)return!s.size;if(Zc(s))return!Ip(s).length;for(var d in s)if(Vt.call(s,d))return!1;return!0}o(tC,"isEmpty");function rC(s,f){return Jc(s,f)}o(rC,"isEqual");function nC(s,f,d){d=typeof d=="function"?d:t;var M=d?d(s,f):t;return M===t?Jc(s,f,t,d):!!M}o(nC,"isEqualWith");function rm(s){if(!fr(s))return!1;var f=nn(s);return f==$||f==F||typeof s.message=="string"&&typeof s.name=="string"&&!eu(s)}o(rm,"isError");function iC(s){return typeof s=="number"&&$2(s)}o(iC,"isFinite");function Bo(s){if(!ar(s))return!1;var f=nn(s);return f==ee||f==ne||f==D||f==ce}o(Bo,"isFunction");function oy(s){return typeof s=="number"&&s==wt(s)}o(oy,"isInteger");function hh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=_}o(hh,"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):fS;function oC(s,f){return s===f||kp(s,f,Gp(f))}o(oC,"isMatch");function sC(s,f,d){return d=typeof d=="function"?d:t,kp(s,f,Gp(f),d)}o(sC,"isMatchWith");function aC(s){return ay(s)&&s!=+s}o(aC,"isNaN");function fC(s){if(jS(s))throw new bt(n);return Z2(s)}o(fC,"isNative");function cC(s){return s===null}o(cC,"isNull");function uC(s){return s==null}o(uC,"isNil");function ay(s){return typeof s=="number"||fr(s)&&nn(s)==Ae}o(ay,"isNumber");function eu(s){if(!fr(s)||nn(s)!=re)return!1;var f=$l(s);if(f===null)return!0;var d=Vt.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&Pl.call(d)==sA}o(eu,"isPlainObject");var nm=w2?In(w2):cS;function lC(s){return oy(s)&&s>=-_&&s<=_}o(lC,"isSafeInteger");var fy=_2?In(_2):uS;function dh(s){return typeof s=="string"||!vt(s)&&fr(s)&&nn(s)==pe}o(dh,"isString");function On(s){return typeof s=="symbol"||fr(s)&&nn(s)==Ce}o(On,"isSymbol");var If=E2?In(E2):lS;function hC(s){return s===t}o(hC,"isUndefined");function dC(s){return fr(s)&&jr(s)==Re}o(dC,"isWeakMap");function pC(s){return fr(s)&&nn(s)==Ve}o(pC,"isWeakSet");var mC=nh(Dp),bC=nh(function(s,f){return s<=f});function cy(s){if(!s)return[];if(mn(s))return dh(s)?Ci(s):pn(s);if(qc&&s[qc])return W7(s[qc]());var f=jr(s),d=f==ae?vp:f==G?Ol:Df;return d(s)}o(cy,"toArray");function Uo(s){if(!s)return s===0?s:0;if(s=ci(s),s===m||s===-m){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 uy(s){return s?ma(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)?D7(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 gC(s){return s?ma(wt(s),-_,_):s===0?s:0}o(gC,"toSafeInteger");function Kt(s){return s==null?"":Dn(s)}o(Kt,"toString");var vC=Tf(function(s,f){if(Zc(f)||mn(f)){to(f,Ar(f),s);return}for(var d in f)Vt.call(f,d)&&Gc(s,d,f[d])}),hy=Tf(function(s,f){to(f,bn(f),s)}),ph=Tf(function(s,f,d,M){to(f,bn(f),s,M)}),yC=Tf(function(s,f,d,M){to(f,Ar(f),s,M)}),xC=Po(Ap);function wC(s,f){var d=Mf(s);return f==null?d:K2(d,f)}o(wC,"create");var _C=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 z=f[d],te=bn(z),fe=-1,be=te.length;++fe<be;){var Me=te[fe],Te=s[Me];(Te===t||Ii(Te,Ef[Me])&&!Vt.call(s,Me))&&(s[Me]=z[Me])}return s}),EC=St(function(s){return s.push(t,kv),kn(dy,t,s)});function AC(s,f){return S2(s,Ye(f,3),eo)}o(AC,"findKey");function SC(s,f){return S2(s,Ye(f,3),Mp)}o(SC,"findLastKey");function MC(s,f){return s==null?s:Sp(s,Ye(f,3),bn)}o(MC,"forIn");function TC(s,f){return s==null?s:J2(s,Ye(f,3),bn)}o(TC,"forInRight");function CC(s,f){return s&&eo(s,Ye(f,3))}o(CC,"forOwn");function kC(s,f){return s&&Mp(s,Ye(f,3))}o(kC,"forOwnRight");function IC(s){return s==null?[]:Jl(s,Ar(s))}o(IC,"functions");function DC(s){return s==null?[]:Jl(s,bn(s))}o(DC,"functionsIn");function im(s,f,d){var M=s==null?t:ba(s,f);return M===t?d:M}o(im,"get");function OC(s,f){return s!=null&&Ov(s,f,tS)}o(OC,"has");function om(s,f){return s!=null&&Ov(s,f,rS)}o(om,"hasIn");var RC=Av(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=Ll.call(f)),s[f]=d},am(gn)),NC=Av(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=Ll.call(f)),Vt.call(s,f)?s[f].push(d):s[f]=[d]},Ye),PC=St(Wc);function Ar(s){return mn(s)?H2(s):Ip(s)}o(Ar,"keys");function bn(s){return mn(s)?H2(s,!0):hS(s)}o(bn,"keysIn");function LC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,B,z){Ro(d,f(M,B,z),M)}),d}o(LC,"mapKeys");function BC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,B,z){Ro(d,B,f(M,B,z))}),d}o(BC,"mapValues");var UC=Tf(function(s,f,d){Yl(s,f,d)}),dy=Tf(function(s,f,d,M){Yl(s,f,d,M)}),$C=Po(function(s,f){var d={};if(s==null)return d;var M=!1;f=sr(f,function(z){return z=ys(z,s),M||(M=z.length>1),z}),to(s,Kp(s),d),M&&(d=si(d,v|y|S,RS));for(var B=f.length;B--;)Lp(d,f[B]);return d});function FC(s,f){return py(s,lh(Ye(f)))}o(FC,"omitBy");var qC=Po(function(s,f){return s==null?{}:pS(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,B){return f(M,B[0])})}o(py,"pickBy");function HC(s,f,d){f=ys(f,s);var M=-1,B=f.length;for(B||(B=1,s=t);++M<B;){var z=s==null?t:s[ro(f[M])];z===t&&(M=B,z=d),s=Bo(z)?z.call(s):z}return s}o(HC,"result");function zC(s,f,d){return s==null?s:Yc(s,f,d)}o(zC,"set");function KC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:Yc(s,f,d,M)}o(KC,"setWith");var my=Tv(Ar),by=Tv(bn);function jC(s,f,d){var M=vt(s),B=M||ws(s)||If(s);if(f=Ye(f,4),d==null){var z=s&&s.constructor;B?d=M?new z:[]:ar(s)?d=Bo(z)?Mf($l(s)):{}:d={}}return(B?ni:eo)(s,function(te,fe,be){return f(d,te,fe,be)}),d}o(jC,"transform");function GC(s,f){return s==null?!0:Lp(s,f)}o(GC,"unset");function VC(s,f,d){return s==null?s:uv(s,f,$p(d))}o(VC,"update");function WC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:uv(s,f,$p(d),M)}o(WC,"updateWith");function Df(s){return s==null?[]:gp(s,Ar(s))}o(Df,"values");function JC(s){return s==null?[]:gp(s,bn(s))}o(JC,"valuesIn");function YC(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),ma(ci(s),f,d)}o(YC,"clamp");function XC(s,f,d){return f=Uo(f),d===t?(d=f,f=0):d=Uo(d),s=ci(s),nS(s,f,d)}o(XC,"inRange");function ZC(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=F2();return Kr(s+B*(f-s+I7("1e-"+((B+"").length-1))),f)}return Rp(s,f)}o(ZC,"random");var QC=Cf(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,z7).replace(x7,"")}o(vy,"deburr");function ek(s,f,d){s=Kt(s),f=Dn(f);var M=s.length;d=d===t?M:ma(wt(d),0,M);var B=d;return d-=f.length,d>=0&&s.slice(d,B)==f}o(ek,"endsWith");function tk(s){return s=Kt(s),s&&it.test(s)?s.replace(Tn,K7):s}o(tk,"escape");function rk(s){return s=Kt(s),s&&ft.test(s)?s.replace(cn,"\\$&"):s}o(rk,"escapeRegExp");var nk=Cf(function(s,f,d){return s+(d?"-":"")+f.toLowerCase()}),ik=Cf(function(s,f,d){return s+(d?" ":"")+f.toLowerCase()}),ok=wv("toLowerCase");function sk(s,f,d){s=Kt(s),f=wt(f);var M=f?_f(s):0;if(!f||M>=f)return s;var B=(f-M)/2;return rh(zl(B),d)+s+rh(Hl(B),d)}o(sk,"pad");function ak(s,f,d){s=Kt(s),f=wt(f);var M=f?_f(s):0;return f&&M<f?s+rh(f-M,d):s}o(ak,"padEnd");function fk(s,f,d){s=Kt(s),f=wt(f);var M=f?_f(s):0;return f&&M<f?rh(f-M,d)+s:s}o(fk,"padStart");function ck(s,f,d){return d||f==null?f=0:f&&(f=+f),bA(Kt(s).replace(Xe,""),f||0)}o(ck,"parseInt");function uk(s,f,d){return(d?on(s,f,d):f===t)?f=1:f=wt(f),Np(Kt(s),f)}o(uk,"repeat");function lk(){var s=arguments,f=Kt(s[0]);return s.length<3?f:f.replace(s[1],s[2])}o(lk,"replace");var hk=Cf(function(s,f,d){return s+(d?"_":"")+f.toLowerCase()});function dk(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&&wf(s))?xs(Ci(s),0,d):s.split(f,d)):[]}o(dk,"split");var pk=Cf(function(s,f,d){return s+(d?" ":"")+sm(f)});function mk(s,f,d){return s=Kt(s),d=d==null?0:ma(wt(d),0,s.length),f=Dn(f),s.slice(d,d+f.length)==f}o(mk,"startsWith");function bk(s,f,d){var M=H.templateSettings;d&&on(s,f,d)&&(f=t),s=Kt(s),f=ph({},f,M,Cv);var B=ph({},f.imports,M.imports,Cv),z=Ar(B),te=gp(B,z),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["+ ++S7+"]")+`
|
|
4
|
-
`;s.replace(Le,function(Qe,Ct,Nt,Rn,sn,Nn){return Nt||(Nt=Rn),Ie+=s.slice(Me,Nn).replace(dn,
|
|
3
|
+
`)}o(uS,"insertWrapDetails");function lS(s){return vt(s)||xa(s)||!!(N2&&s&&s[N2])}o(lS,"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 Kp(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(Kp,"isKey");function hS(s){var f=typeof s;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?s!=="__proto__":s===null}o(hS,"isKeyable");function jp(s){var f=ih(s),d=H[f];if(typeof d!="function"||!(f in Dt.prototype))return!1;if(s===d)return!0;var M=qp(d);return!!M&&s===M[0]}o(jp,"isLaziable");function dS(s){return!!I2&&I2 in s}o(dS,"isMasked");var pS=Nl?Bo:fm;function Zc(s){var f=s&&s.constructor,d=typeof f=="function"&&f.prototype||Af;return s===d}o(Zc,"isPrototype");function Iv(s){return s===s&&!ar(s)}o(Iv,"isStrictComparable");function Dv(s,f){return function(d){return d==null?!1:d[s]===f&&(f!==t||s in Zt(d))}}o(Dv,"matchesStrictComparable");function mS(s){var f=uh(s,function(M){return d.size===u&&d.clear(),M}),d=f.cache;return f}o(mS,"memoizeCapped");function bS(s,f){var d=s[1],M=f[1],B=d|M,z=B<(D|P|oe),te=M==oe&&d==L||M==oe&&d==K&&s[7].length<=f[8]||M==(oe|K)&&f[7].length<=f[8]&&d==L;if(!(z||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?dv(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?pv(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(bS,"mergeData");function gS(s){var f=[];if(s!=null)for(var d in Zt(s))f.push(d);return f}o(gS,"nativeKeysIn");function vS(s){return Ll.call(s)}o(vS,"objectToString");function Ov(s,f,d){return f=wr(f===t?s.length-1:f,0),function(){for(var M=arguments,B=-1,z=wr(M.length-f,0),te=xe(z);++B<z;)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(Ov,"overRest");function Rv(s,f){return f.length<2?s:ga(s,ai(f,0,-1))}o(Rv,"parent");function yS(s,f){for(var d=s.length,M=Kr(f.length,d),B=pn(s);M--;){var z=f[M];s[M]=Lo(z,d)?B[z]:t}return s}o(yS,"reorder");function Gp(s,f){if(!(f==="constructor"&&typeof s[f]=="function")&&f!="__proto__")return s[f]}o(Gp,"safeGet");var Nv=Lv(nv),Qc=N7||function(s,f){return Er.setTimeout(s,f)},Vp=Lv(HA);function Pv(s,f,d){var M=f+"";return Vp(s,uS(M,xS(aS(M),d)))}o(Pv,"setWrapToString");function Lv(s){var f=0,d=0;return function(){var M=U7(),B=h-(M-d);if(d=M,B>0){if(++f>=T)return arguments[0]}else f=0;return s.apply(t,arguments)}}o(Lv,"shortOut");function sh(s,f){var d=-1,M=s.length,B=M-1;for(f=f===t?M:f;++d<f;){var z=kp(d,B),te=s[z];s[z]=s[d],s[d]=te}return s.length=f,s}o(sh,"shuffleSelf");var Bv=mS(function(s){var f=[];return s.charCodeAt(0)===46&&f.push(""),s.replace(at,function(d,M,B,z){f.push(B?z.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 Pl.call(s)}catch{}try{return s+""}catch{}}return""}o(ya,"toSource");function xS(s,f){return ni(w,function(d){var M="_."+d[0];f&d[1]&&!Il(s,M)&&s.push(M)}),s.sort()}o(xS,"updateWrapDetails");function Uv(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(Uv,"wrapperClone");function wS(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,z=0,te=xe(Hl(M/f));B<M;)te[z++]=ai(s,B,B+=f);return te}o(wS,"chunk");function _S(s){for(var f=-1,d=s==null?0:s.length,M=0,B=[];++f<d;){var z=s[f];z&&(B[M++]=z)}return B}o(_S,"compact");function ES(){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(ES,"concat");var AS=St(function(s,f){return mr(s)?Vc(s,Pr(f,1,mr,!0)):[]}),SS=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Vc(s,Pr(f,1,mr,!0),Ye(d,2)):[]}),MS=St(function(s,f){var d=fi(f);return mr(d)&&(d=t),mr(s)?Vc(s,Pr(f,1,mr,!0),t,d):[]});function TS(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(TS,"drop");function CS(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(CS,"dropRight");function kS(s,f){return s&&s.length?Zl(s,Ye(f,3),!0,!0):[]}o(kS,"dropRightWhile");function IS(s,f){return s&&s.length?Zl(s,Ye(f,3),!0):[]}o(IS,"dropWhile");function DS(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),EA(s,f,d,M)):[]}o(DS,"fill");function $v(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)),Dl(s,Ye(f,3),B)}o($v,"findIndex");function Fv(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)),Dl(s,Ye(f,3),B,!0)}o(Fv,"findLastIndex");function qv(s){var f=s==null?0:s.length;return f?Pr(s,1):[]}o(qv,"flatten");function OS(s){var f=s==null?0:s.length;return f?Pr(s,p):[]}o(OS,"flattenDeep");function RS(s,f){var d=s==null?0:s.length;return d?(f=f===t?1:wt(f),Pr(s,f)):[]}o(RS,"flattenDepth");function NS(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(NS,"fromPairs");function Hv(s){return s&&s.length?s[0]:t}o(Hv,"head");function PS(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)),wf(s,f,B)}o(PS,"indexOf");function LS(s){var f=s==null?0:s.length;return f?ai(s,0,-1):[]}o(LS,"initial");var BS=St(function(s){var f=sr(s,Np);return f.length&&f[0]===s[0]?Ap(f):[]}),US=St(function(s){var f=fi(s),d=sr(s,Np);return f===fi(d)?f=t:d.pop(),d.length&&d[0]===s[0]?Ap(d,Ye(f,2)):[]}),$S=St(function(s){var f=fi(s),d=sr(s,Np);return f=typeof f=="function"?f:t,f&&d.pop(),d.length&&d[0]===s[0]?Ap(d,t,f):[]});function FS(s,f){return s==null?"":L7.call(s,f)}o(FS,"join");function fi(s){var f=s==null?0:s.length;return f?s[f-1]:t}o(fi,"last");function qS(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?x7(s,f,B):Dl(s,_2,B,!0)}o(qS,"lastIndexOf");function HS(s,f){return s&&s.length?Q2(s,wt(f)):t}o(HS,"nth");var zS=St(zv);function zv(s,f){return s&&s.length&&f&&f.length?Cp(s,f):s}o(zv,"pullAll");function KS(s,f,d){return s&&s.length&&f&&f.length?Cp(s,f,Ye(d,2)):s}o(KS,"pullAllBy");function jS(s,f,d){return s&&s.length&&f&&f.length?Cp(s,f,t,d):s}o(jS,"pullAllWith");var GS=Po(function(s,f){var d=s==null?0:s.length,M=xp(s,f);return rv(s,sr(f,function(B){return Lo(B,d)?+B:B}).sort(hv)),M});function VS(s,f){var d=[];if(!(s&&s.length))return d;var M=-1,B=[],z=s.length;for(f=Ye(f,3);++M<z;){var te=s[M];f(te,M,s)&&(d.push(te),B.push(M))}return rv(s,B),d}o(VS,"remove");function Wp(s){return s==null?s:F7.call(s)}o(Wp,"reverse");function WS(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(WS,"slice");function JS(s,f){return Xl(s,f)}o(JS,"sortedIndex");function YS(s,f,d){return Dp(s,f,Ye(d,2))}o(YS,"sortedIndexBy");function XS(s,f){var d=s==null?0:s.length;if(d){var M=Xl(s,f);if(M<d&&Ii(s[M],f))return M}return-1}o(XS,"sortedIndexOf");function ZS(s,f){return Xl(s,f,!0)}o(ZS,"sortedLastIndex");function QS(s,f,d){return Dp(s,f,Ye(d,2),!0)}o(QS,"sortedLastIndexBy");function eM(s,f){var d=s==null?0:s.length;if(d){var M=Xl(s,f,!0)-1;if(Ii(s[M],f))return M}return-1}o(eM,"sortedLastIndexOf");function tM(s){return s&&s.length?iv(s):[]}o(tM,"sortedUniq");function rM(s,f){return s&&s.length?iv(s,Ye(f,2)):[]}o(rM,"sortedUniqBy");function nM(s){var f=s==null?0:s.length;return f?ai(s,1,f):[]}o(nM,"tail");function iM(s,f,d){return s&&s.length?(f=d||f===t?1:wt(f),ai(s,0,f<0?0:f)):[]}o(iM,"take");function oM(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(oM,"takeRight");function sM(s,f){return s&&s.length?Zl(s,Ye(f,3),!1,!0):[]}o(sM,"takeRightWhile");function aM(s,f){return s&&s.length?Zl(s,Ye(f,3)):[]}o(aM,"takeWhile");var fM=St(function(s){return ys(Pr(s,1,mr,!0))}),cM=St(function(s){var f=fi(s);return mr(f)&&(f=t),ys(Pr(s,1,mr,!0),Ye(f,2))}),uM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,ys(Pr(s,1,mr,!0),t,f)});function lM(s){return s&&s.length?ys(s):[]}o(lM,"uniq");function hM(s,f){return s&&s.length?ys(s,Ye(f,2)):[]}o(hM,"uniqBy");function dM(s,f){return f=typeof f=="function"?f:t,s&&s.length?ys(s,t,f):[]}o(dM,"uniqWith");function Jp(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}),hp(f,function(d){return sr(s,cp(d))})}o(Jp,"unzip");function Kv(s,f){if(!(s&&s.length))return[];var d=Jp(s);return f==null?d:sr(d,function(M){return kn(f,t,M)})}o(Kv,"unzipWith");var pM=St(function(s,f){return mr(s)?Vc(s,f):[]}),mM=St(function(s){return Rp(ds(s,mr))}),bM=St(function(s){var f=fi(s);return mr(f)&&(f=t),Rp(ds(s,mr),Ye(f,2))}),gM=St(function(s){var f=fi(s);return f=typeof f=="function"?f:t,Rp(ds(s,mr),t,f)}),vM=St(Jp);function yM(s,f){return fv(s||[],f||[],Gc)}o(yM,"zipObject");function xM(s,f){return fv(s||[],f||[],Yc)}o(xM,"zipObjectDeep");var wM=St(function(s){var f=s.length,d=f>1?s[f-1]:t;return d=typeof d=="function"?(s.pop(),d):t,Kv(s,d)});function jv(s){var f=H(s);return f.__chain__=!0,f}o(jv,"chain");function _M(s,f){return f(s),s}o(_M,"tap");function ah(s,f){return f(s)}o(ah,"thru");var EM=Po(function(s){var f=s.length,d=f?s[0]:0,M=this.__wrapped__,B=o(function(z){return xp(z,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:ah,args:[B],thisArg:t}),new oi(M,this.__chain__).thru(function(z){return f&&!z.length&&z.push(t),z}))});function AM(){return jv(this)}o(AM,"wrapperChain");function SM(){return new oi(this.value(),this.__chain__)}o(SM,"wrapperCommit");function MM(){this.__values__===t&&(this.__values__=oy(this.value()));var s=this.__index__>=this.__values__.length,f=s?t:this.__values__[this.__index__++];return{done:s,value:f}}o(MM,"wrapperNext");function TM(){return this}o(TM,"wrapperToIterator");function CM(s){for(var f,d=this;d instanceof Gl;){var M=Uv(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(CM,"wrapperPlant");function kM(){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:ah,args:[Wp],thisArg:t}),new oi(f,this.__chain__)}return this.thru(Wp)}o(kM,"wrapperReverse");function IM(){return av(this.__wrapped__,this.__actions__)}o(IM,"wrapperValue");var DM=Ql(function(s,f,d){Vt.call(s,d)?++s[d]:Ro(s,d,1)});function OM(s,f,d){var M=vt(s)?x2:_A;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(OM,"every");function RM(s,f){var d=vt(s)?ds:K2;return d(s,Ye(f,3))}o(RM,"filter");var NM=vv($v),PM=vv(Fv);function LM(s,f){return Pr(fh(s,f),1)}o(LM,"flatMap");function BM(s,f){return Pr(fh(s,f),p)}o(BM,"flatMapDeep");function UM(s,f,d){return d=d===t?1:wt(d),Pr(fh(s,f),d)}o(UM,"flatMapDepth");function Gv(s,f){var d=vt(s)?ni:vs;return d(s,Ye(f,3))}o(Gv,"forEach");function Vv(s,f){var d=vt(s)?n7:z2;return d(s,Ye(f,3))}o(Vv,"forEachRight");var $M=Ql(function(s,f,d){Vt.call(s,d)?s[d].push(f):Ro(s,d,[f])});function FM(s,f,d,M){s=mn(s)?s:Of(s),d=d&&!M?wt(d):0;var B=s.length;return d<0&&(d=wr(B+d,0)),dh(s)?d<=B&&s.indexOf(f,d)>-1:!!B&&wf(s,f,d)>-1}o(FM,"includes");var qM=St(function(s,f,d){var M=-1,B=typeof f=="function",z=mn(s)?xe(s.length):[];return vs(s,function(te){z[++M]=B?kn(f,te,d):Wc(te,f,d)}),z}),HM=Ql(function(s,f,d){Ro(s,d,f)});function fh(s,f){var d=vt(s)?sr:Y2;return d(s,Ye(f,3))}o(fh,"map");function zM(s,f,d,M){return s==null?[]:(vt(f)||(f=f==null?[]:[f]),d=M?t:d,vt(d)||(d=d==null?[]:[d]),ev(s,f,d))}o(zM,"orderBy");var KM=Ql(function(s,f,d){s[d?0:1].push(f)},function(){return[[],[]]});function jM(s,f,d){var M=vt(s)?ap:A2,B=arguments.length<3;return M(s,Ye(f,4),d,B,vs)}o(jM,"reduce");function GM(s,f,d){var M=vt(s)?i7:A2,B=arguments.length<3;return M(s,Ye(f,4),d,B,z2)}o(GM,"reduceRight");function VM(s,f){var d=vt(s)?ds:K2;return d(s,lh(Ye(f,3)))}o(VM,"reject");function WM(s){var f=vt(s)?$2:FA;return f(s)}o(WM,"sample");function JM(s,f,d){(d?on(s,f,d):f===t)?f=1:f=wt(f);var M=vt(s)?gA:qA;return M(s,f)}o(JM,"sampleSize");function YM(s){var f=vt(s)?vA:zA;return f(s)}o(YM,"shuffle");function XM(s){if(s==null)return 0;if(mn(s))return dh(s)?Ef(s):s.length;var f=jr(s);return f==ae||f==G?s.size:Mp(s).length}o(XM,"size");function ZM(s,f,d){var M=vt(s)?fp:KA;return d&&on(s,f,d)&&(f=t),M(s,Ye(f,3))}o(ZM,"some");var QM=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]]),ev(s,Pr(f,1),[])}),ch=R7||function(){return Er.Date.now()};function eT(s,f){if(typeof f!="function")throw new ii(i);return s=wt(s),function(){if(--s<1)return f.apply(this,arguments)}}o(eT,"after");function Wv(s,f,d){return f=d?t:f,f=s&&f==null?s.length:f,No(s,oe,t,t,t,t,f)}o(Wv,"ary");function Jv(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(Jv,"before");var Yp=St(function(s,f,d){var M=D;if(d.length){var B=ms(d,If(Yp));M|=Q}return No(s,M,f,d,B)}),Yv=St(function(s,f,d){var M=D|P;if(d.length){var B=ms(d,If(Yv));M|=Q}return No(f,M,s,d,B)});function Xv(s,f,d){f=d?t:f;var M=No(s,L,t,t,t,t,t,f);return M.placeholder=Xv.placeholder,M}o(Xv,"curry");function Zv(s,f,d){f=d?t:f;var M=No(s,W,t,t,t,t,t,f);return M.placeholder=Zv.placeholder,M}o(Zv,"curryRight");function Qv(s,f,d){var M,B,z,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,z=Ie?wr(ci(d.maxWait)||0,f):z,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=Qc(Ct,f),Te?ze(br):te}o(Ze,"leadingEdge");function _t(br){var Di=br-be,$o=br-Me,vy=f-Di;return Ie?Kr(vy,z-$o):vy}o(_t,"remainingWait");function Qe(br){var Di=br-be,$o=br-Me;return be===t||Di>=f||Di<0||Ie&&$o>=z}o(Qe,"shouldInvoke");function Ct(){var br=ch();if(Qe(br))return Nt(br);fe=Qc(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&&cv(fe),Me=0,M=be=B=fe=t}o(Rn,"cancel");function sn(){return fe===t?te:Nt(ch())}o(sn,"flush");function Nn(){var br=ch(),Di=Qe(br);if(M=arguments,B=this,be=br,Di){if(fe===t)return Ze(be);if(Ie)return cv(fe),fe=Qc(Ct,f),ze(be)}return fe===t&&(fe=Qc(Ct,f)),te}return o(Nn,"debounced"),Nn.cancel=Rn,Nn.flush=sn,Nn}o(Qv,"debounce");var tT=St(function(s,f){return H2(s,1,f)}),rT=St(function(s,f,d){return H2(s,ci(f)||0,d)});function nT(s){return No(s,q)}o(nT,"flip");function uh(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],z=d.cache;if(z.has(B))return z.get(B);var te=s.apply(this,M);return d.cache=z.set(B,te)||z,te},"memoized");return d.cache=new(uh.Cache||Oo),d}o(uh,"memoize"),uh.Cache=Oo;function lh(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(lh,"negate");function iT(s){return Jv(2,s)}o(iT,"once");var oT=jA(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,z=Kr(M.length,d);++B<z;)M[B]=f[B].call(this,M[B]);return kn(s,this,M)})}),Xp=St(function(s,f){var d=ms(f,If(Xp));return No(s,Q,t,f,d)}),ey=St(function(s,f){var d=ms(f,If(ey));return No(s,Y,t,f,d)}),sT=Po(function(s,f){return No(s,K,t,t,t,f)});function aT(s,f){if(typeof s!="function")throw new ii(i);return f=f===t?f:wt(f),St(s,f)}o(aT,"rest");function fT(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(fT,"spread");function cT(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),Qv(s,f,{leading:M,maxWait:f,trailing:B})}o(cT,"throttle");function uT(s){return Wv(s,1)}o(uT,"unary");function lT(s,f){return Xp(Pp(f),s)}o(lT,"wrap");function hT(){if(!arguments.length)return[];var s=arguments[0];return vt(s)?s:[s]}o(hT,"castArray");function dT(s){return si(s,S)}o(dT,"clone");function pT(s,f){return f=typeof f=="function"?f:t,si(s,S,f)}o(pT,"cloneWith");function mT(s){return si(s,v|S)}o(mT,"cloneDeep");function bT(s,f){return f=typeof f=="function"?f:t,si(s,v|S,f)}o(bT,"cloneDeepWith");function gT(s,f){return f==null||q2(s,f,Ar(f))}o(gT,"conformsTo");function Ii(s,f){return s===f||s!==s&&f!==f}o(Ii,"eq");var vT=nh(Ep),yT=nh(function(s,f){return s>=f}),xa=V2(function(){return arguments}())?V2:function(s){return fr(s)&&Vt.call(s,"callee")&&!R2.call(s,"callee")},vt=xe.isArray,xT=p2?In(p2):CA;function mn(s){return s!=null&&hh(s.length)&&!Bo(s)}o(mn,"isArrayLike");function mr(s){return fr(s)&&mn(s)}o(mr,"isArrayLikeObject");function wT(s){return s===!0||s===!1||fr(s)&&nn(s)==Z}o(wT,"isBoolean");var _s=P7||fm,_T=m2?In(m2):kA;function ET(s){return fr(s)&&s.nodeType===1&&!eu(s)}o(ET,"isElement");function AT(s){if(s==null)return!0;if(mn(s)&&(vt(s)||typeof s=="string"||typeof s.splice=="function"||_s(s)||Df(s)||xa(s)))return!s.length;var f=jr(s);if(f==ae||f==G)return!s.size;if(Zc(s))return!Mp(s).length;for(var d in s)if(Vt.call(s,d))return!1;return!0}o(AT,"isEmpty");function ST(s,f){return Jc(s,f)}o(ST,"isEqual");function MT(s,f,d){d=typeof d=="function"?d:t;var M=d?d(s,f):t;return M===t?Jc(s,f,t,d):!!M}o(MT,"isEqualWith");function Zp(s){if(!fr(s))return!1;var f=nn(s);return f==$||f==F||typeof s.message=="string"&&typeof s.name=="string"&&!eu(s)}o(Zp,"isError");function TT(s){return typeof s=="number"&&P2(s)}o(TT,"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 ty(s){return typeof s=="number"&&s==wt(s)}o(ty,"isInteger");function hh(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=_}o(hh,"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 ry=b2?In(b2):DA;function CT(s,f){return s===f||Sp(s,f,Hp(f))}o(CT,"isMatch");function kT(s,f,d){return d=typeof d=="function"?d:t,Sp(s,f,Hp(f),d)}o(kT,"isMatchWith");function IT(s){return ny(s)&&s!=+s}o(IT,"isNaN");function DT(s){if(pS(s))throw new bt(n);return W2(s)}o(DT,"isNative");function OT(s){return s===null}o(OT,"isNull");function RT(s){return s==null}o(RT,"isNil");function ny(s){return typeof s=="number"||fr(s)&&nn(s)==Ae}o(ny,"isNumber");function eu(s){if(!fr(s)||nn(s)!=re)return!1;var f=$l(s);if(f===null)return!0;var d=Vt.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&Pl.call(d)==k7}o(eu,"isPlainObject");var Qp=g2?In(g2):OA;function NT(s){return ty(s)&&s>=-_&&s<=_}o(NT,"isSafeInteger");var iy=v2?In(v2):RA;function dh(s){return typeof s=="string"||!vt(s)&&fr(s)&&nn(s)==pe}o(dh,"isString");function On(s){return typeof s=="symbol"||fr(s)&&nn(s)==Ce}o(On,"isSymbol");var Df=y2?In(y2):NA;function PT(s){return s===t}o(PT,"isUndefined");function LT(s){return fr(s)&&jr(s)==Re}o(LT,"isWeakMap");function BT(s){return fr(s)&&nn(s)==Ve}o(BT,"isWeakSet");var UT=nh(Tp),$T=nh(function(s,f){return s<=f});function oy(s){if(!s)return[];if(mn(s))return dh(s)?Ci(s):pn(s);if(qc&&s[qc])return g7(s[qc]());var f=jr(s),d=f==ae?pp:f==G?Ol:Of;return d(s)}o(oy,"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 sy(s){return s?ba(wt(s),0,g):0}o(sy,"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=S2(s);var d=Ft.test(s);return d||un.test(s)?e7(s.slice(2),d?2:8):Cn.test(s)?E:+s}o(ci,"toNumber");function ay(s){return to(s,bn(s))}o(ay,"toPlainObject");function FT(s){return s?ba(wt(s),-_,_):s===0?s:0}o(FT,"toSafeInteger");function Kt(s){return s==null?"":Dn(s)}o(Kt,"toString");var qT=Cf(function(s,f){if(Zc(f)||mn(f)){to(f,Ar(f),s);return}for(var d in f)Vt.call(f,d)&&Gc(s,d,f[d])}),fy=Cf(function(s,f){to(f,bn(f),s)}),ph=Cf(function(s,f,d,M){to(f,bn(f),s,M)}),HT=Cf(function(s,f,d,M){to(f,Ar(f),s,M)}),zT=Po(xp);function KT(s,f){var d=Tf(s);return f==null?d:F2(d,f)}o(KT,"create");var jT=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 z=f[d],te=bn(z),fe=-1,be=te.length;++fe<be;){var Me=te[fe],Te=s[Me];(Te===t||Ii(Te,Af[Me])&&!Vt.call(s,Me))&&(s[Me]=z[Me])}return s}),GT=St(function(s){return s.push(t,Sv),kn(cy,t,s)});function VT(s,f){return w2(s,Ye(f,3),eo)}o(VT,"findKey");function WT(s,f){return w2(s,Ye(f,3),_p)}o(WT,"findLastKey");function JT(s,f){return s==null?s:wp(s,Ye(f,3),bn)}o(JT,"forIn");function YT(s,f){return s==null?s:j2(s,Ye(f,3),bn)}o(YT,"forInRight");function XT(s,f){return s&&eo(s,Ye(f,3))}o(XT,"forOwn");function ZT(s,f){return s&&_p(s,Ye(f,3))}o(ZT,"forOwnRight");function QT(s){return s==null?[]:Jl(s,Ar(s))}o(QT,"functions");function eC(s){return s==null?[]:Jl(s,bn(s))}o(eC,"functionsIn");function em(s,f,d){var M=s==null?t:ga(s,f);return M===t?d:M}o(em,"get");function tC(s,f){return s!=null&&Cv(s,f,AA)}o(tC,"has");function tm(s,f){return s!=null&&Cv(s,f,SA)}o(tm,"hasIn");var rC=xv(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=Ll.call(f)),s[f]=d},nm(gn)),nC=xv(function(s,f,d){f!=null&&typeof f.toString!="function"&&(f=Ll.call(f)),Vt.call(s,f)?s[f].push(d):s[f]=[d]},Ye),iC=St(Wc);function Ar(s){return mn(s)?U2(s):Mp(s)}o(Ar,"keys");function bn(s){return mn(s)?U2(s,!0):PA(s)}o(bn,"keysIn");function oC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,B,z){Ro(d,f(M,B,z),M)}),d}o(oC,"mapKeys");function sC(s,f){var d={};return f=Ye(f,3),eo(s,function(M,B,z){Ro(d,B,f(M,B,z))}),d}o(sC,"mapValues");var aC=Cf(function(s,f,d){Yl(s,f,d)}),cy=Cf(function(s,f,d,M){Yl(s,f,d,M)}),fC=Po(function(s,f){var d={};if(s==null)return d;var M=!1;f=sr(f,function(z){return z=xs(z,s),M||(M=z.length>1),z}),to(s,Fp(s),d),M&&(d=si(d,v|x|S,rS));for(var B=f.length;B--;)Op(d,f[B]);return d});function cC(s,f){return uy(s,lh(Ye(f)))}o(cC,"omitBy");var uC=Po(function(s,f){return s==null?{}:BA(s,f)});function uy(s,f){if(s==null)return{};var d=sr(Fp(s),function(M){return[M]});return f=Ye(f),tv(s,d,function(M,B){return f(M,B[0])})}o(uy,"pickBy");function lC(s,f,d){f=xs(f,s);var M=-1,B=f.length;for(B||(B=1,s=t);++M<B;){var z=s==null?t:s[ro(f[M])];z===t&&(M=B,z=d),s=Bo(z)?z.call(s):z}return s}o(lC,"result");function hC(s,f,d){return s==null?s:Yc(s,f,d)}o(hC,"set");function dC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:Yc(s,f,d,M)}o(dC,"setWith");var ly=Ev(Ar),hy=Ev(bn);function pC(s,f,d){var M=vt(s),B=M||_s(s)||Df(s);if(f=Ye(f,4),d==null){var z=s&&s.constructor;B?d=M?new z:[]:ar(s)?d=Bo(z)?Tf($l(s)):{}:d={}}return(B?ni:eo)(s,function(te,fe,be){return f(d,te,fe,be)}),d}o(pC,"transform");function mC(s,f){return s==null?!0:Op(s,f)}o(mC,"unset");function bC(s,f,d){return s==null?s:sv(s,f,Pp(d))}o(bC,"update");function gC(s,f,d,M){return M=typeof M=="function"?M:t,s==null?s:sv(s,f,Pp(d),M)}o(gC,"updateWith");function Of(s){return s==null?[]:dp(s,Ar(s))}o(Of,"values");function vC(s){return s==null?[]:dp(s,bn(s))}o(vC,"valuesIn");function yC(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(yC,"clamp");function xC(s,f,d){return f=Uo(f),d===t?(d=f,f=0):d=Uo(d),s=ci(s),MA(s,f,d)}o(xC,"inRange");function wC(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=L2();return Kr(s+B*(f-s+Q9("1e-"+((B+"").length-1))),f)}return kp(s,f)}o(wC,"random");var _C=kf(function(s,f,d){return f=f.toLowerCase(),s+(d?dy(f):f)});function dy(s){return rm(Kt(s).toLowerCase())}o(dy,"capitalize");function py(s){return s=Kt(s),s&&s.replace(hn,h7).replace(z9,"")}o(py,"deburr");function EC(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(EC,"endsWith");function AC(s){return s=Kt(s),s&&it.test(s)?s.replace(Tn,d7):s}o(AC,"escape");function SC(s){return s=Kt(s),s&&ft.test(s)?s.replace(cn,"\\$&"):s}o(SC,"escapeRegExp");var MC=kf(function(s,f,d){return s+(d?"-":"")+f.toLowerCase()}),TC=kf(function(s,f,d){return s+(d?" ":"")+f.toLowerCase()}),CC=gv("toLowerCase");function kC(s,f,d){s=Kt(s),f=wt(f);var M=f?Ef(s):0;if(!f||M>=f)return s;var B=(f-M)/2;return rh(zl(B),d)+s+rh(Hl(B),d)}o(kC,"pad");function IC(s,f,d){s=Kt(s),f=wt(f);var M=f?Ef(s):0;return f&&M<f?s+rh(f-M,d):s}o(IC,"padEnd");function DC(s,f,d){s=Kt(s),f=wt(f);var M=f?Ef(s):0;return f&&M<f?rh(f-M,d)+s:s}o(DC,"padStart");function OC(s,f,d){return d||f==null?f=0:f&&(f=+f),$7(Kt(s).replace(Xe,""),f||0)}o(OC,"parseInt");function RC(s,f,d){return(d?on(s,f,d):f===t)?f=1:f=wt(f),Ip(Kt(s),f)}o(RC,"repeat");function NC(){var s=arguments,f=Kt(s[0]);return s.length<3?f:f.replace(s[1],s[2])}o(NC,"replace");var PC=kf(function(s,f,d){return s+(d?"_":"")+f.toLowerCase()});function LC(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&&!Qp(f))&&(f=Dn(f),!f&&_f(s))?ws(Ci(s),0,d):s.split(f,d)):[]}o(LC,"split");var BC=kf(function(s,f,d){return s+(d?" ":"")+rm(f)});function UC(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(UC,"startsWith");function $C(s,f,d){var M=H.templateSettings;d&&on(s,f,d)&&(f=t),s=Kt(s),f=ph({},f,M,Av);var B=ph({},f.imports,M.imports,Av),z=Ar(B),te=dp(B,z),fe,be,Me=0,Te=f.interpolate||Nr,Ie="__p += '",Le=mp((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["+ ++W9+"]")+`
|
|
4
|
+
`;s.replace(Le,function(Qe,Ct,Nt,Rn,sn,Nn){return Nt||(Nt=Rn),Ie+=s.slice(Me,Nn).replace(dn,p7),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=xy(function(){return Ht(z,ze+"return "+Ie).apply(t,te)});if(_t.source=Ie,rm(_t))throw _t;return _t}o(bk,"template");function gk(s){return Kt(s).toLowerCase()}o(gk,"toLower");function vk(s){return Kt(s).toUpperCase()}o(vk,"toUpper");function yk(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),B=Ci(f),z=I2(M,B),te=D2(M,B)+1;return xs(M,z,te).join("")}o(yk,"trim");function xk(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),B=D2(M,Ci(f))+1;return xs(M,0,B).join("")}o(xk,"trimEnd");function wk(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=I2(M,Ci(f));return xs(M,B).join("")}o(wk,"trimStart");function _k(s,f){var d=j,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 z=s.length;if(wf(s)){var te=Ci(s);z=te.length}if(d>=z)return s;var fe=d-_f(M);if(fe<1)return M;var be=te?xs(te,0,fe).join(""):s.slice(0,fe);if(B===t)return be+M;if(te&&(fe+=be.length-fe),nm(B)){if(s.slice(fe).search(B)){var Me,Te=be;for(B.global||(B=yp(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(_k,"truncate");function Ek(s){return s=Kt(s),s&&nt.test(s)?s.replace(Je,Z7):s}o(Ek,"unescape");var Ak=Cf(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?V7(s)?tA(s):U7(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)}}),Sk=Po(function(s,f){return ni(f,function(d){d=ro(d),Ro(s,d,em(s[d],s))}),s});function Mk(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 z=s[B];if(kn(z[0],this,M))return kn(z[1],this,M)}})}o(Mk,"cond");function Tk(s){return ZA(si(s,v))}o(Tk,"conforms");function am(s){return function(){return s}}o(am,"constant");function Ck(s,f){return s==null||s!==s?f:s}o(Ck,"defaultTo");var kk=Ev(),Ik=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 Dk(s){return tv(si(s,v))}o(Dk,"matches");function Ok(s,f){return rv(s,si(f,v))}o(Ok,"matchesProperty");var Rk=St(function(s,f){return function(d){return Wc(d,s,f)}}),Nk=St(function(s,f){return function(d){return Wc(s,d,f)}});function cm(s,f,d){var M=Ar(f),B=Jl(f,M);d==null&&!(ar(f)&&(B.length||!M.length))&&(d=f,f=s,s=this,B=Jl(f,Ar(f)));var z=!(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(z||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,ds([this.value()],arguments))})}),s}o(cm,"mixin");function Pk(){return Er._===this&&(Er._=aA),this}o(Pk,"noConflict");function um(){}o(um,"noop");function Lk(s){return s=wt(s),St(function(f){return nv(f,s)})}o(Lk,"nthArg");var Bk=qp(sr),Uk=qp(A2),$k=qp(hp);function wy(s){return Wp(s)?dp(ro(s)):mS(s)}o(wy,"property");function Fk(s){return function(f){return s==null?t:ba(s,f)}}o(Fk,"propertyOf");var qk=Sv(),Hk=Sv(!0);function lm(){return[]}o(lm,"stubArray");function hm(){return!1}o(hm,"stubFalse");function zk(){return{}}o(zk,"stubObject");function Kk(){return""}o(Kk,"stubString");function jk(){return!0}o(jk,"stubTrue");function Gk(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=bp(M,f);++d<s;)f(d);return B}o(Gk,"times");function Vk(s){return vt(s)?sr(s,ro):On(s)?[s]:pn(qv(Kt(s)))}o(Vk,"toPath");function Wk(s){var f=++oA;return Kt(s)+f}o(Wk,"uniqueId");var Jk=th(function(s,f){return s+f},0),Yk=Hp("ceil"),Xk=th(function(s,f){return s/f},1),Zk=Hp("floor");function Qk(s){return s&&s.length?Wl(s,gn,Tp):t}o(Qk,"max");function eI(s,f){return s&&s.length?Wl(s,Ye(f,2),Tp):t}o(eI,"maxBy");function tI(s){return T2(s,gn)}o(tI,"mean");function rI(s,f){return T2(s,Ye(f,2))}o(rI,"meanBy");function nI(s){return s&&s.length?Wl(s,gn,Dp):t}o(nI,"min");function iI(s,f){return s&&s.length?Wl(s,Ye(f,2),Dp):t}o(iI,"minBy");var oI=th(function(s,f){return s*f},1),sI=Hp("round"),aI=th(function(s,f){return s-f},0);function fI(s){return s&&s.length?mp(s,gn):0}o(fI,"sum");function cI(s,f){return s&&s.length?mp(s,Ye(f,2)):0}return o(cI,"sumBy"),H.after=DT,H.ary=Zv,H.assign=vC,H.assignIn=hy,H.assignInWith=ph,H.assignWith=yC,H.at=xC,H.before=Qv,H.bind=em,H.bindAll=Sk,H.bindKey=ey,H.castArray=zT,H.chain=Jv,H.chunk=ZS,H.compact=QS,H.concat=eM,H.cond=Mk,H.conforms=Tk,H.constant=am,H.countBy=fT,H.create=wC,H.curry=ty,H.curryRight=ry,H.debounce=ny,H.defaults=_C,H.defaultsDeep=EC,H.defer=OT,H.delay=RT,H.difference=tM,H.differenceBy=rM,H.differenceWith=nM,H.drop=iM,H.dropRight=oM,H.dropRightWhile=sM,H.dropWhile=aM,H.fill=fM,H.filter=uT,H.flatMap=dT,H.flatMapDeep=pT,H.flatMapDepth=mT,H.flatten=jv,H.flattenDeep=cM,H.flattenDepth=uM,H.flip=NT,H.flow=kk,H.flowRight=Ik,H.fromPairs=lM,H.functions=IC,H.functionsIn=DC,H.groupBy=bT,H.initial=dM,H.intersection=pM,H.intersectionBy=mM,H.intersectionWith=bM,H.invert=RC,H.invertBy=NC,H.invokeMap=vT,H.iteratee=fm,H.keyBy=yT,H.keys=Ar,H.keysIn=bn,H.map=fh,H.mapKeys=LC,H.mapValues=BC,H.matches=Dk,H.matchesProperty=Ok,H.memoize=uh,H.merge=UC,H.mergeWith=dy,H.method=Rk,H.methodOf=Nk,H.mixin=cm,H.negate=lh,H.nthArg=Lk,H.omit=$C,H.omitBy=FC,H.once=PT,H.orderBy=xT,H.over=Bk,H.overArgs=LT,H.overEvery=Uk,H.overSome=$k,H.partial=tm,H.partialRight=iy,H.partition=wT,H.pick=qC,H.pickBy=py,H.property=wy,H.propertyOf=Fk,H.pull=xM,H.pullAll=Vv,H.pullAllBy=wM,H.pullAllWith=_M,H.pullAt=EM,H.range=qk,H.rangeRight=Hk,H.rearg=BT,H.reject=AT,H.remove=AM,H.rest=UT,H.reverse=Zp,H.sampleSize=MT,H.set=zC,H.setWith=KC,H.shuffle=TT,H.slice=SM,H.sortBy=IT,H.sortedUniq=OM,H.sortedUniqBy=RM,H.split=dk,H.spread=$T,H.tail=NM,H.take=PM,H.takeRight=LM,H.takeRightWhile=BM,H.takeWhile=UM,H.tap=QM,H.throttle=FT,H.thru=ah,H.toArray=cy,H.toPairs=my,H.toPairsIn=by,H.toPath=Vk,H.toPlainObject=ly,H.transform=jC,H.unary=qT,H.union=$M,H.unionBy=FM,H.unionWith=qM,H.uniq=HM,H.uniqBy=zM,H.uniqWith=KM,H.unset=GC,H.unzip=Qp,H.unzipWith=Wv,H.update=VC,H.updateWith=WC,H.values=Df,H.valuesIn=JC,H.without=jM,H.words=yy,H.wrap=HT,H.xor=GM,H.xorBy=VM,H.xorWith=WM,H.zip=JM,H.zipObject=YM,H.zipObjectDeep=XM,H.zipWith=ZM,H.entries=my,H.entriesIn=by,H.extend=hy,H.extendWith=ph,cm(H,H),H.add=Jk,H.attempt=xy,H.camelCase=QC,H.capitalize=gy,H.ceil=Yk,H.clamp=YC,H.clone=KT,H.cloneDeep=GT,H.cloneDeepWith=VT,H.cloneWith=jT,H.conformsTo=WT,H.deburr=vy,H.defaultTo=Ck,H.divide=Xk,H.endsWith=ek,H.eq=Ii,H.escape=tk,H.escapeRegExp=rk,H.every=cT,H.find=lT,H.findIndex=zv,H.findKey=AC,H.findLast=hT,H.findLastIndex=Kv,H.findLastKey=SC,H.floor=Zk,H.forEach=Yv,H.forEachRight=Xv,H.forIn=MC,H.forInRight=TC,H.forOwn=CC,H.forOwnRight=kC,H.get=im,H.gt=JT,H.gte=YT,H.has=OC,H.hasIn=om,H.head=Gv,H.identity=gn,H.includes=gT,H.indexOf=hM,H.inRange=XC,H.invoke=PC,H.isArguments=ya,H.isArray=vt,H.isArrayBuffer=XT,H.isArrayLike=mn,H.isArrayLikeObject=mr,H.isBoolean=ZT,H.isBuffer=ws,H.isDate=QT,H.isElement=eC,H.isEmpty=tC,H.isEqual=rC,H.isEqualWith=nC,H.isError=rm,H.isFinite=iC,H.isFunction=Bo,H.isInteger=oy,H.isLength=hh,H.isMap=sy,H.isMatch=oC,H.isMatchWith=sC,H.isNaN=aC,H.isNative=fC,H.isNil=uC,H.isNull=cC,H.isNumber=ay,H.isObject=ar,H.isObjectLike=fr,H.isPlainObject=eu,H.isRegExp=nm,H.isSafeInteger=lC,H.isSet=fy,H.isString=dh,H.isSymbol=On,H.isTypedArray=If,H.isUndefined=hC,H.isWeakMap=dC,H.isWeakSet=pC,H.join=gM,H.kebabCase=nk,H.last=fi,H.lastIndexOf=vM,H.lowerCase=ik,H.lowerFirst=ok,H.lt=mC,H.lte=bC,H.max=Qk,H.maxBy=eI,H.mean=tI,H.meanBy=rI,H.min=nI,H.minBy=iI,H.stubArray=lm,H.stubFalse=hm,H.stubObject=zk,H.stubString=Kk,H.stubTrue=jk,H.multiply=oI,H.nth=yM,H.noConflict=Pk,H.noop=um,H.now=ch,H.pad=sk,H.padEnd=ak,H.padStart=fk,H.parseInt=ck,H.random=ZC,H.reduce=_T,H.reduceRight=ET,H.repeat=uk,H.replace=lk,H.result=HC,H.round=sI,H.runInContext=de,H.sample=ST,H.size=CT,H.snakeCase=hk,H.some=kT,H.sortedIndex=MM,H.sortedIndexBy=TM,H.sortedIndexOf=CM,H.sortedLastIndex=kM,H.sortedLastIndexBy=IM,H.sortedLastIndexOf=DM,H.startCase=pk,H.startsWith=mk,H.subtract=aI,H.sum=fI,H.sumBy=cI,H.template=bk,H.times=Gk,H.toFinite=Uo,H.toInteger=wt,H.toLength=uy,H.toLower=gk,H.toNumber=ci,H.toSafeInteger=gC,H.toString=Kt,H.toUpper=vk,H.trim=yk,H.trimEnd=xk,H.trimStart=wk,H.truncate=_k,H.unescape=Ek,H.uniqueId=Wk,H.upperCase=Ak,H.upperFirst=sm,H.each=Yv,H.eachRight=Xv,H.first=Gv,cm(H,function(){var s={};return eo(H,function(f,d){Vt.call(H.prototype,d)||(s[d]=f)}),s}(),{chain:!1}),H.VERSION=e,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){H[s].placeholder=H}),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==x||d==l;Dt.prototype[s]=function(B){var z=this.clone();return z.__iteratees__.push({iteratee:Ye(B,3),type:d}),z.__filtered__=z.__filtered__||M,z}}),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 Wc(d,s,f)})}),Dt.prototype.reject=function(s){return this.filter(lh(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=H[M?"take"+(f=="last"?"Right":""):f],z=M||/^find/.test(f);!B||(H.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(H,ds([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=z&&!Le,_t=be&&!ze;if(!z&&Te){te=_t?te:new Dt(this);var Qe=s.apply(te,fe);return Qe.__actions__.push({func:ah,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=Rl[s],d=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",M=/^(?:pop|shift)$/.test(s);H.prototype[s]=function(){var B=arguments;if(M&&!this.__chain__){var z=this.value();return f.apply(vt(z)?z:[],B)}return this[d](function(te){return f.apply(vt(te)?te:[],B)})}}),eo(Dt.prototype,function(s,f){var d=H[f];if(d){var M=d.name+"";Vt.call(Sf,M)||(Sf[M]=[]),Sf[M].push({name:f,func:d})}}),Sf[eh(t,N).name]=[{name:"wrapper",func:t}],Dt.prototype.clone=EA,Dt.prototype.reverse=AA,Dt.prototype.value=SA,H.prototype.at=eT,H.prototype.chain=tT,H.prototype.commit=rT,H.prototype.next=nT,H.prototype.plant=oT,H.prototype.reverse=sT,H.prototype.toJSON=H.prototype.valueOf=H.prototype.value=aT,H.prototype.first=H.prototype.head,qc&&(H.prototype[qc]=iT),H},"runInContext"),ms=rA();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Er._=ms,define(function(){return ms})):la?((la.exports=ms)._=ms,fp._=ms):Er._=ms}).call(Of)});function xa(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var iu=jt(()=>{o(xa,"asUint8Array")});function ou(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?xa(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var gh=jt(()=>{iu();o(ou,"allocUnsafe")});var Ty={};Jt(Ty,{concat:()=>Oi});function Oi(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));let r=ou(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return xa(r)}var dm=jt(()=>{gh();iu();o(Oi,"concat")});function kI(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,p=t.charAt(0),v=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function S(I){if(I instanceof Uint8Array||(ArrayBuffer.isView(I)?I=new Uint8Array(I.buffer,I.byteOffset,I.byteLength):Array.isArray(I)&&(I=Uint8Array.from(I))),!(I instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(I.length===0)return"";for(var N=0,J=0,L=0,V=I.length;L!==V&&I[L]===0;)L++,N++;for(var Z=(V-L)*y+1>>>0,Y=new Uint8Array(Z);L!==V;){for(var oe=I[L],K=0,q=Z-1;(oe!==0||K<J)&&q!==-1;q--,K++)oe+=256*Y[q]>>>0,Y[q]=oe%u>>>0,oe=oe/u>>>0;if(oe!==0)throw new Error("Non-zero carry");J=K,L++}for(var j=Z-J;j!==Z&&Y[j]===0;)j++;for(var le=p.repeat(N);j<Z;++j)le+=t.charAt(Y[j]);return le}o(S,"encode");function O(I){if(typeof I!="string")throw new TypeError("Expected String");if(I.length===0)return new Uint8Array;var N=0;if(I[N]!==" "){for(var J=0,L=0;I[N]===p;)J++,N++;for(var V=(I.length-N)*v+1>>>0,Z=new Uint8Array(V);I[N];){var Y=r[I.charCodeAt(N)];if(Y===255)return;for(var oe=0,K=V-1;(Y!==0||oe<L)&&K!==-1;K--,oe++)Y+=u*Z[K]>>>0,Z[K]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");L=oe,N++}if(I[N]!==" "){for(var q=V-L;q!==V&&Z[q]===0;)q++;for(var j=new Uint8Array(J+(V-q)),le=J;q!==V;)j[le++]=Z[q++];return j}}}o(O,"decodeUnsafe");function R(I){var N=O(I);if(N)return N;throw new Error(`Non-${e} character`)}return o(R,"decode"),{encode:S,decodeUnsafe:O,decode:R}}var II,DI,Cy,ky=jt(()=>{o(kI,"base");II=kI,DI=II,Cy=DI});var Dz,Iy,Fo,Dy,Oy,_s=jt(()=>{Dz=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"),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"),Dy=o(t=>new TextEncoder().encode(t),"fromString"),Oy=o(t=>new TextDecoder().decode(t),"toString")});var vh,yh,xh,Ry,wh,Rf,Es,OI,RI,cr,Ri=jt(()=>{ky();_s();vh=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(vh,"Encoder");yh=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(yh,"Decoder");xh=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(xh,"ComposedDecoder");Ry=o((t,e)=>new xh({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),"or"),wh=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new vh(e,r,n),this.decoder=new yh(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(wh,"Codec");Rf=o(({name:t,prefix:e,encode:r,decode:n})=>new wh(t,e,r,n),"from"),Es=o(({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Cy(r,e);return Rf({prefix:t,name:e,encode:n,decode:a=>Fo(i(a))})},"baseX"),OI=o((t,e,r,n)=>{let i={};for(let y=0;y<e.length;++y)i[e[y]]=y;let a=t.length;for(;t[a-1]==="=";)--a;let c=new Uint8Array(a*r/8|0),u=0,p=0,v=0;for(let y=0;y<a;++y){let S=i[t[y]];if(S===void 0)throw new SyntaxError(`Non-${n} character`);p=p<<r|S,u+=r,u>=8&&(u-=8,c[v++]=255&p>>u)}if(u>=r||255&p<<8-u)throw new SyntaxError("Unexpected end of data");return c},"decode"),RI=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let p=0;p<t.length;++p)for(u=u<<8|t[p],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})=>Rf({prefix:e,name:t,encode(i){return RI(i,n,r)},decode(i){return OI(i,n,r,t)}}),"rfc4648")});var mm={};Jt(mm,{identity:()=>NI});var NI,Ny=jt(()=>{Ri();_s();NI=Rf({prefix:"\0",name:"identity",encode:t=>Oy(t),decode:t=>Dy(t)})});var bm={};Jt(bm,{base2:()=>PI});var PI,Py=jt(()=>{Ri();PI=cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var gm={};Jt(gm,{base8:()=>LI});var LI,Ly=jt(()=>{Ri();LI=cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var vm={};Jt(vm,{base10:()=>BI});var BI,By=jt(()=>{Ri();BI=Es({prefix:"9",name:"base10",alphabet:"0123456789"})});var ym={};Jt(ym,{base16:()=>UI,base16upper:()=>$I});var UI,$I,Uy=jt(()=>{Ri();UI=cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$I=cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var xm={};Jt(xm,{base32:()=>Nf,base32hex:()=>zI,base32hexpad:()=>jI,base32hexpadupper:()=>GI,base32hexupper:()=>KI,base32pad:()=>qI,base32padupper:()=>HI,base32upper:()=>FI,base32z:()=>VI});var Nf,FI,qI,HI,zI,KI,jI,GI,VI,wm=jt(()=>{Ri();Nf=cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),FI=cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qI=cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),HI=cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),zI=cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),KI=cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),jI=cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),GI=cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),VI=cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var _m={};Jt(_m,{base36:()=>Ni,base36upper:()=>WI});var Ni,WI,Pf=jt(()=>{Ri();Ni=Es({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),WI=Es({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Em={};Jt(Em,{base58btc:()=>ui,base58flickr:()=>JI});var ui,JI,_h=jt(()=>{Ri();ui=Es({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),JI=Es({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Am={};Jt(Am,{base64:()=>YI,base64pad:()=>XI,base64url:()=>wa,base64urlpad:()=>ZI});var YI,XI,wa,ZI,Eh=jt(()=>{Ri();YI=cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),XI=cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),wa=cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ZI=cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Sm={};Jt(Sm,{base256emoji:()=>nD});function tD(t){return t.reduce((e,r)=>(e+=QI[r],e),"")}function rD(t){let e=[];for(let r of t){let n=eD[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var $y,QI,eD,nD,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}"),QI=$y.reduce((t,e,r)=>(t[r]=e,t),[]),eD=$y.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);o(tD,"encode");o(rD,"decode");nD=Rf({prefix:"\u{1F680}",name:"base256emoji",encode:tD,decode:rD})});function zy(t,e,r){e=e||[],r=r||0;for(var n=r;t>=aD;)e[r++]=t&255|qy,t/=128;for(;t&sD;)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>=cD);return Mm.bytes=a-n,r}var iD,qy,oD,sD,aD,fD,cD,Hy,uD,lD,hD,dD,pD,mD,bD,gD,vD,yD,xD,wD,su,Ky=jt(()=>{iD=zy,qy=128,oD=127,sD=~oD,aD=Math.pow(2,31);o(zy,"encode");fD=Mm,cD=128,Hy=127;o(Mm,"read");uD=Math.pow(2,7),lD=Math.pow(2,14),hD=Math.pow(2,21),dD=Math.pow(2,28),pD=Math.pow(2,35),mD=Math.pow(2,42),bD=Math.pow(2,49),gD=Math.pow(2,56),vD=Math.pow(2,63),yD=o(function(t){return t<uD?1:t<lD?2:t<hD?3:t<dD?4:t<pD?5:t<mD?6:t<bD?7:t<gD?8:t<vD?9:10},"length"),xD={encode:iD,decode:fD,encodingLength:yD},wD=xD,su=wD});var au,Lf,Bf,Sh=jt(()=>{Ky();au=o((t,e=0)=>[su.decode(t,e),su.decode.bytes],"decode"),Lf=o((t,e,r=0)=>(su.encode(t,e,r),e),"encodeTo"),Bf=o(t=>su.encodingLength(t),"encodingLength")});var qo,Mh,jy,_a,Ea=jt(()=>{_s();Sh();qo=o((t,e)=>{let r=e.byteLength,n=Bf(t),i=n+Bf(r),a=new Uint8Array(i+r);return Lf(t,a,0),Lf(r,a,n),a.set(e,i),new _a(t,r,e,a)},"create"),Mh=o(t=>{let e=Fo(t),[r,n]=au(e),[i,a]=au(e.subarray(n)),c=e.subarray(n+a);if(c.byteLength!==i)throw new Error("Incorrect length");return new _a(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"),_a=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};o(_a,"Digest")});var Tm,Th,Cm=jt(()=>{Ea();Tm=o(({name:t,code:e,encode:r})=>new Th(t,e,r),"from"),Th=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(Th,"Hasher")});var km={};Jt(km,{sha256:()=>As,sha512:()=>_D});var Vy,As,_D,cu=jt(()=>{Cm();Vy=o(t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),"sha"),As=Tm({name:"sha2-256",code:18,encode:Vy("SHA-256")}),_D=Tm({name:"sha2-512",code:19,encode:Vy("SHA-512")})});var Im={};Jt(Im,{identity:()=>Ch});var Wy,ED,Jy,AD,Ch,Dm=jt(()=>{_s();Ea();Wy=0,ED="identity",Jy=Fo,AD=o(t=>qo(Wy,Jy(t)),"digest"),Ch={code:Wy,name:ED,encode:Jy,digest:AD}});var Yy=jt(()=>{_s()});var Zz,Qz,Xy=jt(()=>{Zz=new TextEncoder,Qz=new TextDecoder});var We,TD,CD,kD,uu,ID,Zy,Qy,kh,Ih,DD,OD,RD,Pi=jt(()=>{Sh();Ea();_h();wm();_s();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:Ih,byteLength:Ih,code:kh,version:kh,multihash:kh,bytes:kh,_baseCache:Ih,asCID:Ih})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==uu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==ID)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&&jy(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return CD(r,i,e||ui.encoder);default:return kD(r,i,e||Nf.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 OD(/^0\.0/,RD),!!(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=Mh(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!==uu)throw new Error(`Version 0 CID must use dag-pb (code: ${uu}) 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,uu,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 _a(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]=au(e.subarray(r));return r+=O,S},"next"),i=n(),a=uu;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(),p=n(),v=r+p,y=v-c;return{version:i,codec:a,multihashCode:u,digestSize:p,multihashSize:y,size:v}}static parse(e,r){let[n,i]=TD(e,r),a=We.decode(i);return a._baseCache.set(n,e),a}};o(We,"CID");TD=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 Nf.prefix:{let r=e||Nf;return[Nf.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"),CD=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"),kD=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"),uu=112,ID=18,Zy=o((t,e,r)=>{let n=Bf(t),i=n+Bf(e),a=new Uint8Array(i+r.byteLength);return Lf(t,a,0),Lf(e,a,n),a.set(r,i),a},"encodeCID"),Qy=Symbol.for("@ipld/js-cid/CID"),kh={writable:!1,configurable:!1,enumerable:!0},Ih={writable:!1,enumerable:!1,configurable:!1},DD="0.0.0-dev",OD=o((t,e)=>{if(t.test(DD))console.warn(e);else throw new Error(e)},"deprecate"),RD=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
20
|
+
}`;var _t=by(function(){return Ht(z,ze+"return "+Ie).apply(t,te)});if(_t.source=Ie,Zp(_t))throw _t;return _t}o($C,"template");function FC(s){return Kt(s).toLowerCase()}o(FC,"toLower");function qC(s){return Kt(s).toUpperCase()}o(qC,"toUpper");function HC(s,f,d){if(s=Kt(s),s&&(d||f===t))return S2(s);if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=Ci(f),z=M2(M,B),te=T2(M,B)+1;return ws(M,z,te).join("")}o(HC,"trim");function zC(s,f,d){if(s=Kt(s),s&&(d||f===t))return s.slice(0,k2(s)+1);if(!s||!(f=Dn(f)))return s;var M=Ci(s),B=T2(M,Ci(f))+1;return ws(M,0,B).join("")}o(zC,"trimEnd");function KC(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=M2(M,Ci(f));return ws(M,B).join("")}o(KC,"trimStart");function jC(s,f){var d=j,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 z=s.length;if(_f(s)){var te=Ci(s);z=te.length}if(d>=z)return s;var fe=d-Ef(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),Qp(B)){if(s.slice(fe).search(B)){var Me,Te=be;for(B.global||(B=mp(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(jC,"truncate");function GC(s){return s=Kt(s),s&&nt.test(s)?s.replace(Je,w7):s}o(GC,"unescape");var VC=kf(function(s,f,d){return s+(d?" ":"")+f.toUpperCase()}),rm=gv("toUpperCase");function my(s,f,d){return s=Kt(s),f=d?t:f,f===t?b7(s)?A7(s):a7(s):s.match(f)||[]}o(my,"words");var by=St(function(s,f){try{return kn(s,t,f)}catch(d){return Zp(d)?d:new bt(d)}}),WC=Po(function(s,f){return ni(f,function(d){d=ro(d),Ro(s,d,Yp(s[d],s))}),s});function JC(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 z=s[B];if(kn(z[0],this,M))return kn(z[1],this,M)}})}o(JC,"cond");function YC(s){return wA(si(s,v))}o(YC,"conforms");function nm(s){return function(){return s}}o(nm,"constant");function XC(s,f){return s==null||s!==s?f:s}o(XC,"defaultTo");var ZC=yv(),QC=yv(!0);function gn(s){return s}o(gn,"identity");function im(s){return J2(typeof s=="function"?s:si(s,v))}o(im,"iteratee");function ek(s){return X2(si(s,v))}o(ek,"matches");function tk(s,f){return Z2(s,si(f,v))}o(tk,"matchesProperty");var rk=St(function(s,f){return function(d){return Wc(d,s,f)}}),nk=St(function(s,f){return function(d){return Wc(s,d,f)}});function om(s,f,d){var M=Ar(f),B=Jl(f,M);d==null&&!(ar(f)&&(B.length||!M.length))&&(d=f,f=s,s=this,B=Jl(f,Ar(f)));var z=!(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(z||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(om,"mixin");function ik(){return Er._===this&&(Er._=I7),this}o(ik,"noConflict");function sm(){}o(sm,"noop");function ok(s){return s=wt(s),St(function(f){return Q2(f,s)})}o(ok,"nthArg");var sk=Bp(sr),ak=Bp(x2),fk=Bp(fp);function gy(s){return Kp(s)?cp(ro(s)):UA(s)}o(gy,"property");function ck(s){return function(f){return s==null?t:ga(s,f)}}o(ck,"propertyOf");var uk=wv(),lk=wv(!0);function am(){return[]}o(am,"stubArray");function fm(){return!1}o(fm,"stubFalse");function hk(){return{}}o(hk,"stubObject");function dk(){return""}o(dk,"stubString");function pk(){return!0}o(pk,"stubTrue");function mk(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=hp(M,f);++d<s;)f(d);return B}o(mk,"times");function bk(s){return vt(s)?sr(s,ro):On(s)?[s]:pn(Bv(Kt(s)))}o(bk,"toPath");function gk(s){var f=++C7;return Kt(s)+f}o(gk,"uniqueId");var vk=th(function(s,f){return s+f},0),yk=Up("ceil"),xk=th(function(s,f){return s/f},1),wk=Up("floor");function _k(s){return s&&s.length?Wl(s,gn,Ep):t}o(_k,"max");function Ek(s,f){return s&&s.length?Wl(s,Ye(f,2),Ep):t}o(Ek,"maxBy");function Ak(s){return E2(s,gn)}o(Ak,"mean");function Sk(s,f){return E2(s,Ye(f,2))}o(Sk,"meanBy");function Mk(s){return s&&s.length?Wl(s,gn,Tp):t}o(Mk,"min");function Tk(s,f){return s&&s.length?Wl(s,Ye(f,2),Tp):t}o(Tk,"minBy");var Ck=th(function(s,f){return s*f},1),kk=Up("round"),Ik=th(function(s,f){return s-f},0);function Dk(s){return s&&s.length?lp(s,gn):0}o(Dk,"sum");function Ok(s,f){return s&&s.length?lp(s,Ye(f,2)):0}return o(Ok,"sumBy"),H.after=eT,H.ary=Wv,H.assign=qT,H.assignIn=fy,H.assignInWith=ph,H.assignWith=HT,H.at=zT,H.before=Jv,H.bind=Yp,H.bindAll=WC,H.bindKey=Yv,H.castArray=hT,H.chain=jv,H.chunk=wS,H.compact=_S,H.concat=ES,H.cond=JC,H.conforms=YC,H.constant=nm,H.countBy=DM,H.create=KT,H.curry=Xv,H.curryRight=Zv,H.debounce=Qv,H.defaults=jT,H.defaultsDeep=GT,H.defer=tT,H.delay=rT,H.difference=AS,H.differenceBy=SS,H.differenceWith=MS,H.drop=TS,H.dropRight=CS,H.dropRightWhile=kS,H.dropWhile=IS,H.fill=DS,H.filter=RM,H.flatMap=LM,H.flatMapDeep=BM,H.flatMapDepth=UM,H.flatten=qv,H.flattenDeep=OS,H.flattenDepth=RS,H.flip=nT,H.flow=ZC,H.flowRight=QC,H.fromPairs=NS,H.functions=QT,H.functionsIn=eC,H.groupBy=$M,H.initial=LS,H.intersection=BS,H.intersectionBy=US,H.intersectionWith=$S,H.invert=rC,H.invertBy=nC,H.invokeMap=qM,H.iteratee=im,H.keyBy=HM,H.keys=Ar,H.keysIn=bn,H.map=fh,H.mapKeys=oC,H.mapValues=sC,H.matches=ek,H.matchesProperty=tk,H.memoize=uh,H.merge=aC,H.mergeWith=cy,H.method=rk,H.methodOf=nk,H.mixin=om,H.negate=lh,H.nthArg=ok,H.omit=fC,H.omitBy=cC,H.once=iT,H.orderBy=zM,H.over=sk,H.overArgs=oT,H.overEvery=ak,H.overSome=fk,H.partial=Xp,H.partialRight=ey,H.partition=KM,H.pick=uC,H.pickBy=uy,H.property=gy,H.propertyOf=ck,H.pull=zS,H.pullAll=zv,H.pullAllBy=KS,H.pullAllWith=jS,H.pullAt=GS,H.range=uk,H.rangeRight=lk,H.rearg=sT,H.reject=VM,H.remove=VS,H.rest=aT,H.reverse=Wp,H.sampleSize=JM,H.set=hC,H.setWith=dC,H.shuffle=YM,H.slice=WS,H.sortBy=QM,H.sortedUniq=tM,H.sortedUniqBy=rM,H.split=LC,H.spread=fT,H.tail=nM,H.take=iM,H.takeRight=oM,H.takeRightWhile=sM,H.takeWhile=aM,H.tap=_M,H.throttle=cT,H.thru=ah,H.toArray=oy,H.toPairs=ly,H.toPairsIn=hy,H.toPath=bk,H.toPlainObject=ay,H.transform=pC,H.unary=uT,H.union=fM,H.unionBy=cM,H.unionWith=uM,H.uniq=lM,H.uniqBy=hM,H.uniqWith=dM,H.unset=mC,H.unzip=Jp,H.unzipWith=Kv,H.update=bC,H.updateWith=gC,H.values=Of,H.valuesIn=vC,H.without=pM,H.words=my,H.wrap=lT,H.xor=mM,H.xorBy=bM,H.xorWith=gM,H.zip=vM,H.zipObject=yM,H.zipObjectDeep=xM,H.zipWith=wM,H.entries=ly,H.entriesIn=hy,H.extend=fy,H.extendWith=ph,om(H,H),H.add=vk,H.attempt=by,H.camelCase=_C,H.capitalize=dy,H.ceil=yk,H.clamp=yC,H.clone=dT,H.cloneDeep=mT,H.cloneDeepWith=bT,H.cloneWith=pT,H.conformsTo=gT,H.deburr=py,H.defaultTo=XC,H.divide=xk,H.endsWith=EC,H.eq=Ii,H.escape=AC,H.escapeRegExp=SC,H.every=OM,H.find=NM,H.findIndex=$v,H.findKey=VT,H.findLast=PM,H.findLastIndex=Fv,H.findLastKey=WT,H.floor=wk,H.forEach=Gv,H.forEachRight=Vv,H.forIn=JT,H.forInRight=YT,H.forOwn=XT,H.forOwnRight=ZT,H.get=em,H.gt=vT,H.gte=yT,H.has=tC,H.hasIn=tm,H.head=Hv,H.identity=gn,H.includes=FM,H.indexOf=PS,H.inRange=xC,H.invoke=iC,H.isArguments=xa,H.isArray=vt,H.isArrayBuffer=xT,H.isArrayLike=mn,H.isArrayLikeObject=mr,H.isBoolean=wT,H.isBuffer=_s,H.isDate=_T,H.isElement=ET,H.isEmpty=AT,H.isEqual=ST,H.isEqualWith=MT,H.isError=Zp,H.isFinite=TT,H.isFunction=Bo,H.isInteger=ty,H.isLength=hh,H.isMap=ry,H.isMatch=CT,H.isMatchWith=kT,H.isNaN=IT,H.isNative=DT,H.isNil=RT,H.isNull=OT,H.isNumber=ny,H.isObject=ar,H.isObjectLike=fr,H.isPlainObject=eu,H.isRegExp=Qp,H.isSafeInteger=NT,H.isSet=iy,H.isString=dh,H.isSymbol=On,H.isTypedArray=Df,H.isUndefined=PT,H.isWeakMap=LT,H.isWeakSet=BT,H.join=FS,H.kebabCase=MC,H.last=fi,H.lastIndexOf=qS,H.lowerCase=TC,H.lowerFirst=CC,H.lt=UT,H.lte=$T,H.max=_k,H.maxBy=Ek,H.mean=Ak,H.meanBy=Sk,H.min=Mk,H.minBy=Tk,H.stubArray=am,H.stubFalse=fm,H.stubObject=hk,H.stubString=dk,H.stubTrue=pk,H.multiply=Ck,H.nth=HS,H.noConflict=ik,H.noop=sm,H.now=ch,H.pad=kC,H.padEnd=IC,H.padStart=DC,H.parseInt=OC,H.random=wC,H.reduce=jM,H.reduceRight=GM,H.repeat=RC,H.replace=NC,H.result=lC,H.round=kk,H.runInContext=de,H.sample=WM,H.size=XM,H.snakeCase=PC,H.some=ZM,H.sortedIndex=JS,H.sortedIndexBy=YS,H.sortedIndexOf=XS,H.sortedLastIndex=ZS,H.sortedLastIndexBy=QS,H.sortedLastIndexOf=eM,H.startCase=BC,H.startsWith=UC,H.subtract=Ik,H.sum=Dk,H.sumBy=Ok,H.template=$C,H.times=mk,H.toFinite=Uo,H.toInteger=wt,H.toLength=sy,H.toLower=FC,H.toNumber=ci,H.toSafeInteger=FT,H.toString=Kt,H.toUpper=qC,H.trim=HC,H.trimEnd=zC,H.trimStart=KC,H.truncate=jC,H.unescape=GC,H.uniqueId=gk,H.upperCase=VC,H.upperFirst=rm,H.each=Gv,H.eachRight=Vv,H.first=Hv,om(H,function(){var s={};return eo(H,function(f,d){Vt.call(H.prototype,d)||(s[d]=f)}),s}(),{chain:!1}),H.VERSION=e,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){H[s].placeholder=H}),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 z=this.clone();return z.__iteratees__.push({iteratee:Ye(B,3),type:d}),z.__filtered__=z.__filtered__||M,z}}),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 Wc(d,s,f)})}),Dt.prototype.reject=function(s){return this.filter(lh(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=H[M?"take"+(f=="last"?"Right":""):f],z=M||/^find/.test(f);!B||(H.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(H,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=z&&!Le,_t=be&&!ze;if(!z&&Te){te=_t?te:new Dt(this);var Qe=s.apply(te,fe);return Qe.__actions__.push({func:ah,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=Rl[s],d=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",M=/^(?:pop|shift)$/.test(s);H.prototype[s]=function(){var B=arguments;if(M&&!this.__chain__){var z=this.value();return f.apply(vt(z)?z:[],B)}return this[d](function(te){return f.apply(vt(te)?te:[],B)})}}),eo(Dt.prototype,function(s,f){var d=H[f];if(d){var M=d.name+"";Vt.call(Mf,M)||(Mf[M]=[]),Mf[M].push({name:f,func:d})}}),Mf[eh(t,P).name]=[{name:"wrapper",func:t}],Dt.prototype.clone=G7,Dt.prototype.reverse=V7,Dt.prototype.value=W7,H.prototype.at=EM,H.prototype.chain=AM,H.prototype.commit=SM,H.prototype.next=MM,H.prototype.plant=CM,H.prototype.reverse=kM,H.prototype.toJSON=H.prototype.valueOf=H.prototype.value=IM,H.prototype.first=H.prototype.head,qc&&(H.prototype[qc]=TM),H},"runInContext"),bs=S7();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Er._=bs,define(function(){return bs})):ha?((ha.exports=bs)._=bs,ip._=bs):Er._=bs}).call(Rf)});function wa(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var iu=jt(()=>{o(wa,"asUint8Array")});function ou(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?wa(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}var gh=jt(()=>{iu();o(ou,"allocUnsafe")});var Ey={};Jt(Ey,{concat:()=>Oi});function Oi(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));let r=ou(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return wa(r)}var cm=jt(()=>{gh();iu();o(Oi,"concat")});function Zk(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],K=0,q=Q-1;(oe!==0||K<J)&&q!==-1;q--,K++)oe+=256*Y[q]>>>0,Y[q]=oe%u>>>0,oe=oe/u>>>0;if(oe!==0)throw new Error("Non-zero carry");J=K,L++}for(var j=Q-J;j!==Q&&Y[j]===0;)j++;for(var le=m.repeat(P);j<Q;++j)le+=t.charAt(Y[j]);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,K=W-1;(Y!==0||oe<L)&&K!==-1;K--,oe++)Y+=u*Q[K]>>>0,Q[K]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");L=oe,P++}if(D[P]!==" "){for(var q=W-L;q!==W&&Q[q]===0;)q++;for(var j=new Uint8Array(J+(W-q)),le=J;q!==W;)j[le++]=Q[q++];return j}}}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 Qk,eI,Ay,Sy=jt(()=>{o(Zk,"base");Qk=Zk,eI=Qk,Ay=eI});var ez,My,Fo,Ty,Cy,Es=jt(()=>{ez=new Uint8Array(0),My=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"),Ty=o(t=>new TextEncoder().encode(t),"fromString"),Cy=o(t=>new TextDecoder().decode(t),"toString")});var vh,yh,xh,ky,wh,Nf,As,tI,rI,cr,Ri=jt(()=>{Sy();Es();vh=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(vh,"Encoder");yh=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 ky(this,e)}};o(yh,"Decoder");xh=class{constructor(e){this.decoders=e}or(e){return ky(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(xh,"ComposedDecoder");ky=o((t,e)=>new xh({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),"or"),wh=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new vh(e,r,n),this.decoder=new yh(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(wh,"Codec");Nf=o(({name:t,prefix:e,encode:r,decode:n})=>new wh(t,e,r,n),"from"),As=o(({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Ay(r,e);return Nf({prefix:t,name:e,encode:n,decode:a=>Fo(i(a))})},"baseX"),tI=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"),rI=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})=>Nf({prefix:e,name:t,encode(i){return rI(i,n,r)},decode(i){return tI(i,n,r,t)}}),"rfc4648")});var lm={};Jt(lm,{identity:()=>nI});var nI,Iy=jt(()=>{Ri();Es();nI=Nf({prefix:"\0",name:"identity",encode:t=>Cy(t),decode:t=>Ty(t)})});var hm={};Jt(hm,{base2:()=>iI});var iI,Dy=jt(()=>{Ri();iI=cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var dm={};Jt(dm,{base8:()=>oI});var oI,Oy=jt(()=>{Ri();oI=cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var pm={};Jt(pm,{base10:()=>sI});var sI,Ry=jt(()=>{Ri();sI=As({prefix:"9",name:"base10",alphabet:"0123456789"})});var mm={};Jt(mm,{base16:()=>aI,base16upper:()=>fI});var aI,fI,Ny=jt(()=>{Ri();aI=cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),fI=cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var bm={};Jt(bm,{base32:()=>Pf,base32hex:()=>hI,base32hexpad:()=>pI,base32hexpadupper:()=>mI,base32hexupper:()=>dI,base32pad:()=>uI,base32padupper:()=>lI,base32upper:()=>cI,base32z:()=>bI});var Pf,cI,uI,lI,hI,dI,pI,mI,bI,gm=jt(()=>{Ri();Pf=cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),cI=cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),uI=cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),lI=cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hI=cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dI=cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),pI=cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),mI=cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bI=cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var vm={};Jt(vm,{base36:()=>Ni,base36upper:()=>gI});var Ni,gI,Lf=jt(()=>{Ri();Ni=As({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),gI=As({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var ym={};Jt(ym,{base58btc:()=>ui,base58flickr:()=>vI});var ui,vI,_h=jt(()=>{Ri();ui=As({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),vI=As({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var xm={};Jt(xm,{base64:()=>yI,base64pad:()=>xI,base64url:()=>_a,base64urlpad:()=>wI});var yI,xI,_a,wI,Eh=jt(()=>{Ri();yI=cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),xI=cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_a=cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wI=cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var wm={};Jt(wm,{base256emoji:()=>MI});function AI(t){return t.reduce((e,r)=>(e+=_I[r],e),"")}function SI(t){let e=[];for(let r of t){let n=EI[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Py,_I,EI,MI,Ly=jt(()=>{Ri();Py=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}"),_I=Py.reduce((t,e,r)=>(t[r]=e,t),[]),EI=Py.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);o(AI,"encode");o(SI,"decode");MI=Nf({prefix:"\u{1F680}",name:"base256emoji",encode:AI,decode:SI})});function $y(t,e,r){e=e||[],r=r||0;for(var n=r;t>=II;)e[r++]=t&255|By,t/=128;for(;t&kI;)e[r++]=t&255|By,t>>>=7;return e[r]=t|0,$y.bytes=r-n+1,e}function _m(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw _m.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&Uy)<<i:(c&Uy)*Math.pow(2,i),i+=7}while(c>=OI);return _m.bytes=a-n,r}var TI,By,CI,kI,II,DI,OI,Uy,RI,NI,PI,LI,BI,UI,$I,FI,qI,HI,zI,KI,su,Fy=jt(()=>{TI=$y,By=128,CI=127,kI=~CI,II=Math.pow(2,31);o($y,"encode");DI=_m,OI=128,Uy=127;o(_m,"read");RI=Math.pow(2,7),NI=Math.pow(2,14),PI=Math.pow(2,21),LI=Math.pow(2,28),BI=Math.pow(2,35),UI=Math.pow(2,42),$I=Math.pow(2,49),FI=Math.pow(2,56),qI=Math.pow(2,63),HI=o(function(t){return t<RI?1:t<NI?2:t<PI?3:t<LI?4:t<BI?5:t<UI?6:t<$I?7:t<FI?8:t<qI?9:10},"length"),zI={encode:TI,decode:DI,encodingLength:HI},KI=zI,su=KI});var au,Bf,Uf,Sh=jt(()=>{Fy();au=o((t,e=0)=>[su.decode(t,e),su.decode.bytes],"decode"),Bf=o((t,e,r=0)=>(su.encode(t,e,r),e),"encodeTo"),Uf=o(t=>su.encodingLength(t),"encodingLength")});var qo,Mh,qy,Ea,Aa=jt(()=>{Es();Sh();qo=o((t,e)=>{let r=e.byteLength,n=Uf(t),i=n+Uf(r),a=new Uint8Array(i+r);return Bf(t,a,0),Bf(r,a,n),a.set(e,i),new Ea(t,r,e,a)},"create"),Mh=o(t=>{let e=Fo(t),[r,n]=au(e),[i,a]=au(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"),qy=o((t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&My(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 Em,Th,Am=jt(()=>{Aa();Em=o(({name:t,code:e,encode:r})=>new Th(t,e,r),"from"),Th=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(Th,"Hasher")});var Sm={};Jt(Sm,{sha256:()=>Ss,sha512:()=>jI});var zy,Ss,jI,cu=jt(()=>{Am();zy=o(t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),"sha"),Ss=Em({name:"sha2-256",code:18,encode:zy("SHA-256")}),jI=Em({name:"sha2-512",code:19,encode:zy("SHA-512")})});var Mm={};Jt(Mm,{identity:()=>Ch});var Ky,GI,jy,VI,Ch,Tm=jt(()=>{Es();Aa();Ky=0,GI="identity",jy=Fo,VI=o(t=>qo(Ky,jy(t)),"digest"),Ch={code:Ky,name:GI,encode:jy,digest:VI}});var Gy=jt(()=>{Es()});var wz,_z,Vy=jt(()=>{wz=new TextEncoder,_z=new TextDecoder});var We,YI,XI,ZI,uu,QI,Wy,Jy,kh,Ih,eD,tD,rD,Pi=jt(()=>{Sh();Aa();_h();gm();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:Ih,byteLength:Ih,code:kh,version:kh,multihash:kh,bytes:kh,_baseCache:Ih,asCID:Ih})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==uu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==QI)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&&qy(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return XI(r,i,e||ui.encoder);default:return ZI(r,i,e||Pf.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 tD(/^0\.0/,rD),!!(e&&(e[Jy]||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||Wy(r,n,i.bytes))}else if(e!=null&&e[Jy]===!0){let{version:r,multihash:n,code:i}=e,a=Mh(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!==uu)throw new Error(`Version 0 CID must use dag-pb (code: ${uu}) block encoding`);return new We(e,r,n,n.bytes)}case 1:{let i=Wy(e,r,n.bytes);return new We(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return We.create(0,uu,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]=au(e.subarray(r));return r+=O,S},"next"),i=n(),a=uu;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]=YI(e,r),a=We.decode(i);return a._baseCache.set(n,e),a}};o(We,"CID");YI=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 Pf.prefix:{let r=e||Pf;return[Pf.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"),XI=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"),ZI=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"),uu=112,QI=18,Wy=o((t,e,r)=>{let n=Uf(t),i=n+Uf(e),a=new Uint8Array(i+r.byteLength);return Bf(t,a,0),Bf(e,a,n),a.set(r,i),a},"encodeCID"),Jy=Symbol.for("@ipld/js-cid/CID"),kh={writable:!1,configurable:!1,enumerable:!0},Ih={writable:!1,enumerable:!1,configurable:!1},eD="0.0.0-dev",tD=o((t,e)=>{if(t.test(eD))console.warn(e);else throw new Error(e)},"deprecate"),rD=`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 Om=jt(()=>{Pi();Sh();_s();Cm();Ea()});var lu,aK,Rm=jt(()=>{Ny();Py();Ly();By();Uy();wm();Pf();_h();Eh();Fy();cu();Dm();Yy();Xy();Om();lu={...mm,...bm,...gm,...vm,...ym,...xm,..._m,...Em,...Am,...Sm},aK={...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,ND,Dh,Pm=jt(()=>{Rm();gh();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=ou(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),ND={utf8:e3,"utf-8":e3,hex:lu.base16,latin1:Nm,ascii:Nm,binary:Nm,...lu},Dh=ND});var r3={};Jt(r3,{fromString:()=>Ot});function Ot(t,e="utf8"){let r=Dh[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?xa(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var hu=jt(()=>{Pm();iu();o(Ot,"fromString")});var n3={};Jt(n3,{toString:()=>kt});function kt(t,e="utf8"){let r=Dh[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 Uf=jt(()=>{Pm();o(kt,"toString")});var i3=De(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});function PD(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(PD,"imulShim");Pn.mul=Math.imul||PD;function LD(t,e){return t+e|0}o(LD,"add");Pn.add=LD;function BD(t,e){return t-e|0}o(BD,"sub");Pn.sub=BD;function UD(t,e){return t<<e|t>>>32-e}o(UD,"rotl");Pn.rotl=UD;function $D(t,e){return t<<32-e|t>>>e}o($D,"rotr");Pn.rotr=$D;function FD(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}o(FD,"isIntegerShim");Pn.isInteger=Number.isInteger||FD;Pn.MAX_SAFE_INTEGER=9007199254740991;Pn.isSafeInteger=function(t){return Pn.isInteger(t)&&t>=-Pn.MAX_SAFE_INTEGER&&t<=Pn.MAX_SAFE_INTEGER}});var Aa=De(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});var o3=i3();function qD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}o(qD,"readInt16BE");Mt.readInt16BE=qD;function HD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}o(HD,"readUint16BE");Mt.readUint16BE=HD;function zD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}o(zD,"readInt16LE");Mt.readInt16LE=zD;function KD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}o(KD,"readUint16LE");Mt.readUint16LE=KD;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 Oh(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(Oh,"writeUint32BE");Mt.writeUint32BE=Oh;Mt.writeInt32BE=Oh;function Rh(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(Rh,"writeUint32LE");Mt.writeUint32LE=Rh;Mt.writeInt32LE=Rh;function jD(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(jD,"readInt64BE");Mt.readInt64BE=jD;function GD(t,e){e===void 0&&(e=0);var r=Bm(t,e),n=Bm(t,e+4);return r*4294967296+n}o(GD,"readUint64BE");Mt.readUint64BE=GD;function VD(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(VD,"readInt64LE");Mt.readInt64LE=VD;function WD(t,e){e===void 0&&(e=0);var r=$m(t,e),n=$m(t,e+4);return n*4294967296+r}o(WD,"readUint64LE");Mt.readUint64LE=WD;function f3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Oh(t/4294967296>>>0,e,r),Oh(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),Rh(t>>>0,e,r),Rh(t/4294967296>>>0,e,r+4),e}o(c3,"writeUint64LE");Mt.writeUint64LE=c3;Mt.writeInt64LE=c3;function JD(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(JD,"readUintBE");Mt.readUintBE=JD;function YD(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(YD,"readUintLE");Mt.readUintLE=YD;function XD(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(XD,"writeUintBE");Mt.writeUintBE=XD;function ZD(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(ZD,"writeUintLE");Mt.writeUintLE=ZD;function QD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}o(QD,"readFloat32BE");Mt.readFloat32BE=QD;function eO(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}o(eO,"readFloat32LE");Mt.readFloat32LE=eO;function tO(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}o(tO,"readFloat64BE");Mt.readFloat64BE=tO;function rO(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}o(rO,"readFloat64LE");Mt.readFloat64LE=rO;function nO(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(nO,"writeFloat32BE");Mt.writeFloat32BE=nO;function iO(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(iO,"writeFloat32LE");Mt.writeFloat32LE=iO;function oO(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(oO,"writeFloat64BE");Mt.writeFloat64BE=oO;function sO(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(sO,"writeFloat64LE");Mt.writeFloat64LE=sO});var hi=De(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});function aO(t){for(var e=0;e<t.length;e++)t[e]=0;return t}o(aO,"wipe");Fm.wipe=aO});var l3=De(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});var Ph=Aa(),Nh=hi();Ss.DIGEST_LENGTH=32;Ss.BLOCK_SIZE=64;var u3=function(){function t(){this.digestLength=Ss.DIGEST_LENGTH,this.blockSize=Ss.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(){Nh.wipe(this._buffer),Nh.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;Ph.writeUint32BE(i,this._buffer,c-8),Ph.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++)Ph.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){Nh.wipe(e.state),e.buffer&&Nh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Ss.SHA256=u3;var fO=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],p=e[3],v=e[4],y=e[5],S=e[6],O=e[7],R=0;R<16;R++){var I=n+R*4;t[R]=Ph.readUint32BE(r,I)}for(var R=16;R<64;R++){var N=t[R-2],J=(N>>>17|N<<32-17)^(N>>>19|N<<32-19)^N>>>10;N=t[R-15];var L=(N>>>7|N<<32-7)^(N>>>18|N<<32-18)^N>>>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&y^~v&S)|0)+(O+(fO[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=y,y=v,v=p+J|0,p=u,u=c,c=a,a=J+L|0}e[0]+=a,e[1]+=c,e[2]+=u,e[3]+=p,e[4]+=v,e[5]+=y,e[6]+=S,e[7]+=O,n+=64,i-=64}return n}o(qm,"hashBlocks");function cO(t){var e=new u3;e.update(t);var r=e.digest();return e.clean(),r}o(cO,"hash");Ss.hash=cO});var Hm=De((DK,Lh)=>{(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 Lh=="object"&&Lh.exports,u=typeof define=="function"&&define.amd,p=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],S=[4,1024,262144,67108864],O=[1,256,65536,16777216],R=[6,1536,393216,100663296],I=[0,8,16,24],N=[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],V=["hex","buffer","arrayBuffer","array","digest"],Z={"128":168,"256":136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),p&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var Y=o(function(D,Q,se){return function(F){return new w(D,Q,D).update(F)[se]()}},"createOutputMethod"),oe=o(function(D,Q,se){return function(F,$){return new w(D,Q,$).update(F)[se]()}},"createShakeOutputMethod"),K=o(function(D,Q,se){return function(F,$,ee,ne){return l["cshake"+D].update(F,$,ee,ne)[se]()}},"createCshakeOutputMethod"),q=o(function(D,Q,se){return function(F,$,ee,ne){return l["kmac"+D].update(F,$,ee,ne)[se]()}},"createKmacOutputMethod"),j=o(function(D,Q,se,F){for(var $=0;$<V.length;++$){var ee=V[$];D[ee]=Q(se,F,ee)}return D},"createOutputMethods"),le=o(function(D,Q){var se=Y(D,Q,"hex");return se.create=function(){return new w(D,Q,D)},se.update=function(F){return se.create().update(F)},j(se,Y,D,Q)},"createMethod"),T=o(function(D,Q){var se=oe(D,Q,"hex");return se.create=function(F){return new w(D,Q,F)},se.update=function(F,$){return se.create($).update(F)},j(se,oe,D,Q)},"createShakeMethod"),h=o(function(D,Q){var se=Z[D],F=K(D,Q,"hex");return F.create=function($,ee,ne){return!ee&&!ne?l["shake"+D].create($):new w(D,Q,$).bytepad([ee,ne],se)},F.update=function($,ee,ne,ae){return F.create(ee,ne,ae).update($)},j(F,K,D,Q)},"createCshakeMethod"),x=o(function(D,Q){var se=Z[D],F=q(D,Q,"hex");return F.create=function($,ee,ne){return new k(D,Q,ee).bytepad(["KMAC",ne],se).bytepad([$],se)},F.update=function($,ee,ne,ae){return F.create($,ne,ae).update(ee)},j(F,q,D,Q)},"createKmacMethod"),b=[{name:"keccak",padding:O,bits:J,createMethod:le},{name:"sha3",padding:R,bits:J,createMethod:le},{name:"shake",padding:y,bits:L,createMethod:T},{name:"cshake",padding:S,bits:L,createMethod:h},{name:"kmac",padding:S,bits:L,createMethod:x}],l={},m=[],_=0;_<b.length;++_)for(var A=b[_],E=A.bits,g=0;g<E.length;++g){var C=A.name+"_"+E[g];if(m.push(C),l[C]=A.createMethod(E[g],A.padding),A.name!=="sha3"){var P=A.name+E[g];m.push(P),l[P]=l[C]}}function w(D,Q,se){this.blocks=[],this.s=[],this.padding=Q,this.outputBits=se,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=se>>5,this.extraBytes=(se&31)>>3;for(var F=0;F<50;++F)this.s[F]=0}o(w,"Keccak"),w.prototype.update=function(D){if(this.finalized)throw new Error(e);var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(t);if(p&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!p||!ArrayBuffer.isView(D)))throw new Error(t)}else throw new Error(t);Q=!0}for(var F=this.blocks,$=this.byteCount,ee=D.length,ne=this.blockCount,ae=0,Ae=this.s,ge,re;ae<ee;){if(this.reset)for(this.reset=!1,F[0]=this.block,ge=1;ge<ne+1;++ge)F[ge]=0;if(Q)for(ge=this.start;ae<ee&&ge<$;++ae)F[ge>>2]|=D[ae]<<I[ge++&3];else for(ge=this.start;ae<ee&&ge<$;++ae)re=D.charCodeAt(ae),re<128?F[ge>>2]|=re<<I[ge++&3]:re<2048?(F[ge>>2]|=(192|re>>6)<<I[ge++&3],F[ge>>2]|=(128|re&63)<<I[ge++&3]):re<55296||re>=57344?(F[ge>>2]|=(224|re>>12)<<I[ge++&3],F[ge>>2]|=(128|re>>6&63)<<I[ge++&3],F[ge>>2]|=(128|re&63)<<I[ge++&3]):(re=65536+((re&1023)<<10|D.charCodeAt(++ae)&1023),F[ge>>2]|=(240|re>>18)<<I[ge++&3],F[ge>>2]|=(128|re>>12&63)<<I[ge++&3],F[ge>>2]|=(128|re>>6&63)<<I[ge++&3],F[ge>>2]|=(128|re&63)<<I[ge++&3]);if(this.lastByteIndex=ge,ge>=$){for(this.start=ge-$,this.block=F[ne],ge=0;ge<ne;++ge)Ae[ge]^=F[ge];he(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(D,Q){var se=D&255,F=1,$=[se];for(D=D>>8,se=D&255;se>0;)$.unshift(se),D=D>>8,se=D&255,++F;return Q?$.push(F):$.unshift(F),this.update($),$.length},w.prototype.encodeString=function(D){var Q,se=typeof D;if(se!=="string"){if(se==="object"){if(D===null)throw new Error(t);if(p&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!p||!ArrayBuffer.isView(D)))throw new Error(t)}else throw new Error(t);Q=!0}var F=0,$=D.length;if(Q)F=$;else for(var ee=0;ee<D.length;++ee){var ne=D.charCodeAt(ee);ne<128?F+=1:ne<2048?F+=2:ne<55296||ne>=57344?F+=3:(ne=65536+((ne&1023)<<10|D.charCodeAt(++ee)&1023),F+=4)}return F+=this.encode(F*8),this.update(D),F},w.prototype.bytepad=function(D,Q){for(var se=this.encode(Q),F=0;F<D.length;++F)se+=this.encodeString(D[F]);var $=Q-se%Q,ee=[];return ee.length=$,this.update(ee),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,Q=this.lastByteIndex,se=this.blockCount,F=this.s;if(D[Q>>2]|=this.padding[Q&3],this.lastByteIndex===this.byteCount)for(D[0]=D[se],Q=1;Q<se+1;++Q)D[Q]=0;for(D[se-1]|=2147483648,Q=0;Q<se;++Q)F[Q]^=D[Q];he(F)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,F=this.extraBytes,$=0,ee=0,ne="",ae;ee<se;){for($=0;$<D&&ee<se;++$,++ee)ae=Q[$],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%D===0&&(he(Q),$=0)}return F&&(ae=Q[$],ne+=v[ae>>4&15]+v[ae&15],F>1&&(ne+=v[ae>>12&15]+v[ae>>8&15]),F>2&&(ne+=v[ae>>20&15]+v[ae>>16&15])),ne},w.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,Q=this.s,se=this.outputBlocks,F=this.extraBytes,$=0,ee=0,ne=this.outputBits>>3,ae;F?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(ne);for(var Ae=new Uint32Array(ae);ee<se;){for($=0;$<D&&ee<se;++$,++ee)Ae[ee]=Q[$];ee%D===0&&he(Q)}return F&&(Ae[$]=Q[$],ae=ae.slice(0,ne)),ae},w.prototype.buffer=w.prototype.arrayBuffer,w.prototype.digest=w.prototype.array=function(){this.finalize();for(var D=this.blockCount,Q=this.s,se=this.outputBlocks,F=this.extraBytes,$=0,ee=0,ne=[],ae,Ae;ee<se;){for($=0;$<D&&ee<se;++$,++ee)ae=ee<<2,Ae=Q[$],ne[ae]=Ae&255,ne[ae+1]=Ae>>8&255,ne[ae+2]=Ae>>16&255,ne[ae+3]=Ae>>24&255;ee%D===0&&he(Q)}return F&&(ae=ee<<2,Ae=Q[$],ne[ae]=Ae&255,F>1&&(ne[ae+1]=Ae>>8&255),F>2&&(ne[ae+2]=Ae>>16&255)),ne};function k(D,Q,se){w.call(this,D,Q,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(D){var Q,se,F,$,ee,ne,ae,Ae,ge,re,Se,ce,ve,G,pe,Ce,He,Re,Ve,pr,ue,ie,U,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(F=0;F<48;F+=2)$=D[0]^D[10]^D[20]^D[30]^D[40],ee=D[1]^D[11]^D[21]^D[31]^D[41],ne=D[2]^D[12]^D[22]^D[32]^D[42],ae=D[3]^D[13]^D[23]^D[33]^D[43],Ae=D[4]^D[14]^D[24]^D[34]^D[44],ge=D[5]^D[15]^D[25]^D[35]^D[45],re=D[6]^D[16]^D[26]^D[36]^D[46],Se=D[7]^D[17]^D[27]^D[37]^D[47],ce=D[8]^D[18]^D[28]^D[38]^D[48],ve=D[9]^D[19]^D[29]^D[39]^D[49],Q=ce^(ne<<1|ae>>>31),se=ve^(ae<<1|ne>>>31),D[0]^=Q,D[1]^=se,D[10]^=Q,D[11]^=se,D[20]^=Q,D[21]^=se,D[30]^=Q,D[31]^=se,D[40]^=Q,D[41]^=se,Q=$^(Ae<<1|ge>>>31),se=ee^(ge<<1|Ae>>>31),D[2]^=Q,D[3]^=se,D[12]^=Q,D[13]^=se,D[22]^=Q,D[23]^=se,D[32]^=Q,D[33]^=se,D[42]^=Q,D[43]^=se,Q=ne^(re<<1|Se>>>31),se=ae^(Se<<1|re>>>31),D[4]^=Q,D[5]^=se,D[14]^=Q,D[15]^=se,D[24]^=Q,D[25]^=se,D[34]^=Q,D[35]^=se,D[44]^=Q,D[45]^=se,Q=Ae^(ce<<1|ve>>>31),se=ge^(ve<<1|ce>>>31),D[6]^=Q,D[7]^=se,D[16]^=Q,D[17]^=se,D[26]^=Q,D[27]^=se,D[36]^=Q,D[37]^=se,D[46]^=Q,D[47]^=se,Q=re^($<<1|ee>>>31),se=Se^(ee<<1|$>>>31),D[8]^=Q,D[9]^=se,D[18]^=Q,D[19]^=se,D[28]^=Q,D[29]^=se,D[38]^=Q,D[39]^=se,D[48]^=Q,D[49]^=se,G=D[0],pe=D[1],Xe=D[11]<<4|D[10]>>>28,Zn=D[10]<<4|D[11]>>>28,ke=D[20]<<3|D[21]>>>29,It=D[21]<<3|D[20]>>>29,ln=D[31]<<9|D[30]>>>23,hn=D[30]<<9|D[31]>>>23,st=D[40]<<18|D[41]>>>14,at=D[41]<<18|D[40]>>>14,Je=D[2]<<1|D[3]>>>31,Tn=D[3]<<1|D[2]>>>31,Ce=D[13]<<12|D[12]>>>20,He=D[12]<<12|D[13]>>>20,ct=D[22]<<10|D[23]>>>22,ut=D[23]<<10|D[22]>>>22,Ue=D[33]<<13|D[32]>>>19,Oe=D[32]<<13|D[33]>>>19,Nr=D[42]<<2|D[43]>>>30,dn=D[43]<<2|D[42]>>>30,dt=D[5]<<30|D[4]>>>2,tt=D[4]<<30|D[5]>>>2,nt=D[14]<<6|D[15]>>>26,it=D[15]<<6|D[14]>>>26,Re=D[25]<<11|D[24]>>>21,Ve=D[24]<<11|D[25]>>>21,Qn=D[34]<<15|D[35]>>>17,lt=D[35]<<15|D[34]>>>17,Bt=D[45]<<29|D[44]>>>3,je=D[44]<<29|D[45]>>>3,X=D[6]<<28|D[7]>>>4,me=D[7]<<28|D[6]>>>4,Cn=D[17]<<23|D[16]>>>9,Ft=D[16]<<23|D[17]>>>9,Yn=D[26]<<25|D[27]>>>7,ot=D[27]<<25|D[26]>>>7,pr=D[36]<<21|D[37]>>>11,ue=D[37]<<21|D[36]>>>11,ht=D[47]<<24|D[46]>>>8,ei=D[46]<<24|D[47]>>>8,cn=D[8]<<27|D[9]>>>5,ft=D[9]<<27|D[8]>>>5,ye=D[18]<<20|D[19]>>>12,we=D[19]<<20|D[18]>>>12,qt=D[29]<<7|D[28]>>>25,un=D[28]<<7|D[29]>>>25,et=D[38]<<8|D[39]>>>24,Xn=D[39]<<8|D[38]>>>24,ie=D[48]<<14|D[49]>>>18,U=D[49]<<14|D[48]>>>18,D[0]=G^~Ce&Re,D[1]=pe^~He&Ve,D[10]=X^~ye&ke,D[11]=me^~we&It,D[20]=Je^~nt&Yn,D[21]=Tn^~it&ot,D[30]=cn^~Xe&ct,D[31]=ft^~Zn&ut,D[40]=dt^~Cn&qt,D[41]=tt^~Ft&un,D[2]=Ce^~Re&pr,D[3]=He^~Ve&ue,D[12]=ye^~ke&Ue,D[13]=we^~It&Oe,D[22]=nt^~Yn&et,D[23]=it^~ot&Xn,D[32]=Xe^~ct&Qn,D[33]=Zn^~ut<,D[42]=Cn^~qt&ln,D[43]=Ft^~un&hn,D[4]=Re^~pr&ie,D[5]=Ve^~ue&U,D[14]=ke^~Ue&Bt,D[15]=It^~Oe&je,D[24]=Yn^~et&st,D[25]=ot^~Xn&at,D[34]=ct^~Qn&ht,D[35]=ut^~lt&ei,D[44]=qt^~ln&Nr,D[45]=un^~hn&dn,D[6]=pr^~ie&G,D[7]=ue^~U&pe,D[16]=Ue^~Bt&X,D[17]=Oe^~je&me,D[26]=et^~st&Je,D[27]=Xn^~at&Tn,D[36]=Qn^~ht&cn,D[37]=lt^~ei&ft,D[46]=ln^~Nr&dt,D[47]=hn^~dn&tt,D[8]=ie^~G&Ce,D[9]=U^~pe&He,D[18]=Bt^~X&ye,D[19]=je^~me&we,D[28]=st^~Je&nt,D[29]=at^~Tn&it,D[38]=ht^~cn&Xe,D[39]=ei^~ft&Zn,D[48]=Nr^~dt&Cn,D[49]=dn^~tt&Ft,D[0]^=N[F],D[1]^=N[F+1]},"f");if(c)Lh.exports=l;else{for(_=0;_<m.length;++_)n[m[_]]=l[m[_]];u&&define(function(){return l})}})()});var h3=De((OK,uO)=>{uO.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 x=o(function(){},"TempCtor");x.prototype=h.prototype,T.prototype=new x,T.prototype.constructor=T}o(n,"inherits");function i(T,h,x){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((h==="le"||h==="be")&&(x=h,h=10),this._init(T||0,h||10,x||"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,x){return h.cmp(x)>0?h:x},"max"),i.min=o(function(h,x){return h.cmp(x)<0?h:x},"min"),i.prototype._init=o(function(h,x,b){if(typeof h=="number")return this._initNumber(h,x,b);if(typeof h=="object")return this._initArray(h,x,b);x==="hex"&&(x=16),r(x===(x|0)&&x>=2&&x<=36),h=h.toString().replace(/\s+/g,"");var l=0;h[0]==="-"&&(l++,this.negative=1),l<h.length&&(x===16?this._parseHex(h,l,b):(this._parseBase(h,x,l),b==="le"&&this._initArray(this.toArray(),x,b)))},"init"),i.prototype._initNumber=o(function(h,x,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(),x,b)},"_initNumber"),i.prototype._initArray=o(function(h,x,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 m,_,A=0;if(b==="be")for(l=h.length-1,m=0;l>=0;l-=3)_=h[l]|h[l-1]<<8|h[l-2]<<16,this.words[m]|=_<<A&67108863,this.words[m+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,m++);else if(b==="le")for(l=0,m=0;l<h.length;l+=3)_=h[l]|h[l+1]<<8|h[l+2]<<16,this.words[m]|=_<<A&67108863,this.words[m+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,m++);return this.strip()},"_initArray");function c(T,h){var x=T.charCodeAt(h);return x>=65&&x<=70?x-55:x>=97&&x<=102?x-87:x-48&15}o(c,"parseHex4Bits");function u(T,h,x){var b=c(T,x);return x-1>=h&&(b|=c(T,x-1)<<4),b}o(u,"parseHexByte"),i.prototype._parseHex=o(function(h,x,b){this.length=Math.ceil((h.length-x)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var m=0,_=0,A;if(b==="be")for(l=h.length-1;l>=x;l-=2)A=u(h,x,l)<<m,this.words[_]|=A&67108863,m>=18?(m-=18,_+=1,this.words[_]|=A>>>26):m+=8;else{var E=h.length-x;for(l=E%2===0?x+1:x;l<h.length;l+=2)A=u(h,x,l)<<m,this.words[_]|=A&67108863,m>=18?(m-=18,_+=1,this.words[_]|=A>>>26):m+=8}this.strip()},"_parseHex");function p(T,h,x,b){for(var l=0,m=Math.min(T.length,x),_=h;_<m;_++){var A=T.charCodeAt(_)-48;l*=b,A>=49?l+=A-49+10:A>=17?l+=A-17+10:l+=A}return l}o(p,"parseBase"),i.prototype._parseBase=o(function(h,x,b){this.words=[0],this.length=1;for(var l=0,m=1;m<=67108863;m*=x)l++;l--,m=m/x|0;for(var _=h.length-b,A=_%l,E=Math.min(_,_-A)+b,g=0,C=b;C<E;C+=l)g=p(h,C,C+l,x),this.imuln(m),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(A!==0){var P=1;for(g=p(h,C,h.length,x),C=0;C<A;C++)P*=x;this.imuln(P),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 x=0;x<this.length;x++)h.words[x]=this.words[x];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"],y=[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,x){h=h||10,x=x|0||1;var b;if(h===16||h==="hex"){b="";for(var l=0,m=0,_=0;_<this.length;_++){var A=this.words[_],E=((A<<l|m)&16777215).toString(16);m=A>>>24-l&16777215,m!==0||_!==this.length-1?b=v[6-E.length]+E+b:b=E+b,l+=2,l>=26&&(l-=26,_--)}for(m!==0&&(b=m.toString(16)+b);b.length%x!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],C=S[h];b="";var P=this.clone();for(P.negative=0;!P.isZero();){var w=P.modn(C).toString(h);P=P.idivn(C),P.isZero()?b=w+b:b=v[g-w.length]+w+b}for(this.isZero()&&(b="0"+b);b.length%x!==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,x){return r(typeof a<"u"),this.toArrayLike(a,h,x)},"toBuffer"),i.prototype.toArray=o(function(h,x){return this.toArrayLike(Array,h,x)},"toArray"),i.prototype.toArrayLike=o(function(h,x,b){var l=this.byteLength(),m=b||Math.max(1,l);r(l<=m,"byte array longer than desired length"),r(m>0,"Requested array length <= 0"),this.strip();var _=x==="le",A=new h(m),E,g,C=this.clone();if(_){for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[g]=E;for(;g<m;g++)A[g]=0}else{for(g=0;g<m-l;g++)A[g]=0;for(g=0;!C.isZero();g++)E=C.andln(255),C.iushrn(8),A[m-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 x=h,b=0;return x>=4096&&(b+=13,x>>>=13),x>=64&&(b+=7,x>>>=7),x>=8&&(b+=4,x>>>=4),x>=2&&(b+=2,x>>>=2),b+x},"_countBits"),i.prototype._zeroBits=o(function(h){if(h===0)return 26;var x=h,b=0;return(x&8191)===0&&(b+=13,x>>>=13),(x&127)===0&&(b+=7,x>>>=7),(x&15)===0&&(b+=4,x>>>=4),(x&3)===0&&(b+=2,x>>>=2),(x&1)===0&&b++,b},"_zeroBits"),i.prototype.bitLength=o(function(){var h=this.words[this.length-1],x=this._countBits(h);return(this.length-1)*26+x},"bitLength");function O(T){for(var h=new Array(T.bitLength()),x=0;x<h.length;x++){var b=x/26|0,l=x%26;h[x]=(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,x=0;x<this.length;x++){var b=this._zeroBits(this.words[x]);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 x=0;x<h.length;x++)this.words[x]=this.words[x]|h.words[x];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 x;this.length>h.length?x=h:x=this;for(var b=0;b<x.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=x.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 x,b;this.length>h.length?(x=this,b=h):(x=h,b=this);for(var l=0;l<b.length;l++)this.words[l]=x.words[l]^b.words[l];if(this!==x)for(;l<x.length;l++)this.words[l]=x.words[l];return this.length=x.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 x=Math.ceil(h/26)|0,b=h%26;this._expand(x),b>0&&x--;for(var l=0;l<x;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,x){r(typeof h=="number"&&h>=0);var b=h/26|0,l=h%26;return this._expand(b+1),x?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 x;if(this.negative!==0&&h.negative===0)return this.negative=0,x=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,x=this.isub(h),h.negative=1,x._normSign();var b,l;this.length>h.length?(b=this,l=h):(b=h,l=this);for(var m=0,_=0;_<l.length;_++)x=(b.words[_]|0)+(l.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;for(;m!==0&&_<b.length;_++)x=(b.words[_]|0)+m,this.words[_]=x&67108863,m=x>>>26;if(this.length=b.length,m!==0)this.words[this.length]=m,this.length++;else if(b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this},"iadd"),i.prototype.add=o(function(h){var x;return h.negative!==0&&this.negative===0?(h.negative=0,x=this.sub(h),h.negative^=1,x):h.negative===0&&this.negative!==0?(this.negative=0,x=h.sub(this),this.negative=1,x):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 x=this.iadd(h);return h.negative=1,x._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,m;b>0?(l=this,m=h):(l=h,m=this);for(var _=0,A=0;A<m.length;A++)x=(l.words[A]|0)-(m.words[A]|0)+_,_=x>>26,this.words[A]=x&67108863;for(;_!==0&&A<l.length;A++)x=(l.words[A]|0)+_,_=x>>26,this.words[A]=x&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,x){x.negative=h.negative^T.negative;var b=T.length+h.length|0;x.length=b,b=b-1|0;var l=T.words[0]|0,m=h.words[0]|0,_=l*m,A=_&67108863,E=_/67108864|0;x.words[0]=A;for(var g=1;g<b;g++){for(var C=E>>>26,P=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,m=h.words[k]|0,_=l*m+P,C+=_/67108864|0,P=_&67108863}x.words[g]=P|0,E=C|0}return E!==0?x.words[g]=E|0:x.length--,x.strip()}o(R,"smallMulTo");var I=o(function(h,x,b){var l=h.words,m=x.words,_=b.words,A=0,E,g,C,P=l[0]|0,w=P&8191,k=P>>>13,he=l[1]|0,D=he&8191,Q=he>>>13,se=l[2]|0,F=se&8191,$=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,G=l[6]|0,pe=G&8191,Ce=G>>>13,He=l[7]|0,Re=He&8191,Ve=He>>>13,pr=l[8]|0,ue=pr&8191,ie=pr>>>13,U=l[9]|0,X=U&8191,me=U>>>13,ye=m[0]|0,we=ye&8191,ke=ye>>>13,It=m[1]|0,Ue=It&8191,Oe=It>>>13,Bt=m[2]|0,je=Bt&8191,Je=Bt>>>13,Tn=m[3]|0,nt=Tn&8191,it=Tn>>>13,Yn=m[4]|0,ot=Yn&8191,et=Yn>>>13,Xn=m[5]|0,st=Xn&8191,at=Xn>>>13,cn=m[6]|0,ft=cn&8191,Xe=cn>>>13,Zn=m[7]|0,ct=Zn&8191,ut=Zn>>>13,Qn=m[8]|0,lt=Qn&8191,ht=Qn>>>13,ei=m[9]|0,dt=ei&8191,tt=ei>>>13;b.negative=h.negative^x.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(D,we),g=Math.imul(D,ke),g=g+Math.imul(Q,we)|0,C=Math.imul(Q,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(F,we),g=Math.imul(F,ke),g=g+Math.imul($,we)|0,C=Math.imul($,ke),E=E+Math.imul(D,Ue)|0,g=g+Math.imul(D,Oe)|0,g=g+Math.imul(Q,Ue)|0,C=C+Math.imul(Q,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(F,Ue)|0,g=g+Math.imul(F,Oe)|0,g=g+Math.imul($,Ue)|0,C=C+Math.imul($,Oe)|0,E=E+Math.imul(D,je)|0,g=g+Math.imul(D,Je)|0,g=g+Math.imul(Q,je)|0,C=C+Math.imul(Q,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(F,je)|0,g=g+Math.imul(F,Je)|0,g=g+Math.imul($,je)|0,C=C+Math.imul($,Je)|0,E=E+Math.imul(D,nt)|0,g=g+Math.imul(D,it)|0,g=g+Math.imul(Q,nt)|0,C=C+Math.imul(Q,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(F,nt)|0,g=g+Math.imul(F,it)|0,g=g+Math.imul($,nt)|0,C=C+Math.imul($,it)|0,E=E+Math.imul(D,ot)|0,g=g+Math.imul(D,et)|0,g=g+Math.imul(Q,ot)|0,C=C+Math.imul(Q,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(F,ot)|0,g=g+Math.imul(F,et)|0,g=g+Math.imul($,ot)|0,C=C+Math.imul($,et)|0,E=E+Math.imul(D,st)|0,g=g+Math.imul(D,at)|0,g=g+Math.imul(Q,st)|0,C=C+Math.imul(Q,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(F,st)|0,g=g+Math.imul(F,at)|0,g=g+Math.imul($,st)|0,C=C+Math.imul($,at)|0,E=E+Math.imul(D,ft)|0,g=g+Math.imul(D,Xe)|0,g=g+Math.imul(Q,ft)|0,C=C+Math.imul(Q,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(F,ft)|0,g=g+Math.imul(F,Xe)|0,g=g+Math.imul($,ft)|0,C=C+Math.imul($,Xe)|0,E=E+Math.imul(D,ct)|0,g=g+Math.imul(D,ut)|0,g=g+Math.imul(Q,ct)|0,C=C+Math.imul(Q,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(F,ct)|0,g=g+Math.imul(F,ut)|0,g=g+Math.imul($,ct)|0,C=C+Math.imul($,ut)|0,E=E+Math.imul(D,lt)|0,g=g+Math.imul(D,ht)|0,g=g+Math.imul(Q,lt)|0,C=C+Math.imul(Q,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(F,lt)|0,g=g+Math.imul(F,ht)|0,g=g+Math.imul($,lt)|0,C=C+Math.imul($,ht)|0,E=E+Math.imul(D,dt)|0,g=g+Math.imul(D,tt)|0,g=g+Math.imul(Q,dt)|0,C=C+Math.imul(Q,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(F,dt)|0,g=g+Math.imul(F,tt)|0,g=g+Math.imul($,dt)|0,C=C+Math.imul($,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||(I=R);function N(T,h,x){x.negative=h.negative^T.negative,x.length=T.length+h.length;for(var b=0,l=0,m=0;m<x.length-1;m++){var _=l;l=0;for(var A=b&67108863,E=Math.min(m,h.length-1),g=Math.max(0,m-T.length+1);g<=E;g++){var C=m-g,P=T.words[C]|0,w=h.words[g]|0,k=P*w,he=k&67108863;_=_+(k/67108864|0)|0,he=he+A|0,A=he&67108863,_=_+(he>>>26)|0,l+=_>>>26,_&=67108863}x.words[m]=A,b=_,_=l}return b!==0?x.words[m]=b:x.length--,x.strip()}o(N,"bigMulTo");function J(T,h,x){var b=new L;return b.mulp(T,h,x)}o(J,"jumboMulTo"),i.prototype.mulTo=o(function(h,x){var b,l=this.length+h.length;return this.length===10&&h.length===10?b=I(this,h,x):l<63?b=R(this,h,x):l<1024?b=N(this,h,x):b=J(this,h,x),b},"mulTo");function L(T,h){this.x=T,this.y=h}o(L,"FFTM"),L.prototype.makeRBT=o(function(h){for(var x=new Array(h),b=i.prototype._countBits(h)-1,l=0;l<h;l++)x[l]=this.revBin(l,b,h);return x},"makeRBT"),L.prototype.revBin=o(function(h,x,b){if(h===0||h===b-1)return h;for(var l=0,m=0;m<x;m++)l|=(h&1)<<x-m-1,h>>=1;return l},"revBin"),L.prototype.permute=o(function(h,x,b,l,m,_){for(var A=0;A<_;A++)l[A]=x[h[A]],m[A]=b[h[A]]},"permute"),L.prototype.transform=o(function(h,x,b,l,m,_){this.permute(_,h,x,b,l,m);for(var A=1;A<m;A<<=1)for(var E=A<<1,g=Math.cos(2*Math.PI/E),C=Math.sin(2*Math.PI/E),P=0;P<m;P+=E)for(var w=g,k=C,he=0;he<A;he++){var D=b[P+he],Q=l[P+he],se=b[P+he+A],F=l[P+he+A],$=w*se-k*F;F=w*F+k*se,se=$,b[P+he]=D+se,l[P+he]=Q+F,b[P+he+A]=D-se,l[P+he+A]=Q-F,he!==E&&($=g*w-C*k,k=g*k+C*w,w=$)}},"transform"),L.prototype.guessLen13b=o(function(h,x){var b=Math.max(x,h)|1,l=b&1,m=0;for(b=b/2|0;b;b=b>>>1)m++;return 1<<m+1+l},"guessLen13b"),L.prototype.conjugate=o(function(h,x,b){if(!(b<=1))for(var l=0;l<b/2;l++){var m=h[l];h[l]=h[b-l-1],h[b-l-1]=m,m=x[l],x[l]=-x[b-l-1],x[b-l-1]=-m}},"conjugate"),L.prototype.normalize13b=o(function(h,x){for(var b=0,l=0;l<x/2;l++){var m=Math.round(h[2*l+1]/x)*8192+Math.round(h[2*l]/x)+b;h[l]=m&67108863,m<67108864?b=0:b=m/67108864|0}return h},"normalize13b"),L.prototype.convert13b=o(function(h,x,b,l){for(var m=0,_=0;_<x;_++)m=m+(h[_]|0),b[2*_]=m&8191,m=m>>>13,b[2*_+1]=m&8191,m=m>>>13;for(_=2*x;_<l;++_)b[_]=0;r(m===0),r((m&-8192)===0)},"convert13b"),L.prototype.stub=o(function(h){for(var x=new Array(h),b=0;b<h;b++)x[b]=0;return x},"stub"),L.prototype.mulp=o(function(h,x,b){var l=2*this.guessLen13b(h.length,x.length),m=this.makeRBT(l),_=this.stub(l),A=new Array(l),E=new Array(l),g=new Array(l),C=new Array(l),P=new Array(l),w=new Array(l),k=b.words;k.length=l,this.convert13b(h.words,h.length,A,l),this.convert13b(x.words,x.length,C,l),this.transform(A,_,E,g,l,m),this.transform(C,_,P,w,l,m);for(var he=0;he<l;he++){var D=E[he]*P[he]-g[he]*w[he];g[he]=E[he]*w[he]+g[he]*P[he],E[he]=D}return this.conjugate(E,g,l),this.transform(E,g,k,_,l,m),this.conjugate(k,_,l),this.normalize13b(k,l),b.negative=h.negative^x.negative,b.length=h.length+x.length,b.strip()},"mulp"),i.prototype.mul=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),this.mulTo(h,x)},"mul"),i.prototype.mulf=o(function(h){var x=new i(null);return x.words=new Array(this.length+h.length),J(this,h,x)},"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 x=0,b=0;b<this.length;b++){var l=(this.words[b]|0)*h,m=(l&67108863)+(x&67108863);x>>=26,x+=l/67108864|0,x+=m>>>26,this.words[b]=m&67108863}return x!==0&&(this.words[b]=x,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 x=O(h);if(x.length===0)return new i(1);for(var b=this,l=0;l<x.length&&x[l]===0;l++,b=b.sqr());if(++l<x.length)for(var m=b.sqr();l<x.length;l++,m=m.sqr())x[l]!==0&&(b=b.mul(m));return b},"pow"),i.prototype.iushln=o(function(h){r(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26,l=67108863>>>26-x<<26-x,m;if(x!==0){var _=0;for(m=0;m<this.length;m++){var A=this.words[m]&l,E=(this.words[m]|0)-A<<x;this.words[m]=E|_,_=A>>>26-x}_&&(this.words[m]=_,this.length++)}if(b!==0){for(m=this.length-1;m>=0;m--)this.words[m+b]=this.words[m];for(m=0;m<b;m++)this.words[m]=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,x,b){r(typeof h=="number"&&h>=0);var l;x?l=(x-x%26)/26:l=0;var m=h%26,_=Math.min((h-m)/26,this.length),A=67108863^67108863>>>m<<m,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 P=this.words[g]|0;this.words[g]=C<<26-m|P>>>m,C=P&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,x,b){return r(this.negative===0),this.iushrn(h,x,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 x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return!1;var m=this.words[b];return!!(m&l)},"testn"),i.prototype.imaskn=o(function(h){r(typeof h=="number"&&h>=0);var x=h%26,b=(h-x)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(x!==0&&b++,this.length=Math.min(b,this.length),x!==0){var l=67108863^67108863>>>x<<x;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 x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+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 x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+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,x,b){var l=h.length+b,m;this._expand(l);var _,A=0;for(m=0;m<h.length;m++){_=(this.words[m+b]|0)+A;var E=(h.words[m]|0)*x;_-=E&67108863,A=(_>>26)-(E/67108864|0),this.words[m+b]=_&67108863}for(;m<this.length-b;m++)_=(this.words[m+b]|0)+A,A=_>>26,this.words[m+b]=_&67108863;if(A===0)return this.strip();for(r(A===-1),A=0,m=0;m<this.length;m++)_=-(this.words[m]|0)+A,A=_>>26,this.words[m]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(h,x){var b=this.length-h.length,l=this.clone(),m=h,_=m.words[m.length-1]|0,A=this._countBits(_);b=26-A,b!==0&&(m=m.ushln(b),l.iushln(b),_=m.words[m.length-1]|0);var E=l.length-m.length,g;if(x!=="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 P=l.clone()._ishlnsubmul(m,1,E);P.negative===0&&(l=P,g&&(g.words[E]=1));for(var w=E-1;w>=0;w--){var k=(l.words[m.length+w]|0)*67108864+(l.words[m.length+w-1]|0);for(k=Math.min(k/_|0,67108863),l._ishlnsubmul(m,k,w);l.negative!==0;)k--,l.negative=0,l._ishlnsubmul(m,1,w),l.isZero()||(l.negative^=1);g&&(g.words[w]=k)}return g&&g.strip(),l.strip(),x!=="div"&&b!==0&&l.iushrn(b),{div:g||null,mod:l}},"_wordDiv"),i.prototype.divmod=o(function(h,x,b){if(r(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var l,m,_;return this.negative!==0&&h.negative===0?(_=this.neg().divmod(h,x),x!=="mod"&&(l=_.div.neg()),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.iadd(h)),{div:l,mod:m}):this.negative===0&&h.negative!==0?(_=this.divmod(h.neg(),x),x!=="mod"&&(l=_.div.neg()),{div:l,mod:_.mod}):(this.negative&h.negative)!==0?(_=this.neg().divmod(h.neg(),x),x!=="div"&&(m=_.mod.neg(),b&&m.negative!==0&&m.isub(h)),{div:_.div,mod:m}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?x==="div"?{div:this.divn(h.words[0]),mod:null}:x==="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,x)},"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 x=this.divmod(h);if(x.mod.isZero())return x.div;var b=x.div.negative!==0?x.mod.isub(h):x.mod,l=h.ushrn(1),m=h.andln(1),_=b.cmp(l);return _<0||m===1&&_===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(h){r(h<=67108863);for(var x=(1<<26)%h,b=0,l=this.length-1;l>=0;l--)b=(x*b+(this.words[l]|0))%h;return b},"modn"),i.prototype.idivn=o(function(h){r(h<=67108863);for(var x=0,b=this.length-1;b>=0;b--){var l=(this.words[b]|0)+x*67108864;this.words[b]=l/h|0,x=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 x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=new i(0),A=new i(1),E=0;x.isEven()&&b.isEven();)x.iushrn(1),b.iushrn(1),++E;for(var g=b.clone(),C=x.clone();!x.isZero();){for(var P=0,w=1;(x.words[0]&w)===0&&P<26;++P,w<<=1);if(P>0)for(x.iushrn(P);P-- >0;)(l.isOdd()||m.isOdd())&&(l.iadd(g),m.isub(C)),l.iushrn(1),m.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);x.cmp(b)>=0?(x.isub(b),l.isub(_),m.isub(A)):(b.isub(x),_.isub(l),A.isub(m))}return{a:_,b:A,gcd:b.iushln(E)}},"egcd"),i.prototype._invmp=o(function(h){r(h.negative===0),r(!h.isZero());var x=this,b=h.clone();x.negative!==0?x=x.umod(h):x=x.clone();for(var l=new i(1),m=new i(0),_=b.clone();x.cmpn(1)>0&&b.cmpn(1)>0;){for(var A=0,E=1;(x.words[0]&E)===0&&A<26;++A,E<<=1);if(A>0)for(x.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;)m.isOdd()&&m.iadd(_),m.iushrn(1);x.cmp(b)>=0?(x.isub(b),l.isub(m)):(b.isub(x),m.isub(l))}var P;return x.cmpn(1)===0?P=l:P=m,P.cmpn(0)<0&&P.iadd(h),P},"_invmp"),i.prototype.gcd=o(function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var x=this.clone(),b=h.clone();x.negative=0,b.negative=0;for(var l=0;x.isEven()&&b.isEven();l++)x.iushrn(1),b.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;b.isEven();)b.iushrn(1);var m=x.cmp(b);if(m<0){var _=x;x=b,b=_}else if(m===0||b.cmpn(1)===0)break;x.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 x=h%26,b=(h-x)/26,l=1<<x;if(this.length<=b)return this._expand(b+1),this.words[b]|=l,this;for(var m=l,_=b;m!==0&&_<this.length;_++){var A=this.words[_]|0;A+=m,m=A>>>26,A&=67108863,this.words[_]=A}return m!==0&&(this.words[_]=m,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 x=h<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this.strip();var b;if(this.length>1)b=1;else{x&&(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 x=this.ucmp(h);return this.negative!==0?-x|0:x},"cmp"),i.prototype.ucmp=o(function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var x=0,b=this.length-1;b>=0;b--){var l=this.words[b]|0,m=h.words[b]|0;if(l!==m){l<m?x=-1:l>m&&(x=1);break}}return x},"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 j(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 V={k256:null,p224:null,p192:null,p25519:null};function Z(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(Z,"MPrime"),Z.prototype._tmp=o(function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},"_tmp"),Z.prototype.ireduce=o(function(h){var x=h,b;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),b=x.bitLength();while(b>this.n);var l=b<this.n?-1:x.ucmp(this.p);return l===0?(x.words[0]=0,x.length=1):l>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},"ireduce"),Z.prototype.split=o(function(h,x){h.iushrn(this.n,0,x)},"split"),Z.prototype.imulK=o(function(h){return h.imul(this.k)},"imulK");function Y(){Z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(Y,"K256"),n(Y,Z),Y.prototype.split=o(function(h,x){for(var b=4194303,l=Math.min(h.length,9),m=0;m<l;m++)x.words[m]=h.words[m];if(x.length=l,h.length<=9){h.words[0]=0,h.length=1;return}var _=h.words[9];for(x.words[x.length++]=_&b,m=10;m<h.length;m++){var A=h.words[m]|0;h.words[m-10]=(A&b)<<4|_>>>22,_=A}_>>>=22,h.words[m-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 x=0,b=0;b<h.length;b++){var l=h.words[b]|0;x+=l*977,h.words[b]=x&67108863,x=l*64+(x/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},"imulK");function oe(){Z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(oe,"P224"),n(oe,Z);function K(){Z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(K,"P192"),n(K,Z);function q(){Z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(q,"P25519"),n(q,Z),q.prototype.imulK=o(function(h){for(var x=0,b=0;b<h.length;b++){var l=(h.words[b]|0)*19+x,m=l&67108863;l>>>=26,h.words[b]=m,x=l}return x!==0&&(h.words[h.length++]=x),h},"imulK"),i._prime=o(function(h){if(V[h])return V[h];var x;if(h==="k256")x=new Y;else if(h==="p224")x=new oe;else if(h==="p192")x=new K;else if(h==="p25519")x=new q;else throw new Error("Unknown prime "+h);return V[h]=x,x},"prime");function j(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(j,"Red"),j.prototype._verify1=o(function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},"_verify1"),j.prototype._verify2=o(function(h,x){r((h.negative|x.negative)===0,"red works only with positives"),r(h.red&&h.red===x.red,"red works only with red numbers")},"_verify2"),j.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),j.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),j.prototype.add=o(function(h,x){this._verify2(h,x);var b=h.add(x);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},"add"),j.prototype.iadd=o(function(h,x){this._verify2(h,x);var b=h.iadd(x);return b.cmp(this.m)>=0&&b.isub(this.m),b},"iadd"),j.prototype.sub=o(function(h,x){this._verify2(h,x);var b=h.sub(x);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},"sub"),j.prototype.isub=o(function(h,x){this._verify2(h,x);var b=h.isub(x);return b.cmpn(0)<0&&b.iadd(this.m),b},"isub"),j.prototype.shl=o(function(h,x){return this._verify1(h),this.imod(h.ushln(x))},"shl"),j.prototype.imul=o(function(h,x){return this._verify2(h,x),this.imod(h.imul(x))},"imul"),j.prototype.mul=o(function(h,x){return this._verify2(h,x),this.imod(h.mul(x))},"mul"),j.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),j.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),j.prototype.sqrt=o(function(h){if(h.isZero())return h.clone();var x=this.m.andln(3);if(r(x%2===1),x===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var l=this.m.subn(1),m=0;!l.isZero()&&l.andln(1)===0;)m++,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),P=this.pow(h,l.addn(1).iushrn(1)),w=this.pow(h,l),k=m;w.cmp(_)!==0;){for(var he=w,D=0;he.cmp(_)!==0;D++)he=he.redSqr();r(D<k);var Q=this.pow(C,new i(1).iushln(k-D-1));P=P.redMul(Q),C=Q.redSqr(),w=w.redMul(C),k=D}return P},"sqrt"),j.prototype.invm=o(function(h){var x=h._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},"invm"),j.prototype.pow=o(function(h,x){if(x.isZero())return new i(1).toRed(this);if(x.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 m=2;m<l.length;m++)l[m]=this.mul(l[m-1],h);var _=l[0],A=0,E=0,g=x.bitLength()%26;for(g===0&&(g=26),m=x.length-1;m>=0;m--){for(var C=x.words[m],P=g-1;P>=0;P--){var w=C>>P&1;if(_!==l[0]&&(_=this.sqr(_)),w===0&&A===0){E=0;continue}A<<=1,A|=w,E++,!(E!==b&&(m!==0||P!==0))&&(_=this.mul(_,l[A]),E=0,A=0)}g=26}return _},"pow"),j.prototype.convertTo=o(function(h){var x=h.umod(this.m);return x===h?x.clone():x},"convertTo"),j.prototype.convertFrom=o(function(h){var x=h.clone();return x.red=null,x},"convertFrom"),i.mont=o(function(h){return new le(h)},"mont");function le(T){j.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,j),le.prototype.convertTo=o(function(h){return this.imod(h.ushln(this.shift))},"convertTo"),le.prototype.convertFrom=o(function(h){var x=this.imod(h.mul(this.rinv));return x.red=null,x},"convertFrom"),le.prototype.imul=o(function(h,x){if(h.isZero()||x.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"imul"),le.prototype.mul=o(function(h,x){if(h.isZero()||x.isZero())return new i(0)._forceRed(this);var b=h.mul(x),l=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=b.isub(l).iushrn(this.shift),_=m;return m.cmp(this.m)>=0?_=m.isub(this.m):m.cmpn(0)<0&&(_=m.iadd(this.m)),_._forceRed(this)},"mul"),le.prototype.invm=o(function(h){var x=this.imod(h._invmp(this.m).mul(this.r2));return x._forceRed(this)},"invm")})(typeof Km>"u"||Km,d3)});var Ms=De((PK,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 Bh=v3;function lO(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(lO,"toArray");Bh.toArray=lO;function b3(t){return t.length===1?"0"+t:t}o(b3,"zero2");Bh.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");Bh.toHex=g3;Bh.encode=o(function(e,r){return r==="hex"?g3(e):e},"encode")});var Ln=De(y3=>{"use strict";var Li=y3,hO=no(),dO=Ms(),Uh=jm();Li.assert=dO;Li.toArray=Uh.toArray;Li.zero2=Uh.zero2;Li.toHex=Uh.toHex;Li.encode=Uh.encode;function pO(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,p=a.andln(i-1);a.isOdd()?(p>(i>>1)-1?u=(i>>1)-p:u=p,a.isubn(u)):u=0,n[c]=u,a.iushrn(1)}return n}o(pO,"getNAF");Li.getNAF=pO;function mO(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 p;(c&1)===0?p=0:(a=t.andln(7)+n&7,(a===3||a===5)&&u===2?p=-c:p=c),r[0].push(p);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===p+1&&(n=1-n),2*i===v+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}o(mO,"getJSF");Li.getJSF=mO;function bO(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(bO,"cachedProperty");Li.cachedProperty=bO;function gO(t){return typeof t=="string"?Li.toArray(t,"hex"):t}o(gO,"parseBytes");Li.parseBytes=gO;function vO(t){return new hO(t,"hex","le")}o(vO,"intFromLE");Li.intFromLE=vO});var Jm=De((UK,Wm)=>{var Gm;Wm.exports=o(function(e){return Gm||(Gm=new Ts(null)),Gm.generate(e)},"rand");function Ts(t){this.rand=t}o(Ts,"Rand");Wm.exports.Rand=Ts;Ts.prototype.generate=o(function(e){return this._rand(e)},"generate");Ts.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?Ts.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Ts.prototype._rand=o(function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r},"_rand"):typeof window=="object"&&(Ts.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(Vm=require("crypto"),typeof Vm.randomBytes!="function")throw new Error("Not supported");Ts.prototype._rand=o(function(e){return Vm.randomBytes(e)},"_rand")}catch{}var Vm});var pu=De(($K,x3)=>{"use strict";var Sa=no(),du=Ln(),$h=du.getNAF,yO=du.getJSF,Fh=du.assert;function Cs(t,e){this.type=t,this.p=new Sa(e.p,16),this.red=e.prime?Sa.red(e.prime):Sa.mont(this.p),this.zero=new Sa(0).toRed(this.red),this.one=new Sa(1).toRed(this.red),this.two=new Sa(2).toRed(this.red),this.n=e.n&&new Sa(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(Cs,"BaseCurve");x3.exports=Cs;Cs.prototype.point=o(function(){throw new Error("Not implemented")},"point");Cs.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Cs.prototype._fixedNafMul=o(function(e,r){Fh(e.precomputed);var n=e._getDoubles(),i=$h(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],u,p;for(u=0;u<i.length;u+=n.step){p=0;for(var v=u+n.step-1;v>=u;v--)p=(p<<1)+i[v];c.push(p)}for(var y=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)p=c[u],p===O?S=S.mixedAdd(n.points[u]):p===-O&&(S=S.mixedAdd(n.points[u].neg()));y=y.add(S)}return y.toP()},"_fixedNafMul");Cs.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=$h(r,n,this._bitLength),u=this.jpoint(null,null,null),p=c.length-1;p>=0;p--){for(var v=0;p>=0&&c[p]===0;p--)v++;if(p>=0&&v++,u=u.dblp(v),p<0)break;var y=c[p];Fh(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(a[y-1>>1]):u=u.mixedAdd(a[-y-1>>1].neg()):y>0?u=u.add(a[y-1>>1]):u=u.add(a[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");Cs.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,p=this._wnafT3,v=0,y,S,O;for(y=0;y<i;y++){O=r[y];var R=O._getNAFPoints(e);c[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,N=y;if(c[I]!==1||c[N]!==1){p[I]=$h(n[I],c[I],this._bitLength),p[N]=$h(n[N],c[N],this._bitLength),v=Math.max(p[I].length,v),v=Math.max(p[N].length,v);continue}var J=[r[I],null,null,r[N]];r[I].y.cmp(r[N].y)===0?(J[1]=r[I].add(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg())):r[I].y.cmp(r[N].y.redNeg())===0?(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].add(r[N].neg())):(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],V=yO(n[I],n[N]);for(v=Math.max(V[0].length,v),p[I]=new Array(v),p[N]=new Array(v),S=0;S<v;S++){var Z=V[0][S]|0,Y=V[1][S]|0;p[I][S]=L[(Z+1)*3+(Y+1)],p[N][S]=0,u[I]=J}}var oe=this.jpoint(null,null,null),K=this._wnafT4;for(y=v;y>=0;y--){for(var q=0;y>=0;){var j=!0;for(S=0;S<i;S++)K[S]=p[S][y]|0,K[S]!==0&&(j=!1);if(!j)break;q++,y--}if(y>=0&&q++,oe=oe.dblp(q),y<0)break;for(S=0;S<i;S++){var le=K[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(y=0;y<i;y++)u[y]=null;return a?oe:oe.toP()},"_wnafMulAdd");function di(t,e){this.curve=t,this.type=e,this.precomputed=null}o(di,"BasePoint");Cs.BasePoint=di;di.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");di.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Cs.prototype.decodePoint=o(function(e,r){e=du.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?Fh(e[e.length-1]%2===0):e[0]===7&&Fh(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 du.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 mu=De((FK,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((qK,w3)=>{"use strict";var xO=Ln(),ur=no(),Xm=mu(),$f=pu(),wO=xO.assert;function pi(t){$f.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,$f);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],wO(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),p=new ur(1),v,y,S,O,R,I,N,J=0,L,V;n.cmpn(0)!==0;){var Z=i.div(n);L=i.sub(Z.mul(n)),V=u.sub(Z.mul(a));var Y=p.sub(Z.mul(c));if(!S&&L.cmp(r)<0)v=N.neg(),y=a,S=L.neg(),O=V;else if(S&&++J===2)break;N=L,i=n,n=L,u=a,a=V,p=c,c=Y}R=L.neg(),I=V;var oe=S.sqr().add(O.sqr()),K=R.sqr().add(I.sqr());return K.cmp(oe)>=0&&(R=v,I=y),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:S,b:O},{a:R,b:I}]},"_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),p=c.mul(i.a),v=a.mul(n.b),y=c.mul(i.b),S=e.sub(u).sub(p),O=v.add(y).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]),p=e[c],v=p._getBeta();u.k1.negative&&(u.k1.ineg(),p=p.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=p,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return y},"_endoWnafMulAdd");function Sr(t,e,r,n){$f.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,$f.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){$f.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,$f.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)),p=i.redSub(a),v=c.redSub(u);if(p.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=p.redSqr(),S=y.redMul(p),O=i.redMul(y),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(c.redMul(S)),N=this.z.redMul(e.z).redMul(p);return this.curve.jpoint(R,I,N)},"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),p=a.redSub(c);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),y=v.redMul(u),S=n.redMul(v),O=p.redSqr().redIAdd(y).redISub(S).redISub(S),R=p.redMul(S.redISub(O)).redISub(a.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"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,p=this.z,v=p.redSqr().redSqr(),y=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=y.redSqr(),R=O.redSqr(),I=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),N=c.redMul(O),J=I.redSqr().redISub(N.redAdd(N)),L=N.redISub(J),V=I.redMul(L);V=V.redIAdd(V).redISub(R);var Z=y.redMul(p);r+1<e&&(v=v.redMul(R)),c=J,p=Z,y=V}return this.curve.jpoint(c,y.redMul(a),p)},"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 p=i.redAdd(i).redIAdd(i),v=p.redSqr().redISub(u).redISub(u),y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),e=v,r=p.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(S).redISub(R);I=I.redIAdd(I);var N=S.redAdd(S).redIAdd(S),J=N.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=J.redISub(I).redISub(I),r=N.redMul(I.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 p=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),v=p.redSqr().redISub(u).redISub(u);e=v;var y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),r=p.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(S).redMul(this.x.redAdd(S));I=I.redAdd(I).redIAdd(I);var N=R.redIAdd(R);N=N.redIAdd(N);var J=N.redAdd(N);e=I.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=I.redMul(N.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(),p=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var y=v.redMul(u),S=p.redSqr().redISub(y.redAdd(y)),O=y.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=p.redMul(O).redISub(R),N=n.redAdd(n).redMul(i);return this.curve.jpoint(S,I,N)},"_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 p=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var y=a.redIAdd(u).redSqr().redISub(c).redISub(p).redISub(v),S=r.redMul(y);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(p).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(v.redISub(y)).redISub(u.redMul(p)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(p);return this.curve.jpoint(O,R,I)},"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((HK,A3)=>{"use strict";var Ff=no(),E3=mu(),qh=pu(),_O=Ln();function qf(t){qh.call(this,"mont",t),this.a=new Ff(t.a,16).toRed(this.red),this.b=new Ff(t.b,16).toRed(this.red),this.i4=new Ff(4).toRed(this.red).redInvm(),this.two=new Ff(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(qf,"MontCurve");E3(qf,qh);A3.exports=qf;qf.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){qh.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Ff(e,16),this.z=new Ff(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,qh.BasePoint);qf.prototype.decodePoint=o(function(e,r){return this.point(_O.toArray(e,r),1)},"decodePoint");qf.prototype.point=o(function(e,r){return new Mr(this,e,r)},"point");qf.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),p=a.redMul(i),v=r.z.redMul(u.redAdd(p).redSqr()),y=r.x.redMul(u.redISub(p).redSqr());return this.curve.point(v,y)},"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((zK,T3)=>{"use strict";var EO=Ln(),Ho=no(),M3=mu(),Hh=pu(),AO=EO.assert;function io(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Hh.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),AO(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}o(io,"EdwardsCurve");M3(io,Hh);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 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 p=u.fromRed().isOdd();return(r&&!p||!r&&p)&&(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){Hh.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");M3(rr,Hh.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),p=i.redSub(r),v=a.redMul(u),y=c.redMul(p),S=a.redMul(p),O=u.redMul(c);return this.curve.point(v,y,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,p,v;if(this.curve.twisted){u=this.curve._mulA(r);var y=u.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(y.redSub(this.curve.two)),a=y.redMul(u.redSub(n)),c=y.redSqr().redSub(y).redSub(y)):(p=this.z.redSqr(),v=y.redSub(p).redISub(p),i=e.redSub(r).redISub(n).redMul(v),a=y.redMul(u.redSub(n)),c=y.redMul(v))}else u=r.redAdd(n),p=this.curve._mulC(this.z).redSqr(),v=u.redSub(p).redSub(p),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),p=a.redAdd(i),v=n.redAdd(r),y=c.redMul(u),S=p.redMul(v),O=c.redMul(v),R=u.redMul(p);return this.curve.point(y,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),p=n.redAdd(c),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),y=r.redMul(u).redMul(v),S,O;return this.curve.twisted?(S=r.redMul(p).redMul(a.redSub(this.curve._mulA(i))),O=u.redMul(p)):(S=r.redMul(p).redMul(a.redSub(i)),O=this.curve._mulC(u).redMul(p)),this.curve.point(y,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 zh=k3;zh.base=pu();zh.short=_3();zh.mont=S3();zh.edwards=C3()});var Bi=De(Qt=>{"use strict";var SO=Ms(),MO=mu();Qt.inherits=MO;function TO(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}o(TO,"isSurrogatePair");function CO(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):TO(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(CO,"toArray");Qt.toArray=CO;function kO(t){for(var e="",r=0;r<t.length;r++)e+=D3(t[r].toString(16));return e}o(kO,"toHex");Qt.toHex=kO;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 IO(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(IO,"toHex32");Qt.toHex32=IO;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 DO(t,e,r,n){var i=r-e;SO(i%4===0);for(var a=new Array(i/4),c=0,u=e;c<a.length;c++,u+=4){var p;n==="big"?p=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:p=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],a[c]=p>>>0}return a}o(DO,"join32");Qt.join32=DO;function OO(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(OO,"split32");Qt.split32=OO;function RO(t,e){return t>>>e|t<<32-e}o(RO,"rotr32");Qt.rotr32=RO;function NO(t,e){return t<<e|t>>>32-e}o(NO,"rotl32");Qt.rotl32=NO;function PO(t,e){return t+e>>>0}o(PO,"sum32");Qt.sum32=PO;function LO(t,e,r){return t+e+r>>>0}o(LO,"sum32_3");Qt.sum32_3=LO;function BO(t,e,r,n){return t+e+r+n>>>0}o(BO,"sum32_4");Qt.sum32_4=BO;function UO(t,e,r,n,i){return t+e+r+n+i>>>0}o(UO,"sum32_5");Qt.sum32_5=UO;function $O(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($O,"sum64");Qt.sum64=$O;function FO(t,e,r,n){var i=e+n>>>0,a=(i<e?1:0)+t+r;return a>>>0}o(FO,"sum64_hi");Qt.sum64_hi=FO;function qO(t,e,r,n){var i=e+n;return i>>>0}o(qO,"sum64_lo");Qt.sum64_lo=qO;function HO(t,e,r,n,i,a,c,u){var p=0,v=e;v=v+n>>>0,p+=v<e?1:0,v=v+a>>>0,p+=v<a?1:0,v=v+u>>>0,p+=v<u?1:0;var y=t+r+i+c+p;return y>>>0}o(HO,"sum64_4_hi");Qt.sum64_4_hi=HO;function zO(t,e,r,n,i,a,c,u){var p=e+n+a+u;return p>>>0}o(zO,"sum64_4_lo");Qt.sum64_4_lo=zO;function KO(t,e,r,n,i,a,c,u,p,v){var y=0,S=e;S=S+n>>>0,y+=S<e?1:0,S=S+a>>>0,y+=S<a?1:0,S=S+u>>>0,y+=S<u?1:0,S=S+v>>>0,y+=S<v?1:0;var O=t+r+i+c+p+y;return O>>>0}o(KO,"sum64_5_hi");Qt.sum64_5_hi=KO;function jO(t,e,r,n,i,a,c,u,p,v){var y=e+n+a+u+v;return y>>>0}o(jO,"sum64_5_lo");Qt.sum64_5_lo=jO;function GO(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}o(GO,"rotr64_hi");Qt.rotr64_hi=GO;function VO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(VO,"rotr64_lo");Qt.rotr64_lo=VO;function WO(t,e,r){return t>>>r}o(WO,"shr64_hi");Qt.shr64_hi=WO;function JO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(JO,"shr64_lo");Qt.shr64_lo=JO});var Hf=De(N3=>{"use strict";var R3=Bi(),YO=Ms();function Kh(){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(Kh,"BlockHash");N3.BlockHash=Kh;Kh.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");Kh.prototype.digest=o(function(e){return this.update(this._pad()),YO(this.pending===null),this._digest(e)},"digest");Kh.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(zo=>{"use strict";var XO=Bi(),oo=XO.rotr32;function ZO(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(ZO,"ft_1");zo.ft_1=ZO;function P3(t,e,r){return t&e^~t&r}o(P3,"ch32");zo.ch32=P3;function L3(t,e,r){return t&e^t&r^e&r}o(L3,"maj32");zo.maj32=L3;function B3(t,e,r){return t^e^r}o(B3,"p32");zo.p32=B3;function QO(t){return oo(t,2)^oo(t,13)^oo(t,22)}o(QO,"s0_256");zo.s0_256=QO;function eR(t){return oo(t,6)^oo(t,11)^oo(t,25)}o(eR,"s1_256");zo.s1_256=eR;function tR(t){return oo(t,7)^oo(t,18)^t>>>3}o(tR,"g0_256");zo.g0_256=tR;function rR(t){return oo(t,17)^oo(t,19)^t>>>10}o(rR,"g1_256");zo.g1_256=rR});var F3=De((WK,$3)=>{"use strict";var zf=Bi(),nR=Hf(),iR=Qm(),e1=zf.rotl32,bu=zf.sum32,oR=zf.sum32_5,sR=iR.ft_1,U3=nR.BlockHash,aR=[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");zf.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],p=this.h[3],v=this.h[4];for(i=0;i<n.length;i++){var y=~~(i/20),S=oR(e1(a,5),sR(y,c,u,p),v,n[i],aR[y]);v=p,p=u,u=e1(c,30),c=a,a=S}this.h[0]=bu(this.h[0],a),this.h[1]=bu(this.h[1],c),this.h[2]=bu(this.h[2],u),this.h[3]=bu(this.h[3],p),this.h[4]=bu(this.h[4],v)},"_update");so.prototype._digest=o(function(e){return e==="hex"?zf.toHex32(this.h,"big"):zf.split32(this.h,"big")},"digest")});var t1=De((JK,H3)=>{"use strict";var Kf=Bi(),fR=Hf(),jf=Qm(),cR=Ms(),Ui=Kf.sum32,uR=Kf.sum32_4,lR=Kf.sum32_5,hR=jf.ch32,dR=jf.maj32,pR=jf.s0_256,mR=jf.s1_256,bR=jf.g0_256,gR=jf.g1_256,q3=fR.BlockHash,vR=[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=vR,this.W=new Array(64)}o(ao,"SHA256");Kf.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]=uR(gR(n[i-2]),n[i-7],bR(n[i-15]),n[i-16]);var a=this.h[0],c=this.h[1],u=this.h[2],p=this.h[3],v=this.h[4],y=this.h[5],S=this.h[6],O=this.h[7];for(cR(this.k.length===n.length),i=0;i<n.length;i++){var R=lR(O,mR(v),hR(v,y,S),this.k[i],n[i]),I=Ui(pR(a),dR(a,c,u));O=S,S=y,y=v,v=Ui(p,R),p=u,u=c,c=a,a=Ui(R,I)}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],p),this.h[4]=Ui(this.h[4],v),this.h[5]=Ui(this.h[5],y),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"?Kf.toHex32(this.h,"big"):Kf.split32(this.h,"big")},"digest")});var j3=De((YK,K3)=>{"use strict";var r1=Bi(),z3=t1();function Ko(){if(!(this instanceof Ko))return new Ko;z3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(Ko,"SHA224");r1.inherits(Ko,z3);K3.exports=Ko;Ko.blockSize=512;Ko.outSize=224;Ko.hmacStrength=192;Ko.padLength=64;Ko.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((XK,J3)=>{"use strict";var vn=Bi(),yR=Hf(),xR=Ms(),fo=vn.rotr64_hi,co=vn.rotr64_lo,G3=vn.shr64_hi,V3=vn.shr64_lo,ks=vn.sum64,n1=vn.sum64_hi,i1=vn.sum64_lo,wR=vn.sum64_4_hi,_R=vn.sum64_4_lo,ER=vn.sum64_5_hi,AR=vn.sum64_5_lo,W3=yR.BlockHash,SR=[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=SR,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=LR(n[i-4],n[i-3]),c=BR(n[i-4],n[i-3]),u=n[i-14],p=n[i-13],v=NR(n[i-30],n[i-29]),y=PR(n[i-30],n[i-29]),S=n[i-32],O=n[i-31];n[i]=wR(a,c,u,p,v,y,S,O),n[i+1]=_R(a,c,u,p,v,y,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],p=this.h[4],v=this.h[5],y=this.h[6],S=this.h[7],O=this.h[8],R=this.h[9],I=this.h[10],N=this.h[11],J=this.h[12],L=this.h[13],V=this.h[14],Z=this.h[15];xR(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var oe=V,K=Z,q=OR(O,R),j=RR(O,R),le=MR(O,R,I,N,J,L),T=TR(O,R,I,N,J,L),h=this.k[Y],x=this.k[Y+1],b=n[Y],l=n[Y+1],m=ER(oe,K,q,j,le,T,h,x,b,l),_=AR(oe,K,q,j,le,T,h,x,b,l);oe=IR(i,a),K=DR(i,a),q=CR(i,a,c,u,p,v),j=kR(i,a,c,u,p,v);var A=n1(oe,K,q,j),E=i1(oe,K,q,j);V=J,Z=L,J=I,L=N,I=O,N=R,O=n1(y,S,m,_),R=i1(S,S,m,_),y=p,S=v,p=c,v=u,c=i,u=a,i=n1(m,_,A,E),a=i1(m,_,A,E)}ks(this.h,0,i,a),ks(this.h,2,c,u),ks(this.h,4,p,v),ks(this.h,6,y,S),ks(this.h,8,O,R),ks(this.h,10,I,N),ks(this.h,12,J,L),ks(this.h,14,V,Z)},"_update");$i.prototype._digest=o(function(e){return e==="hex"?vn.toHex32(this.h,"big"):vn.split32(this.h,"big")},"digest");function MR(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}o(MR,"ch64_hi");function TR(t,e,r,n,i,a){var c=e&n^~e&a;return c<0&&(c+=4294967296),c}o(TR,"ch64_lo");function CR(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}o(CR,"maj64_hi");function kR(t,e,r,n,i,a){var c=e&n^e&a^n&a;return c<0&&(c+=4294967296),c}o(kR,"maj64_lo");function IR(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(IR,"s0_512_hi");function DR(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(DR,"s0_512_lo");function OR(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(OR,"s1_512_hi");function RR(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(RR,"s1_512_lo");function NR(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(NR,"g0_512_hi");function PR(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(PR,"g0_512_lo");function LR(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(LR,"g1_512_hi");function BR(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(BR,"g1_512_lo")});var Z3=De((ZK,X3)=>{"use strict";var s1=Bi(),Y3=o1();function jo(){if(!(this instanceof jo))return new jo;Y3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(jo,"SHA384");s1.inherits(jo,Y3);X3.exports=jo;jo.blockSize=1024;jo.outSize=384;jo.hmacStrength=192;jo.padLength=128;jo.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(Gf=>{"use strict";Gf.sha1=F3();Gf.sha224=j3();Gf.sha256=t1();Gf.sha384=Z3();Gf.sha512=o1()});var o6=De(i6=>{"use strict";var Ma=Bi(),UR=Hf(),jh=Ma.rotl32,e6=Ma.sum32,gu=Ma.sum32_3,t6=Ma.sum32_4,n6=UR.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");Ma.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],p=n,v=i,y=a,S=c,O=u,R=0;R<80;R++){var I=e6(jh(t6(n,r6(R,i,a,c),e[qR[R]+r],$R(R)),zR[R]),u);n=u,u=c,c=jh(a,10),a=i,i=I,I=e6(jh(t6(p,r6(79-R,v,y,S),e[HR[R]+r],FR(R)),KR[R]),O),p=O,O=S,S=jh(y,10),y=v,v=I}I=gu(this.h[1],a,S),this.h[1]=gu(this.h[2],c,O),this.h[2]=gu(this.h[3],u,p),this.h[3]=gu(this.h[4],n,v),this.h[4]=gu(this.h[0],i,y),this.h[0]=I},"update");uo.prototype._digest=o(function(e){return e==="hex"?Ma.toHex32(this.h,"little"):Ma.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 $R(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}o($R,"K");function FR(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}o(FR,"Kh");var qR=[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],HR=[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],zR=[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],KR=[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((tj,s6)=>{"use strict";var jR=Bi(),GR=Ms();function Vf(t,e,r){if(!(this instanceof Vf))return new Vf(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(jR.toArray(e,r))}o(Vf,"Hmac");s6.exports=Vf;Vf.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),GR(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");Vf.prototype.update=o(function(e,r){return this.inner.update(e,r),this},"update");Vf.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var vu=De(f6=>{var Br=f6;Br.utils=Bi();Br.common=Hf();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((nj,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 Gh=De(d6=>{"use strict";var f1=d6,Is=vu(),a1=Zm(),VR=Ln(),l6=VR.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 Ds(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(Ds,"defineCurve");Ds("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:Is.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Ds("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:Is.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Ds("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:Is.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Ds("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:Is.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"]});Ds("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:Is.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"]});Ds("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Is.sha256,gRed:!1,g:["9"]});Ds("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:Is.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c1;try{c1=u6()}catch{c1=void 0}Ds("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:Is.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c1]})});var b6=De((oj,m6)=>{"use strict";var WR=vu(),Ta=jm(),p6=Ms();function Os(t){if(!(this instanceof Os))return new Os(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=Ta.toArray(t.entropy,t.entropyEnc||"hex"),r=Ta.toArray(t.nonce,t.nonceEnc||"hex"),n=Ta.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(Os,"HmacDRBG");m6.exports=Os;Os.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");Os.prototype._hmac=o(function(){return new WR.hmac(this.hash,this.K)},"hmac");Os.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");Os.prototype.reseed=o(function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Ta.toArray(e,r),n=Ta.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");Os.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=Ta.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++,Ta.encode(c,r)},"generate")});var v6=De((sj,g6)=>{"use strict";var JR=no(),YR=Ln(),u1=YR.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 JR(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((aj,x6)=>{"use strict";var Vh=no(),d1=Ln(),XR=d1.assert;function Wh(t,e){if(t instanceof Wh)return t;this._importDER(t,e)||(XR(t.r&&t.s,"Signature without r or s"),this.r=new Vh(t.r,16),this.s=new Vh(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Wh,"Signature");x6.exports=Wh;function ZR(){this.place=0}o(ZR,"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");Wh.prototype._importDER=o(function(e,r){e=d1.toArray(e,r);var n=new ZR;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 p=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(p[0]===0)if(p[1]&128)p=p.slice(1);else return!1;return this.r=new Vh(c),this.s=new Vh(p),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");Wh.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((fj,A6)=>{"use strict";var Ca=no(),_6=b6(),QR=Ln(),p1=Gh(),eN=Jm(),E6=QR.assert,m1=v6(),Jh=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||eN(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ca(2));;){var a=new Ca(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 Ca(e,16));for(var a=this.n.byteLength(),c=r.getPrivate().toArray("be",a),u=e.toArray("be",a),p=new _6({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new Ca(1)),y=0;;y++){var S=i.k?i.k(y):new Ca(p.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(),I=R.umod(this.n);if(I.cmpn(0)!==0){var N=S.invm(this.n).mul(I.mul(r.getPrivate()).iadd(e));if(N=N.umod(this.n),N.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),J^=1),new Jh({r:I,s:N,recoveryParam:J})}}}}}},"sign");mi.prototype.verify=o(function(e,r,n,i){e=this._truncateToN(new Ca(e,16)),n=this.keyFromPublic(n,i),r=new Jh(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),p=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(p,n.getPublic(),v),y.isInfinity()?!1:y.eqXToP(a)):(y=this.g.mulAdd(p,n.getPublic(),v),y.isInfinity()?!1:y.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 Jh(e,n);var i=this.n,a=new Ca(t),c=e.r,u=e.s,p=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),p):c=this.curve.pointFromX(c,p);var y=e.r.invm(i),S=i.sub(a).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(S,c,O)};mi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Jh(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((cj,C6)=>{"use strict";var yu=Ln(),T6=yu.assert,M6=yu.parseBytes,Wf=yu.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");Wf(Tr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));Wf(Tr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));Wf(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"));Wf(Tr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));Wf(Tr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));Wf(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"),yu.encode(this.secret(),e)},"getSecret");Tr.prototype.getPublic=o(function(e){return yu.encode(this.pubBytes(),e)},"getPublic");C6.exports=Tr});var D6=De((uj,I6)=>{"use strict";var tN=no(),Yh=Ln(),rN=Yh.assert,Xh=Yh.cachedProperty,nN=Yh.parseBytes;function ka(t,e){this.eddsa=t,typeof e!="object"&&(e=nN(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),rN(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof tN&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(ka,"Signature");Xh(ka,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));Xh(ka,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));Xh(ka,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));Xh(ka,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));ka.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");ka.prototype.toHex=o(function(){return Yh.encode(this.toBytes(),"hex").toUpperCase()},"toHex");I6.exports=ka});var L6=De((lj,P6)=>{"use strict";var iN=vu(),oN=Gh(),Jf=Ln(),sN=Jf.assert,R6=Jf.parseBytes,N6=k6(),O6=D6();function yn(t){if(sN(t==="ed25519","only tested with ed25519 so far"),!(this instanceof yn))return new yn(t);t=oN[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=iN.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()),p=i.add(u).umod(this.curve.n);return this.makeSignature({R:a,S:p,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 Jf.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=Jf.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,a=Jf.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 Jf.intFromLE(e)},"decodeInt");yn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var U6=De(B6=>{"use strict";var Ia=B6;Ia.version=h3().version;Ia.utils=Ln();Ia.rand=Jm();Ia.curve=Zm();Ia.curves=Gh();Ia.ec=S6();Ia.eddsa=L6()});var F6=De(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.BrowserRandomSource=void 0;var $6=65536,Zh=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(Zh,"BrowserRandomSource");Qh.BrowserRandomSource=Zh});var q6=De(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.NodeRandomSource=void 0;var aN=hi(),ed=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,aN.wipe)(r),n}};o(ed,"NodeRandomSource");td.NodeRandomSource=ed});var H6=De(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.SystemRandomSource=void 0;var fN=F6(),cN=q6(),rd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new fN.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new cN.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(rd,"SystemRandomSource");nd.SystemRandomSource=rd});var Da=De(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.randomStringForEntropy=Vr.randomString=Vr.randomUint32=Vr.randomBytes=Vr.defaultRandomSource=void 0;var uN=H6(),lN=Aa(),z6=hi();Vr.defaultRandomSource=new uN.SystemRandomSource;function b1(t,e=Vr.defaultRandomSource){return e.randomBytes(t)}o(b1,"randomBytes");Vr.randomBytes=b1;function hN(t=Vr.defaultRandomSource){let e=b1(4,t),r=(0,lN.readUint32LE)(e);return(0,z6.wipe)(e),r}o(hN,"randomUint32");Vr.randomUint32=hN;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 p=c[u];p<a&&(n+=e.charAt(p%i),t--)}(0,z6.wipe)(c)}return n}o(j6,"randomString");Vr.randomString=j6;function dN(t,e=K6,r=Vr.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return j6(n,e,r)}o(dN,"randomStringForEntropy");Vr.randomStringForEntropy=dN});var W6=De(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var Xf=Aa(),Yf=hi();Go.DIGEST_LENGTH=64;Go.BLOCK_SIZE=128;var V6=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(){Yf.wipe(this._buffer),Yf.wipe(this._tempHi),Yf.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&&(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;Xf.writeUint32BE(i,this._buffer,c-8),Xf.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++)Xf.writeUint32BE(this._stateHi[u],e,u*8),Xf.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){Yf.wipe(e.stateHi),Yf.wipe(e.stateLo),e.buffer&&Yf.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Go.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],p=r[1],v=r[2],y=r[3],S=r[4],O=r[5],R=r[6],I=r[7],N=n[0],J=n[1],L=n[2],V=n[3],Z=n[4],Y=n[5],oe=n[6],K=n[7],q,j,le,T,h,x,b,l;c>=128;){for(var m=0;m<16;m++){var _=8*m+a;t[m]=Xf.readUint32BE(i,_),e[m]=Xf.readUint32BE(i,_+4)}for(var m=0;m<80;m++){var A=u,E=p,g=v,C=y,P=S,w=O,k=R,he=I,D=N,Q=J,se=L,F=V,$=Z,ee=Y,ne=oe,ae=K;if(q=I,j=K,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=(S>>>14|Z<<32-14)^(S>>>18|Z<<32-18)^(Z>>>41-32|S<<32-(41-32)),j=(Z>>>14|S<<32-14)^(Z>>>18|S<<32-18)^(S>>>41-32|Z<<32-(41-32)),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=S&O^~S&R,j=Z&Y^~Z&oe,h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=G6[m*2],j=G6[m*2+1],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=t[m%16],j=e[m%16],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,le=b&65535|l<<16,T=h&65535|x<<16,q=le,j=T,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=(u>>>28|N<<32-28)^(N>>>34-32|u<<32-(34-32))^(N>>>39-32|u<<32-(39-32)),j=(N>>>28|u<<32-28)^(u>>>34-32|N<<32-(34-32))^(u>>>39-32|N<<32-(39-32)),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,q=u&p^u&v^p&v,j=N&J^N&L^J&L,h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,he=b&65535|l<<16,ae=h&65535|x<<16,q=C,j=F,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=le,j=T,h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,C=b&65535|l<<16,F=h&65535|x<<16,p=A,v=E,y=g,S=C,O=P,R=w,I=k,u=he,J=D,L=Q,V=se,Z=F,Y=$,oe=ee,K=ne,N=ae,m%16===15)for(var _=0;_<16;_++)q=t[_],j=e[_],h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=t[(_+9)%16],j=e[(_+9)%16],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,le=t[(_+1)%16],T=e[(_+1)%16],q=(le>>>1|T<<32-1)^(le>>>8|T<<32-8)^le>>>7,j=(T>>>1|le<<32-1)^(T>>>8|le<<32-8)^(T>>>7|le<<32-7),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,le=t[(_+14)%16],T=e[(_+14)%16],q=(le>>>19|T<<32-19)^(T>>>61-32|le<<32-(61-32))^le>>>6,j=(T>>>19|le<<32-19)^(le>>>61-32|T<<32-(61-32))^(T>>>6|le<<32-6),h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,t[_]=b&65535|l<<16,e[_]=h&65535|x<<16}q=u,j=N,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[0],j=n[0],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[0]=u=b&65535|l<<16,n[0]=N=h&65535|x<<16,q=p,j=J,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[1],j=n[1],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[1]=p=b&65535|l<<16,n[1]=J=h&65535|x<<16,q=v,j=L,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[2],j=n[2],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[2]=v=b&65535|l<<16,n[2]=L=h&65535|x<<16,q=y,j=V,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[3],j=n[3],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[3]=y=b&65535|l<<16,n[3]=V=h&65535|x<<16,q=S,j=Z,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[4],j=n[4],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[4]=S=b&65535|l<<16,n[4]=Z=h&65535|x<<16,q=O,j=Y,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[5],j=n[5],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[5]=O=b&65535|l<<16,n[5]=Y=h&65535|x<<16,q=R,j=oe,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[6],j=n[6],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[6]=R=b&65535|l<<16,n[6]=oe=h&65535|x<<16,q=I,j=K,h=j&65535,x=j>>>16,b=q&65535,l=q>>>16,q=r[7],j=n[7],h+=j&65535,x+=j>>>16,b+=q&65535,l+=q>>>16,x+=h>>>16,b+=x>>>16,l+=b>>>16,r[7]=I=b&65535|l<<16,n[7]=K=h&65535|x<<16,a+=128,c-=128}return a}o(g1,"hashBlocks");function pN(t){var e=new V6;e.update(t);var r=e.digest();return e.clean(),r}o(pN,"hash");Go.hash=pN});var _u=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 mN=Da(),xu=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 bN=new Uint8Array(32);bN[0]=9;var x1=Ge(),Zf=Ge([1]),gN=Ge([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),vN=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]),yN=Ge([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Rs(t,e){for(let r=0;r<16;r++)t[r]=e[r]|0}o(Rs,"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 wu(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(wu,"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 wu(r,t),wu(n,e),tx(r,n)}o(X6,"neq25519");function rx(t){let e=new Uint8Array(32);return wu(e,t),e[0]&1}o(rx,"par25519");function xN(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(xN,"unpack25519");function Oa(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(Oa,"add");function Na(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(Na,"sub");function Yt(t,e,r){let n,i,a=0,c=0,u=0,p=0,v=0,y=0,S=0,O=0,R=0,I=0,N=0,J=0,L=0,V=0,Z=0,Y=0,oe=0,K=0,q=0,j=0,le=0,T=0,h=0,x=0,b=0,l=0,m=0,_=0,A=0,E=0,g=0,C=r[0],P=r[1],w=r[2],k=r[3],he=r[4],D=r[5],Q=r[6],se=r[7],F=r[8],$=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*P,u+=n*w,p+=n*k,v+=n*he,y+=n*D,S+=n*Q,O+=n*se,R+=n*F,I+=n*$,N+=n*ee,J+=n*ne,L+=n*ae,V+=n*Ae,Z+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*P,p+=n*w,v+=n*k,y+=n*he,S+=n*D,O+=n*Q,R+=n*se,I+=n*F,N+=n*$,J+=n*ee,L+=n*ne,V+=n*ae,Z+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,p+=n*P,v+=n*w,y+=n*k,S+=n*he,O+=n*D,R+=n*Q,I+=n*se,N+=n*F,J+=n*$,L+=n*ee,V+=n*ne,Z+=n*ae,Y+=n*Ae,oe+=n*ge,K+=n*re,n=e[3],p+=n*C,v+=n*P,y+=n*w,S+=n*k,O+=n*he,R+=n*D,I+=n*Q,N+=n*se,J+=n*F,L+=n*$,V+=n*ee,Z+=n*ne,Y+=n*ae,oe+=n*Ae,K+=n*ge,q+=n*re,n=e[4],v+=n*C,y+=n*P,S+=n*w,O+=n*k,R+=n*he,I+=n*D,N+=n*Q,J+=n*se,L+=n*F,V+=n*$,Z+=n*ee,Y+=n*ne,oe+=n*ae,K+=n*Ae,q+=n*ge,j+=n*re,n=e[5],y+=n*C,S+=n*P,O+=n*w,R+=n*k,I+=n*he,N+=n*D,J+=n*Q,L+=n*se,V+=n*F,Z+=n*$,Y+=n*ee,oe+=n*ne,K+=n*ae,q+=n*Ae,j+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*P,R+=n*w,I+=n*k,N+=n*he,J+=n*D,L+=n*Q,V+=n*se,Z+=n*F,Y+=n*$,oe+=n*ee,K+=n*ne,q+=n*ae,j+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*P,I+=n*w,N+=n*k,J+=n*he,L+=n*D,V+=n*Q,Z+=n*se,Y+=n*F,oe+=n*$,K+=n*ee,q+=n*ne,j+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,I+=n*P,N+=n*w,J+=n*k,L+=n*he,V+=n*D,Z+=n*Q,Y+=n*se,oe+=n*F,K+=n*$,q+=n*ee,j+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,x+=n*re,n=e[9],I+=n*C,N+=n*P,J+=n*w,L+=n*k,V+=n*he,Z+=n*D,Y+=n*Q,oe+=n*se,K+=n*F,q+=n*$,j+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,x+=n*ge,b+=n*re,n=e[10],N+=n*C,J+=n*P,L+=n*w,V+=n*k,Z+=n*he,Y+=n*D,oe+=n*Q,K+=n*se,q+=n*F,j+=n*$,le+=n*ee,T+=n*ne,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,L+=n*P,V+=n*w,Z+=n*k,Y+=n*he,oe+=n*D,K+=n*Q,q+=n*se,j+=n*F,le+=n*$,T+=n*ee,h+=n*ne,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*re,n=e[12],L+=n*C,V+=n*P,Z+=n*w,Y+=n*k,oe+=n*he,K+=n*D,q+=n*Q,j+=n*se,le+=n*F,T+=n*$,h+=n*ee,x+=n*ne,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*re,n=e[13],V+=n*C,Z+=n*P,Y+=n*w,oe+=n*k,K+=n*he,q+=n*D,j+=n*Q,le+=n*se,T+=n*F,h+=n*$,x+=n*ee,b+=n*ne,l+=n*ae,m+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Z+=n*C,Y+=n*P,oe+=n*w,K+=n*k,q+=n*he,j+=n*D,le+=n*Q,T+=n*se,h+=n*F,x+=n*$,b+=n*ee,l+=n*ne,m+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*P,K+=n*w,q+=n*k,j+=n*he,le+=n*D,T+=n*Q,h+=n*se,x+=n*F,b+=n*$,l+=n*ee,m+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*K,u+=38*q,p+=38*j,v+=38*le,y+=38*T,S+=38*h,O+=38*x,R+=38*b,I+=38*l,N+=38*m,J+=38*_,L+=38*A,V+=38*E,Z+=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=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=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=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=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=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=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=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=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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]=p,t[4]=v,t[5]=y,t[6]=S,t[7]=O,t[8]=R,t[9]=I,t[10]=N,t[11]=J,t[12]=L,t[13]=V,t[14]=Z,t[15]=Y}o(Yt,"mul");function Ra(t,e){Yt(t,e,e)}o(Ra,"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--)Ra(r,r),n!==2&&n!==4&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(nx,"inv25519");function wN(t,e){let r=Ge(),n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)Ra(r,r),n!==1&&Yt(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}o(wN,"pow2523");function w1(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),p=Ge(),v=Ge(),y=Ge();Na(r,t[1],t[0]),Na(y,e[1],e[0]),Yt(r,r,y),Oa(n,t[0],t[1]),Oa(y,e[0],e[1]),Yt(n,n,y),Yt(i,t[3],e[3]),Yt(i,i,vN),Yt(a,t[2],e[2]),Oa(a,a,a),Na(c,n,r),Na(u,a,i),Oa(p,a,i),Oa(v,n,r),Yt(t[0],c,u),Yt(t[1],v,p),Yt(t[2],p,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),wu(t,n),t[31]^=rx(r)<<7}o(E1,"pack");function ix(t,e,r){Rs(t[0],x1),Rs(t[1],Zf),Rs(t[2],Zf),Rs(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()];Rs(r[0],J6),Rs(r[1],Y6),Rs(r[2],Zf),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,xu.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 _N(t){let e=(0,mN.randomBytes)(32,t),r=ox(e);return(0,Q6.wipe)(e),r}o(_N,"generateKeyPair");Gt.generateKeyPair=_N;function EN(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(EN,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=EN;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 AN(t,e){let r=new Float64Array(64),n=[Ge(),Ge(),Ge(),Ge()],i=(0,xu.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 xu.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 p=c.digest();_1(p);for(let v=0;v<32;v++)r[v]=u[v];for(let v=0;v<32;v++)for(let y=0;y<32;y++)r[v+y]+=p[v]*i[y];return sx(a.subarray(32),r),a}o(AN,"sign");Gt.sign=AN;function ax(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),p=Ge();return Rs(t[2],Zf),xN(t[1],e),Ra(i,t[1]),Yt(a,i,gN),Na(i,i,t[2]),Oa(a,t[2],a),Ra(c,a),Ra(u,c),Yt(p,u,c),Yt(r,p,i),Yt(r,r,a),wN(r,r),Yt(r,r,i),Yt(r,r,a),Yt(r,r,a),Yt(t[0],r,a),Ra(n,t[0]),Yt(n,n,a),X6(n,i)&&Yt(t[0],t[0],yN),Ra(n,t[0]),Yt(n,n,a),X6(n,i)?-1:(rx(t[0])===e[31]>>7&&Na(t[0],x1,t[0]),Yt(t[3],t[0],t[1]),0)}o(ax,"unpackneg");function SN(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 xu.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(SN,"verify");Gt.verify=SN;function MN(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];Oa(r,Zf,i),Na(n,Zf,i),nx(n,n),Yt(r,r,n);let a=new Uint8Array(32);return wu(a,r),a}o(MN,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=MN;function TN(t){let e=(0,xu.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(TN,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=TN});var cx=De((yj,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 CN=Da(),kN=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 IN=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 Eu(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(Eu,"sel25519");function DN(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,Eu(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(DN,"pack25519");function ON(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(ON,"unpack25519");function id(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(id,"add");function od(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(od,"sub");function Vo(t,e,r){let n,i,a=0,c=0,u=0,p=0,v=0,y=0,S=0,O=0,R=0,I=0,N=0,J=0,L=0,V=0,Z=0,Y=0,oe=0,K=0,q=0,j=0,le=0,T=0,h=0,x=0,b=0,l=0,m=0,_=0,A=0,E=0,g=0,C=r[0],P=r[1],w=r[2],k=r[3],he=r[4],D=r[5],Q=r[6],se=r[7],F=r[8],$=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*P,u+=n*w,p+=n*k,v+=n*he,y+=n*D,S+=n*Q,O+=n*se,R+=n*F,I+=n*$,N+=n*ee,J+=n*ne,L+=n*ae,V+=n*Ae,Z+=n*ge,Y+=n*re,n=e[1],c+=n*C,u+=n*P,p+=n*w,v+=n*k,y+=n*he,S+=n*D,O+=n*Q,R+=n*se,I+=n*F,N+=n*$,J+=n*ee,L+=n*ne,V+=n*ae,Z+=n*Ae,Y+=n*ge,oe+=n*re,n=e[2],u+=n*C,p+=n*P,v+=n*w,y+=n*k,S+=n*he,O+=n*D,R+=n*Q,I+=n*se,N+=n*F,J+=n*$,L+=n*ee,V+=n*ne,Z+=n*ae,Y+=n*Ae,oe+=n*ge,K+=n*re,n=e[3],p+=n*C,v+=n*P,y+=n*w,S+=n*k,O+=n*he,R+=n*D,I+=n*Q,N+=n*se,J+=n*F,L+=n*$,V+=n*ee,Z+=n*ne,Y+=n*ae,oe+=n*Ae,K+=n*ge,q+=n*re,n=e[4],v+=n*C,y+=n*P,S+=n*w,O+=n*k,R+=n*he,I+=n*D,N+=n*Q,J+=n*se,L+=n*F,V+=n*$,Z+=n*ee,Y+=n*ne,oe+=n*ae,K+=n*Ae,q+=n*ge,j+=n*re,n=e[5],y+=n*C,S+=n*P,O+=n*w,R+=n*k,I+=n*he,N+=n*D,J+=n*Q,L+=n*se,V+=n*F,Z+=n*$,Y+=n*ee,oe+=n*ne,K+=n*ae,q+=n*Ae,j+=n*ge,le+=n*re,n=e[6],S+=n*C,O+=n*P,R+=n*w,I+=n*k,N+=n*he,J+=n*D,L+=n*Q,V+=n*se,Z+=n*F,Y+=n*$,oe+=n*ee,K+=n*ne,q+=n*ae,j+=n*Ae,le+=n*ge,T+=n*re,n=e[7],O+=n*C,R+=n*P,I+=n*w,N+=n*k,J+=n*he,L+=n*D,V+=n*Q,Z+=n*se,Y+=n*F,oe+=n*$,K+=n*ee,q+=n*ne,j+=n*ae,le+=n*Ae,T+=n*ge,h+=n*re,n=e[8],R+=n*C,I+=n*P,N+=n*w,J+=n*k,L+=n*he,V+=n*D,Z+=n*Q,Y+=n*se,oe+=n*F,K+=n*$,q+=n*ee,j+=n*ne,le+=n*ae,T+=n*Ae,h+=n*ge,x+=n*re,n=e[9],I+=n*C,N+=n*P,J+=n*w,L+=n*k,V+=n*he,Z+=n*D,Y+=n*Q,oe+=n*se,K+=n*F,q+=n*$,j+=n*ee,le+=n*ne,T+=n*ae,h+=n*Ae,x+=n*ge,b+=n*re,n=e[10],N+=n*C,J+=n*P,L+=n*w,V+=n*k,Z+=n*he,Y+=n*D,oe+=n*Q,K+=n*se,q+=n*F,j+=n*$,le+=n*ee,T+=n*ne,h+=n*ae,x+=n*Ae,b+=n*ge,l+=n*re,n=e[11],J+=n*C,L+=n*P,V+=n*w,Z+=n*k,Y+=n*he,oe+=n*D,K+=n*Q,q+=n*se,j+=n*F,le+=n*$,T+=n*ee,h+=n*ne,x+=n*ae,b+=n*Ae,l+=n*ge,m+=n*re,n=e[12],L+=n*C,V+=n*P,Z+=n*w,Y+=n*k,oe+=n*he,K+=n*D,q+=n*Q,j+=n*se,le+=n*F,T+=n*$,h+=n*ee,x+=n*ne,b+=n*ae,l+=n*Ae,m+=n*ge,_+=n*re,n=e[13],V+=n*C,Z+=n*P,Y+=n*w,oe+=n*k,K+=n*he,q+=n*D,j+=n*Q,le+=n*se,T+=n*F,h+=n*$,x+=n*ee,b+=n*ne,l+=n*ae,m+=n*Ae,_+=n*ge,A+=n*re,n=e[14],Z+=n*C,Y+=n*P,oe+=n*w,K+=n*k,q+=n*he,j+=n*D,le+=n*Q,T+=n*se,h+=n*F,x+=n*$,b+=n*ee,l+=n*ne,m+=n*ae,_+=n*Ae,A+=n*ge,E+=n*re,n=e[15],Y+=n*C,oe+=n*P,K+=n*w,q+=n*k,j+=n*he,le+=n*D,T+=n*Q,h+=n*se,x+=n*F,b+=n*$,l+=n*ee,m+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*K,u+=38*q,p+=38*j,v+=38*le,y+=38*T,S+=38*h,O+=38*x,R+=38*b,I+=38*l,N+=38*m,J+=38*_,L+=38*A,V+=38*E,Z+=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=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=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=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=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=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=I+i+65535,i=Math.floor(n/65536),I=n-i*65536,n=N+i+65535,i=Math.floor(n/65536),N=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=V+i+65535,i=Math.floor(n/65536),V=n-i*65536,n=Z+i+65535,i=Math.floor(n/65536),Z=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]=p,t[4]=v,t[5]=y,t[6]=S,t[7]=O,t[8]=R,t[9]=I,t[10]=N,t[11]=J,t[12]=L,t[13]=V,t[14]=Z,t[15]=Y}o(Vo,"mul");function Au(t,e){Vo(t,e,e)}o(Au,"square");function RN(t,e){let r=lo();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)Au(r,r),n!==2&&n!==4&&Vo(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}o(RN,"inv25519");function M1(t,e){let r=new Uint8Array(32),n=new Float64Array(80),i=lo(),a=lo(),c=lo(),u=lo(),p=lo(),v=lo();for(let R=0;R<31;R++)r[R]=t[R];r[31]=t[31]&127|64,r[0]&=248,ON(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 I=r[R>>>3]>>>(R&7)&1;Eu(i,a,I),Eu(c,u,I),id(p,i,c),od(i,i,c),id(c,a,u),od(a,a,u),Au(u,p),Au(v,i),Vo(i,c,i),Vo(c,a,p),id(p,i,c),od(i,i,c),Au(a,i),od(c,u,v),Vo(i,c,IN),id(i,i,u),Vo(c,c,i),Vo(i,u,v),Vo(u,a,n),Au(a,p),Eu(i,a,I),Eu(c,u,I)}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 y=n.subarray(32),S=n.subarray(16);RN(y,y),Vo(S,S,y);let O=new Uint8Array(32);return DN(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 NN(t){let e=(0,CN.randomBytes)(32,t),r=hx(e);return(0,kN.wipe)(e),r}o(NN,"generateKeyPair");lr.generateKeyPair=NN;function PN(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(PN,"sharedKey");lr.sharedKey=PN});var C1=De(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var Wr=Aa(),T1=hi(),LN=20;function BN(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],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],v=r[11]<<24|r[10]<<16|r[9]<<8|r[8],y=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],I=r[31]<<24|r[30]<<16|r[29]<<8|r[28],N=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],V=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Z=n,Y=i,oe=a,K=c,q=u,j=p,le=v,T=y,h=S,x=O,b=R,l=I,m=N,_=J,A=L,E=V,g=0;g<LN;g+=2)Z=Z+q|0,m^=Z,m=m>>>32-16|m<<16,h=h+m|0,q^=h,q=q>>>32-12|q<<12,Y=Y+j|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,j^=x,j=j>>>32-12|j<<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,K=K+T|0,E^=K,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,K=K+T|0,E^=K,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+j|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,j^=x,j=j>>>32-7|j<<7,Z=Z+q|0,m^=Z,m=m>>>32-8|m<<8,h=h+m|0,q^=h,q=q>>>32-7|q<<7,Z=Z+j|0,E^=Z,E=E>>>32-16|E<<16,b=b+E|0,j^=b,j=j>>>32-12|j<<12,Y=Y+le|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|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,K=K+q|0,A^=K,A=A>>>32-16|A<<16,x=x+A|0,q^=x,q=q>>>32-12|q<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,K=K+q|0,A^=K,A=A>>>32-8|A<<8,x=x+A|0,q^=x,q=q>>>32-7|q<<7,Y=Y+le|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,le^=l,le=le>>>32-7|le<<7,Z=Z+j|0,E^=Z,E=E>>>32-8|E<<8,b=b+E|0,j^=b,j=j>>>32-7|j<<7;Wr.writeUint32LE(Z+n|0,t,0),Wr.writeUint32LE(Y+i|0,t,4),Wr.writeUint32LE(oe+a|0,t,8),Wr.writeUint32LE(K+c|0,t,12),Wr.writeUint32LE(q+u|0,t,16),Wr.writeUint32LE(j+p|0,t,20),Wr.writeUint32LE(le+v|0,t,24),Wr.writeUint32LE(T+y|0,t,28),Wr.writeUint32LE(h+S|0,t,32),Wr.writeUint32LE(x+O|0,t,36),Wr.writeUint32LE(b+R|0,t,40),Wr.writeUint32LE(l+I|0,t,44),Wr.writeUint32LE(m+N|0,t,48),Wr.writeUint32LE(_+J|0,t,52),Wr.writeUint32LE(A+L|0,t,56),Wr.writeUint32LE(E+V|0,t,60)}o(BN,"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),p=0;p<r.length;p+=64){BN(u,a,t);for(var v=p;v<p+64&&v<r.length;v++)n[v]=r[v]^u[v-p];$N(a,0,c)}return T1.wipe(u),i===0&&T1.wipe(a),n}o(px,"streamXOR");sd.streamXOR=px;function UN(t,e,r,n){return n===void 0&&(n=0),T1.wipe(r),px(t,e,r,r,n)}o(UN,"stream");sd.stream=UN;function $N(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($N,"incrementCounter")});var vx=De(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});var Ns=Aa(),mx=hi(),FN=C1(),qN=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=FN.streamXOR(i,a,r,n);return mx.wipe(i),c}o(bx,"streamXOR");Su.streamXOR=bx;function HN(t,e,r){return mx.wipe(r),bx(t,e,r,r)}o(HN,"stream");Su.stream=HN;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],p=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],y=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],I=t[31]<<24|t[30]<<16|t[29]<<8|t[28],N=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],V=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Z=n,Y=i,oe=a,K=c,q=u,j=p,le=v,T=y,h=S,x=O,b=R,l=I,m=N,_=J,A=L,E=V,g=0;g<qN;g+=2)Z=Z+q|0,m^=Z,m=m>>>32-16|m<<16,h=h+m|0,q^=h,q=q>>>32-12|q<<12,Y=Y+j|0,_^=Y,_=_>>>32-16|_<<16,x=x+_|0,j^=x,j=j>>>32-12|j<<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,K=K+T|0,E^=K,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,K=K+T|0,E^=K,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+j|0,_^=Y,_=_>>>32-8|_<<8,x=x+_|0,j^=x,j=j>>>32-7|j<<7,Z=Z+q|0,m^=Z,m=m>>>32-8|m<<8,h=h+m|0,q^=h,q=q>>>32-7|q<<7,Z=Z+j|0,E^=Z,E=E>>>32-16|E<<16,b=b+E|0,j^=b,j=j>>>32-12|j<<12,Y=Y+le|0,m^=Y,m=m>>>32-16|m<<16,l=l+m|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,K=K+q|0,A^=K,A=A>>>32-16|A<<16,x=x+A|0,q^=x,q=q>>>32-12|q<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,K=K+q|0,A^=K,A=A>>>32-8|A<<8,x=x+A|0,q^=x,q=q>>>32-7|q<<7,Y=Y+le|0,m^=Y,m=m>>>32-8|m<<8,l=l+m|0,le^=l,le=le>>>32-7|le<<7,Z=Z+j|0,E^=Z,E=E>>>32-8|E<<8,b=b+E|0,j^=b,j=j>>>32-7|j<<7;return Ns.writeUint32LE(Z,r,0),Ns.writeUint32LE(Y,r,4),Ns.writeUint32LE(oe,r,8),Ns.writeUint32LE(K,r,12),Ns.writeUint32LE(m,r,16),Ns.writeUint32LE(_,r,20),Ns.writeUint32LE(A,r,24),Ns.writeUint32LE(E,r,28),r}o(gx,"hchacha");Su.hchacha=gx});var k1=De(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});function zN(t,e,r){return~(t-1)&e|t-1&r}o(zN,"select");Qf.select=zN;function KN(t,e){return(t|0)-(e|0)-1>>>31&1}o(KN,"lessOrEqual");Qf.lessOrEqual=KN;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");Qf.compare=yx;function jN(t,e){return t.length===0||e.length===0?!1:yx(t,e)!==0}o(jN,"equal");Qf.equal=jN});var wx=De(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var GN=k1(),ad=hi();Wo.DIGEST_LENGTH=16;var xx=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 p=e[12]|e[13]<<8;this._r[7]=(u>>>11|p<<5)&8065;var v=e[14]|e[15]<<8;this._r[8]=(p>>>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],p=this._h[3],v=this._h[4],y=this._h[5],S=this._h[6],O=this._h[7],R=this._h[8],I=this._h[9],N=this._r[0],J=this._r[1],L=this._r[2],V=this._r[3],Z=this._r[4],Y=this._r[5],oe=this._r[6],K=this._r[7],q=this._r[8],j=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 x=e[r+6]|e[r+7]<<8;p+=(h>>>7|x<<9)&8191;var b=e[r+8]|e[r+9]<<8;v+=(x>>>4|b<<12)&8191,y+=b>>>1&8191;var l=e[r+10]|e[r+11]<<8;S+=(b>>>14|l<<2)&8191;var m=e[r+12]|e[r+13]<<8;O+=(l>>>11|m<<5)&8191;var _=e[r+14]|e[r+15]<<8;R+=(m>>>8|_<<8)&8191,I+=_>>>5|i;var A=0,E=A;E+=a*N,E+=c*(5*j),E+=u*(5*q),E+=p*(5*K),E+=v*(5*oe),A=E>>>13,E&=8191,E+=y*(5*Y),E+=S*(5*Z),E+=O*(5*V),E+=R*(5*L),E+=I*(5*J),A+=E>>>13,E&=8191;var g=A;g+=a*J,g+=c*N,g+=u*(5*j),g+=p*(5*q),g+=v*(5*K),A=g>>>13,g&=8191,g+=y*(5*oe),g+=S*(5*Y),g+=O*(5*Z),g+=R*(5*V),g+=I*(5*L),A+=g>>>13,g&=8191;var C=A;C+=a*L,C+=c*J,C+=u*N,C+=p*(5*j),C+=v*(5*q),A=C>>>13,C&=8191,C+=y*(5*K),C+=S*(5*oe),C+=O*(5*Y),C+=R*(5*Z),C+=I*(5*V),A+=C>>>13,C&=8191;var P=A;P+=a*V,P+=c*L,P+=u*J,P+=p*N,P+=v*(5*j),A=P>>>13,P&=8191,P+=y*(5*q),P+=S*(5*K),P+=O*(5*oe),P+=R*(5*Y),P+=I*(5*Z),A+=P>>>13,P&=8191;var w=A;w+=a*Z,w+=c*V,w+=u*L,w+=p*J,w+=v*N,A=w>>>13,w&=8191,w+=y*(5*j),w+=S*(5*q),w+=O*(5*K),w+=R*(5*oe),w+=I*(5*Y),A+=w>>>13,w&=8191;var k=A;k+=a*Y,k+=c*Z,k+=u*V,k+=p*L,k+=v*J,A=k>>>13,k&=8191,k+=y*N,k+=S*(5*j),k+=O*(5*q),k+=R*(5*K),k+=I*(5*oe),A+=k>>>13,k&=8191;var he=A;he+=a*oe,he+=c*Y,he+=u*Z,he+=p*V,he+=v*L,A=he>>>13,he&=8191,he+=y*J,he+=S*N,he+=O*(5*j),he+=R*(5*q),he+=I*(5*K),A+=he>>>13,he&=8191;var D=A;D+=a*K,D+=c*oe,D+=u*Y,D+=p*Z,D+=v*V,A=D>>>13,D&=8191,D+=y*L,D+=S*J,D+=O*N,D+=R*(5*j),D+=I*(5*q),A+=D>>>13,D&=8191;var Q=A;Q+=a*q,Q+=c*K,Q+=u*oe,Q+=p*Y,Q+=v*Z,A=Q>>>13,Q&=8191,Q+=y*V,Q+=S*L,Q+=O*J,Q+=R*N,Q+=I*(5*j),A+=Q>>>13,Q&=8191;var se=A;se+=a*j,se+=c*q,se+=u*K,se+=p*oe,se+=v*Y,A=se>>>13,se&=8191,se+=y*Z,se+=S*V,se+=O*L,se+=R*J,se+=I*N,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,p=P,v=w,y=k,S=he,O=D,R=Q,I=se,r+=16,n-=16}this._h[0]=a,this._h[1]=c,this._h[2]=u,this._h[3]=p,this._h[4]=v,this._h[5]=y,this._h[6]=S,this._h[7]=O,this._h[8]=R,this._h[9]=I},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 ad.wipe(this._buffer),ad.wipe(this._r),ad.wipe(this._h),ad.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();Wo.Poly1305=xx;function VN(t,e){var r=new xx(t);r.update(e);var n=r.digest();return r.clean(),n}o(VN,"oneTimeAuth");Wo.oneTimeAuth=VN;function WN(t,e){return t.length!==Wo.DIGEST_LENGTH||e.length!==Wo.DIGEST_LENGTH?!1:GN.equal(t,e)}o(WN,"equal");Wo.equal=WN});var Ax=De(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var fd=C1(),JN=wx(),Mu=hi(),_x=Aa(),YN=k1();Jo.KEY_LENGTH=32;Jo.NONCE_LENGTH=12;Jo.TAG_LENGTH=16;var Ex=new Uint8Array(16),XN=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);fd.stream(this._key,a,c,4);var u=r.length+this.tagLength,p;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");p=i}else p=new Uint8Array(u);return fd.streamXOR(this._key,a,r,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),c,p.subarray(0,p.length-this.tagLength),n),Mu.wipe(a),p},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);fd.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),!YN.equal(u,r.subarray(r.length-this.tagLength,r.length)))return null;var p=r.length-this.tagLength,v;if(i){if(i.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");v=i}else v=new Uint8Array(p);return fd.streamXOR(this._key,a,r.subarray(0,r.length-this.tagLength),v,4),Mu.wipe(a),v},t.prototype.clean=function(){return Mu.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var a=new JN.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(),p=0;p<u.length;p++)e[p]=u[p];a.clean(),Mu.wipe(u),Mu.wipe(c)},t}();Jo.ChaCha20Poly1305=XN});var Tx=De(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var Sx=vx(),Mx=Ax(),Tu=hi();Yo.KEY_LENGTH=32;Yo.NONCE_LENGTH=24;Yo.TAG_LENGTH=16;var ZN=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=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),p=u.seal(c,r,n,i);return Tu.wipe(a),Tu.wipe(c),u.clean(),p},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),p=u.open(c,r,n,i);return Tu.wipe(a),Tu.wipe(c),u.clean(),p},t.prototype.clean=function(){return Tu.wipe(this._key),this},t}();Yo.XChaCha20Poly1305=ZN});var zi=De((eV,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 Bu=De((tV,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,Md=4294967292,Td=4294967293,tb=4294967294,y4=4294967295,Be=[0,1,3,7,15,31,63,127,255,511,1023],Us=["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"],vL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),qn=[];vL.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(I,N){if((N&192)!==128)return Td;let J=((I&Be[5])<<6)+(N&Be[6]);return J<128?Md:J}o(r,"bytes2");function n(I,N,J){if((J&192)!==128||(N&192)!==128)return Td;let L=((I&Be[4])<<12)+((N&Be[6])<<6)+(J&Be[6]);return L<2048?Md:L>=55296&&L<=57343?tb:L}o(n,"bytes3");function i(I,N,J,L){if((L&192)!==128||(J&192)!==128||(N&192)!==128)return Td;let V=(((I&Be[3])<<2)+(N>>4&Be[2])<<16)+((N&Be[4])<<12)+((J&Be[6])<<6)+(L&Be[6]);return V<65536?Md:V>1114111?tb:V}o(i,"bytes4");let a,c,u,p,v,y,S=t.length,O=e?3:0,R=[];for(;O<S;){c=t[O],a=y4;let I=!0;for(;I;){if(c>=0&&c<=127){a=c,y=1;break}if(u=O+1,u<S&&c>=194&&c<=223){a=r(c,t[u]),y=2;break}if(p=O+2,p<S&&c>=224&&c<=239){a=n(c,t[u],t[p]),y=3;break}if(v=O+3,v<S&&c>=240&&c<=244){a=i(c,t[u],t[p],t[v]),y=4;break}break}if(a>1114111){let N=`byte[${O}]`;throw a===y4?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${N}`):a===Td?new RangeError(`utf8.decode: illegal trailing byte found at: ${N}`):a===tb?new RangeError(`utf8.decode: code point out of range found at: ${N}`):a===Md?new RangeError(`utf8.decode: non-shortest form found at: ${N}`):new RangeError(`utf8.decode: unrecognized error found at: ${N}`)}R.push(a),O+=y}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,p,v,y,S;for(;i<n;){for(;;){if(p=i+1,p<n){if(y=(t[i]<<8)+t[p],y<55296||y>57343){c=y,u=2;break}if(v=i+3,v<n&&(S=(t[i+2]<<8)+t[v],y<=56319&&S>=56320&&S<=57343)){c=65536+(y-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,p,v,y,S;for(;i<n;){for(;;){if(p=i+1,p<n){if(y=(t[p]<<8)+t[i],y<55296||y>57343){c=y,u=2;break}if(v=i+3,v<n&&(S=(t[v]<<8)+t[i+2],y<=56319&&S>=56320&&S<=57343)){c=65536+(y-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${Us[n]}`;else if(n>=127&&n<=255)i+=`\`x${Us[n]}`;else if(n>=256&&n<=65535)i+=`\`u${Us[n>>8&Be[8]]}${Us[n&Be[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let c=n>>24&Be[8];c>0&&(i+=Us[c]),i+=`${Us[n>>16&Be[8]]+Us[n>>8&Be[8]]+Us[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 I={char:null,nexti:S+2,error:!0};if(S+1<O&&e(R[S])&&e(R[S+1])){let N=String.fromCodePoint(R[S],R[S+1]);I.char=parseInt(N,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(r,"getx");function n(S,O,R){let I={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 N=String.fromCodePoint(R[S],R[S+1],R[S+2],R[S+3]);I.char=parseInt(N,16),Number.isNaN(I.char)||(I.error=!1)}return I}o(n,"getu");function i(S,O,R){let I={char:null,nexti:S+4,error:!0},N="";for(;S<O&&e(R[S]);)N+=String.fromCodePoint(R[S]),S+=1;return I.char=parseInt(N,16),R[S]===125&&!Number.isNaN(I.char)&&(I.error=!1),I.nexti=S+1,I}o(i,"getU");let a=[],c=t.length,u,p,v,y=0;for(;y<c;){for(;;){if(v=!0,t[y]!==96){a.push(t[y]),y+=1,v=!1;break}if(u=y+1,u>=c)break;if(t[u]===96){a.push(96),y+=2,v=!1;break}if(t[u]===120){if(p=r(u+1,c,t),p.error)break;a.push(p.char),y=p.nexti,v=!1;break}if(t[u]===117){if(t[u+1]===123){if(p=i(u+2,c,t),p.error)break;a.push(p.char),y=p.nexti,v=!1;break}if(p=n(u+1,c,t),p.error)break;a.push(p.char),y=p.nexti,v=!1;break}break}if(v)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${y}]`)}return a}};var Uu=13,yi=10;$r.lineEnds={crlf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Uu:r+1<t.length&&t[r+1]===yi?r+=2:r+=1,e.push(Uu),e.push(yi);break;case yi:e.push(Uu),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(Uu),e.push(yi)),e},lf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Uu: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(y){let S=[],O=0;for(let R=0;R<y.length;R+=1){let I=y[R],N=!0;for(;N&&!(I===32||I===9||I===10||I===13);){if(I>=65&&I<=90){S.push(I-65);break}if(I>=97&&I<=122){S.push(I-71);break}if(I>=48&&I<=57){S.push(I+4);break}if(I===43){S.push(62);break}if(I===47){S.push(63);break}if(I===61){S.push(64),O+=1;break}throw new RangeError(`base64.decode: invalid character buf[${R}]: ${I}`)}}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,p=i.length/4,v=Buffer.alloc(p*3-n);n>0&&(p-=1),c=0,a=0;for(let y=0;y<p;y+=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,p){switch(r){case 76:e+=`\r
|
|
35
|
-
${a}${c}${u}${
|
|
36
|
-
${c}${u}${
|
|
37
|
-
${u}${
|
|
38
|
-
${
|
|
34
|
+
`});var Cm=jt(()=>{Pi();Sh();Es();Am();Aa()});var lu,Iz,km=jt(()=>{Iy();Dy();Oy();Ry();Ny();gm();Lf();_h();Eh();Ly();cu();Tm();Gy();Vy();Cm();lu={...lm,...hm,...dm,...pm,...mm,...bm,...vm,...ym,...xm,...wm},Iz={...Sm,...Mm}});function Xy(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var Yy,Im,nD,Dh,Dm=jt(()=>{km();gh();o(Xy,"createCodec");Yy=Xy("utf8","u",t=>{let e=new TextDecoder("utf8");return"u"+e.decode(t)},t=>new TextEncoder().encode(t.substring(1))),Im=Xy("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=ou(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),nD={utf8:Yy,"utf-8":Yy,hex:lu.base16,latin1:Im,ascii:Im,binary:Im,...lu},Dh=nD});var Zy={};Jt(Zy,{fromString:()=>Ot});function Ot(t,e="utf8"){let r=Dh[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 hu=jt(()=>{Dm();iu();o(Ot,"fromString")});var Qy={};Jt(Qy,{toString:()=>kt});function kt(t,e="utf8"){let r=Dh[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 $f=jt(()=>{Dm();o(kt,"toString")});var e3=De(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});function iD(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(iD,"imulShim");Pn.mul=Math.imul||iD;function oD(t,e){return t+e|0}o(oD,"add");Pn.add=oD;function sD(t,e){return t-e|0}o(sD,"sub");Pn.sub=sD;function aD(t,e){return t<<e|t>>>32-e}o(aD,"rotl");Pn.rotl=aD;function fD(t,e){return t<<32-e|t>>>e}o(fD,"rotr");Pn.rotr=fD;function cD(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}o(cD,"isIntegerShim");Pn.isInteger=Number.isInteger||cD;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 t3=e3();function uD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}o(uD,"readInt16BE");Mt.readInt16BE=uD;function lD(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}o(lD,"readUint16BE");Mt.readUint16BE=lD;function hD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}o(hD,"readInt16LE");Mt.readInt16LE=hD;function dD(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}o(dD,"readUint16LE");Mt.readUint16LE=dD;function r3(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(r3,"writeUint16BE");Mt.writeUint16BE=r3;Mt.writeInt16BE=r3;function n3(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(n3,"writeUint16LE");Mt.writeUint16LE=n3;Mt.writeInt16LE=n3;function Om(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}o(Om,"readInt32BE");Mt.readInt32BE=Om;function Rm(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}o(Rm,"readUint32BE");Mt.readUint32BE=Rm;function Nm(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}o(Nm,"readInt32LE");Mt.readInt32LE=Nm;function Pm(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}o(Pm,"readUint32LE");Mt.readUint32LE=Pm;function Oh(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(Oh,"writeUint32BE");Mt.writeUint32BE=Oh;Mt.writeInt32BE=Oh;function Rh(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(Rh,"writeUint32LE");Mt.writeUint32LE=Rh;Mt.writeInt32LE=Rh;function pD(t,e){e===void 0&&(e=0);var r=Om(t,e),n=Om(t,e+4);return r*4294967296+n-(n>>31)*4294967296}o(pD,"readInt64BE");Mt.readInt64BE=pD;function mD(t,e){e===void 0&&(e=0);var r=Rm(t,e),n=Rm(t,e+4);return r*4294967296+n}o(mD,"readUint64BE");Mt.readUint64BE=mD;function bD(t,e){e===void 0&&(e=0);var r=Nm(t,e),n=Nm(t,e+4);return n*4294967296+r-(r>>31)*4294967296}o(bD,"readInt64LE");Mt.readInt64LE=bD;function gD(t,e){e===void 0&&(e=0);var r=Pm(t,e),n=Pm(t,e+4);return n*4294967296+r}o(gD,"readUint64LE");Mt.readUint64LE=gD;function i3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Oh(t/4294967296>>>0,e,r),Oh(t>>>0,e,r+4),e}o(i3,"writeUint64BE");Mt.writeUint64BE=i3;Mt.writeInt64BE=i3;function o3(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Rh(t>>>0,e,r),Rh(t/4294967296>>>0,e,r+4),e}o(o3,"writeUint64LE");Mt.writeUint64LE=o3;Mt.writeInt64LE=o3;function vD(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(vD,"readUintBE");Mt.readUintBE=vD;function yD(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(yD,"readUintLE");Mt.readUintLE=yD;function xD(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(!t3.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(xD,"writeUintBE");Mt.writeUintBE=xD;function wD(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(!t3.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(wD,"writeUintLE");Mt.writeUintLE=wD;function _D(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}o(_D,"readFloat32BE");Mt.readFloat32BE=_D;function ED(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}o(ED,"readFloat32LE");Mt.readFloat32LE=ED;function AD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}o(AD,"readFloat64BE");Mt.readFloat64BE=AD;function SD(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}o(SD,"readFloat64LE");Mt.readFloat64LE=SD;function MD(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(MD,"writeFloat32BE");Mt.writeFloat32BE=MD;function TD(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(TD,"writeFloat32LE");Mt.writeFloat32LE=TD;function CD(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(CD,"writeFloat64BE");Mt.writeFloat64BE=CD;function kD(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(kD,"writeFloat64LE");Mt.writeFloat64LE=kD});var hi=De(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});function ID(t){for(var e=0;e<t.length;e++)t[e]=0;return t}o(ID,"wipe");Lm.wipe=ID});var a3=De(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Ph=Sa(),Nh=hi();Ms.DIGEST_LENGTH=32;Ms.BLOCK_SIZE=64;var s3=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(){Nh.wipe(this._buffer),Nh.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&&(Bm(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=Bm(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;Ph.writeUint32BE(i,this._buffer,c-8),Ph.writeUint32BE(a,this._buffer,c-4),Bm(this._temp,this._state,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/4;u++)Ph.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){Nh.wipe(e.state),e.buffer&&Nh.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Ms.SHA256=s3;var DD=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 Bm(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]=Ph.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+(DD[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(Bm,"hashBlocks");function OD(t){var e=new s3;e.update(t);var r=e.digest();return e.clean(),r}o(OD,"hash");Ms.hash=OD});var Um=De((eK,Lh)=>{(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 Lh=="object"&&Lh.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(F){return new w(I,Z,I).update(F)[se]()}},"createOutputMethod"),oe=o(function(I,Z,se){return function(F,$){return new w(I,Z,$).update(F)[se]()}},"createShakeOutputMethod"),K=o(function(I,Z,se){return function(F,$,ee,ne){return l["cshake"+I].update(F,$,ee,ne)[se]()}},"createCshakeOutputMethod"),q=o(function(I,Z,se){return function(F,$,ee,ne){return l["kmac"+I].update(F,$,ee,ne)[se]()}},"createKmacOutputMethod"),j=o(function(I,Z,se,F){for(var $=0;$<W.length;++$){var ee=W[$];I[ee]=Z(se,F,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(F){return se.create().update(F)},j(se,Y,I,Z)},"createMethod"),T=o(function(I,Z){var se=oe(I,Z,"hex");return se.create=function(F){return new w(I,Z,F)},se.update=function(F,$){return se.create($).update(F)},j(se,oe,I,Z)},"createShakeMethod"),h=o(function(I,Z){var se=Q[I],F=K(I,Z,"hex");return F.create=function($,ee,ne){return!ee&&!ne?l["shake"+I].create($):new w(I,Z,$).bytepad([ee,ne],se)},F.update=function($,ee,ne,ae){return F.create(ee,ne,ae).update($)},j(F,K,I,Z)},"createCshakeMethod"),y=o(function(I,Z){var se=Q[I],F=q(I,Z,"hex");return F.create=function($,ee,ne){return new k(I,Z,ee).bytepad(["KMAC",ne],se).bytepad([$],se)},F.update=function($,ee,ne,ae){return F.create($,ne,ae).update(ee)},j(F,q,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 F=0;F<50;++F)this.s[F]=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 F=this.blocks,$=this.byteCount,ee=I.length,ne=this.blockCount,ae=0,Ae=this.s,ge,re;ae<ee;){if(this.reset)for(this.reset=!1,F[0]=this.block,ge=1;ge<ne+1;++ge)F[ge]=0;if(Z)for(ge=this.start;ae<ee&&ge<$;++ae)F[ge>>2]|=I[ae]<<D[ge++&3];else for(ge=this.start;ae<ee&&ge<$;++ae)re=I.charCodeAt(ae),re<128?F[ge>>2]|=re<<D[ge++&3]:re<2048?(F[ge>>2]|=(192|re>>6)<<D[ge++&3],F[ge>>2]|=(128|re&63)<<D[ge++&3]):re<55296||re>=57344?(F[ge>>2]|=(224|re>>12)<<D[ge++&3],F[ge>>2]|=(128|re>>6&63)<<D[ge++&3],F[ge>>2]|=(128|re&63)<<D[ge++&3]):(re=65536+((re&1023)<<10|I.charCodeAt(++ae)&1023),F[ge>>2]|=(240|re>>18)<<D[ge++&3],F[ge>>2]|=(128|re>>12&63)<<D[ge++&3],F[ge>>2]|=(128|re>>6&63)<<D[ge++&3],F[ge>>2]|=(128|re&63)<<D[ge++&3]);if(this.lastByteIndex=ge,ge>=$){for(this.start=ge-$,this.block=F[ne],ge=0;ge<ne;++ge)Ae[ge]^=F[ge];he(Ae),this.reset=!0}else this.start=ge}return this},w.prototype.encode=function(I,Z){var se=I&255,F=1,$=[se];for(I=I>>8,se=I&255;se>0;)$.unshift(se),I=I>>8,se=I&255,++F;return Z?$.push(F):$.unshift(F),this.update($),$.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 F=0,$=I.length;if(Z)F=$;else for(var ee=0;ee<I.length;++ee){var ne=I.charCodeAt(ee);ne<128?F+=1:ne<2048?F+=2:ne<55296||ne>=57344?F+=3:(ne=65536+((ne&1023)<<10|I.charCodeAt(++ee)&1023),F+=4)}return F+=this.encode(F*8),this.update(I),F},w.prototype.bytepad=function(I,Z){for(var se=this.encode(Z),F=0;F<I.length;++F)se+=this.encodeString(I[F]);var $=Z-se%Z,ee=[];return ee.length=$,this.update(ee),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var I=this.blocks,Z=this.lastByteIndex,se=this.blockCount,F=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)F[Z]^=I[Z];he(F)}},w.prototype.toString=w.prototype.hex=function(){this.finalize();for(var I=this.blockCount,Z=this.s,se=this.outputBlocks,F=this.extraBytes,$=0,ee=0,ne="",ae;ee<se;){for($=0;$<I&&ee<se;++$,++ee)ae=Z[$],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),$=0)}return F&&(ae=Z[$],ne+=v[ae>>4&15]+v[ae&15],F>1&&(ne+=v[ae>>12&15]+v[ae>>8&15]),F>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,F=this.extraBytes,$=0,ee=0,ne=this.outputBits>>3,ae;F?ae=new ArrayBuffer(se+1<<2):ae=new ArrayBuffer(ne);for(var Ae=new Uint32Array(ae);ee<se;){for($=0;$<I&&ee<se;++$,++ee)Ae[ee]=Z[$];ee%I===0&&he(Z)}return F&&(Ae[$]=Z[$],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,F=this.extraBytes,$=0,ee=0,ne=[],ae,Ae;ee<se;){for($=0;$<I&&ee<se;++$,++ee)ae=ee<<2,Ae=Z[$],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 F&&(ae=ee<<2,Ae=Z[$],ne[ae]=Ae&255,F>1&&(ne[ae+1]=Ae>>8&255),F>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,F,$,ee,ne,ae,Ae,ge,re,Se,ce,ve,G,pe,Ce,He,Re,Ve,pr,ue,ie,U,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(F=0;F<48;F+=2)$=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=$^(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^($<<1|ee>>>31),se=Se^(ee<<1|$>>>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,G=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,U=I[49]<<14|I[48]>>>18,I[0]=G^~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&U,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&G,I[7]=ue^~U&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^~G&Ce,I[9]=U^~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[F],I[1]^=P[F+1]},"f");if(c)Lh.exports=l;else{for(_=0;_<p.length;++_)n[p[_]]=l[p[_]];u&&define(function(){return l})}})()});var f3=De((tK,RD)=>{RD.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 $m=De(()=>{});var no=De((c3,Fm)=>{(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=$m().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,F=se&8191,$=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,G=l[6]|0,pe=G&8191,Ce=G>>>13,He=l[7]|0,Re=He&8191,Ve=He>>>13,pr=l[8]|0,ue=pr&8191,ie=pr>>>13,U=l[9]|0,X=U&8191,me=U>>>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(F,we),g=Math.imul(F,ke),g=g+Math.imul($,we)|0,C=Math.imul($,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(F,Ue)|0,g=g+Math.imul(F,Oe)|0,g=g+Math.imul($,Ue)|0,C=C+Math.imul($,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(F,je)|0,g=g+Math.imul(F,Je)|0,g=g+Math.imul($,je)|0,C=C+Math.imul($,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(F,nt)|0,g=g+Math.imul(F,it)|0,g=g+Math.imul($,nt)|0,C=C+Math.imul($,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(F,ot)|0,g=g+Math.imul(F,et)|0,g=g+Math.imul($,ot)|0,C=C+Math.imul($,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(F,st)|0,g=g+Math.imul(F,at)|0,g=g+Math.imul($,st)|0,C=C+Math.imul($,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(F,ft)|0,g=g+Math.imul(F,Xe)|0,g=g+Math.imul($,ft)|0,C=C+Math.imul($,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(F,ct)|0,g=g+Math.imul(F,ut)|0,g=g+Math.imul($,ct)|0,C=C+Math.imul($,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(F,lt)|0,g=g+Math.imul(F,ht)|0,g=g+Math.imul($,lt)|0,C=C+Math.imul($,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(F,dt)|0,g=g+Math.imul(F,tt)|0,g=g+Math.imul($,dt)|0,C=C+Math.imul($,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],F=l[N+he+A],$=w*se-k*F;F=w*F+k*se,se=$,b[N+he]=I+se,l[N+he]=Z+F,b[N+he+A]=I-se,l[N+he+A]=Z-F,he!==E&&($=g*w-C*k,k=g*k+C*w,w=$)}},"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 j(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 K(){Q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(K,"P192"),n(K,Q);function q(){Q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(q,"P25519"),n(q,Q),q.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 K;else if(h==="p25519")y=new q;else throw new Error("Unknown prime "+h);return W[h]=y,y},"prime");function j(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(j,"Red"),j.prototype._verify1=o(function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},"_verify1"),j.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"),j.prototype.imod=o(function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},"imod"),j.prototype.neg=o(function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},"neg"),j.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"),j.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"),j.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"),j.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"),j.prototype.shl=o(function(h,y){return this._verify1(h),this.imod(h.ushln(y))},"shl"),j.prototype.imul=o(function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},"imul"),j.prototype.mul=o(function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},"mul"),j.prototype.isqr=o(function(h){return this.imul(h,h.clone())},"isqr"),j.prototype.sqr=o(function(h){return this.mul(h,h)},"sqr"),j.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"),j.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"),j.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"),j.prototype.convertTo=o(function(h){var y=h.umod(this.m);return y===h?y.clone():y},"convertTo"),j.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){j.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,j),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 Fm>"u"||Fm,c3)});var Ts=De((iK,l3)=>{l3.exports=u3;function u3(t,e){if(!t)throw new Error(e||"Assertion failed")}o(u3,"assert");u3.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual")});var qm=De(p3=>{"use strict";var Bh=p3;function ND(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(ND,"toArray");Bh.toArray=ND;function h3(t){return t.length===1?"0"+t:t}o(h3,"zero2");Bh.zero2=h3;function d3(t){for(var e="",r=0;r<t.length;r++)e+=h3(t[r].toString(16));return e}o(d3,"toHex");Bh.toHex=d3;Bh.encode=o(function(e,r){return r==="hex"?d3(e):e},"encode")});var Ln=De(m3=>{"use strict";var Li=m3,PD=no(),LD=Ts(),Uh=qm();Li.assert=LD;Li.toArray=Uh.toArray;Li.zero2=Uh.zero2;Li.toHex=Uh.toHex;Li.encode=Uh.encode;function BD(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(BD,"getNAF");Li.getNAF=BD;function UD(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(UD,"getJSF");Li.getJSF=UD;function $D(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($D,"cachedProperty");Li.cachedProperty=$D;function FD(t){return typeof t=="string"?Li.toArray(t,"hex"):t}o(FD,"parseBytes");Li.parseBytes=FD;function qD(t){return new PD(t,"hex","le")}o(qD,"intFromLE");Li.intFromLE=qD});var jm=De((aK,Km)=>{var Hm;Km.exports=o(function(e){return Hm||(Hm=new Cs(null)),Hm.generate(e)},"rand");function Cs(t){this.rand=t}o(Cs,"Rand");Km.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(zm=require("crypto"),typeof zm.randomBytes!="function")throw new Error("Not supported");Cs.prototype._rand=o(function(e){return zm.randomBytes(e)},"_rand")}catch{}var zm});var pu=De((fK,b3)=>{"use strict";var Ma=no(),du=Ln(),$h=du.getNAF,HD=du.getJSF,Fh=du.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");b3.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){Fh(e.precomputed);var n=e._getDoubles(),i=$h(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=$h(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];Fh(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]=$h(n[D],c[D],this._bitLength),m[P]=$h(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=HD(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),K=this._wnafT4;for(x=v;x>=0;x--){for(var q=0;x>=0;){var j=!0;for(S=0;S<i;S++)K[S]=m[S][x]|0,K[S]!==0&&(j=!1);if(!j)break;q++,x--}if(x>=0&&q++,oe=oe.dblp(q),x<0)break;for(S=0;S<i;S++){var le=K[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=du.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?Fh(e[e.length-1]%2===0):e[0]===7&&Fh(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 du.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 mu=De((cK,Gm)=>{typeof Object.create=="function"?Gm.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"):Gm.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 v3=De((uK,g3)=>{"use strict";var zD=Ln(),ur=no(),Vm=mu(),Ff=pu(),KD=zD.assert;function pi(t){Ff.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");Vm(pi,Ff);g3.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],KD(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()),K=R.sqr().add(D.sqr());return K.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){Ff.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");Vm(Sr,Ff.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){Ff.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");Vm(Lr,Ff.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 w3=De((lK,x3)=>{"use strict";var qf=no(),y3=mu(),qh=pu(),jD=Ln();function Hf(t){qh.call(this,"mont",t),this.a=new qf(t.a,16).toRed(this.red),this.b=new qf(t.b,16).toRed(this.red),this.i4=new qf(4).toRed(this.red).redInvm(),this.two=new qf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Hf,"MontCurve");y3(Hf,qh);x3.exports=Hf;Hf.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){qh.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new qf(e,16),this.z=new qf(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");y3(Mr,qh.BasePoint);Hf.prototype.decodePoint=o(function(e,r){return this.point(jD.toArray(e,r),1)},"decodePoint");Hf.prototype.point=o(function(e,r){return new Mr(this,e,r)},"point");Hf.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 A3=De((hK,E3)=>{"use strict";var GD=Ln(),Ho=no(),_3=mu(),Hh=pu(),VD=GD.assert;function io(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Hh.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),VD(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}o(io,"EdwardsCurve");_3(io,Hh);E3.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){Hh.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");_3(rr,Hh.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 Wm=De(S3=>{"use strict";var zh=S3;zh.base=pu();zh.short=v3();zh.mont=w3();zh.edwards=A3()});var Bi=De(Qt=>{"use strict";var WD=Ts(),JD=mu();Qt.inherits=JD;function YD(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}o(YD,"isSurrogatePair");function XD(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):YD(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(XD,"toArray");Qt.toArray=XD;function ZD(t){for(var e="",r=0;r<t.length;r++)e+=T3(t[r].toString(16));return e}o(ZD,"toHex");Qt.toHex=ZD;function M3(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}o(M3,"htonl");Qt.htonl=M3;function QD(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=M3(i)),r+=C3(i.toString(16))}return r}o(QD,"toHex32");Qt.toHex32=QD;function T3(t){return t.length===1?"0"+t:t}o(T3,"zero2");Qt.zero2=T3;function C3(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(C3,"zero8");Qt.zero8=C3;function eO(t,e,r,n){var i=r-e;WD(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(eO,"join32");Qt.join32=eO;function tO(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(tO,"split32");Qt.split32=tO;function rO(t,e){return t>>>e|t<<32-e}o(rO,"rotr32");Qt.rotr32=rO;function nO(t,e){return t<<e|t>>>32-e}o(nO,"rotl32");Qt.rotl32=nO;function iO(t,e){return t+e>>>0}o(iO,"sum32");Qt.sum32=iO;function oO(t,e,r){return t+e+r>>>0}o(oO,"sum32_3");Qt.sum32_3=oO;function sO(t,e,r,n){return t+e+r+n>>>0}o(sO,"sum32_4");Qt.sum32_4=sO;function aO(t,e,r,n,i){return t+e+r+n+i>>>0}o(aO,"sum32_5");Qt.sum32_5=aO;function fO(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(fO,"sum64");Qt.sum64=fO;function cO(t,e,r,n){var i=e+n>>>0,a=(i<e?1:0)+t+r;return a>>>0}o(cO,"sum64_hi");Qt.sum64_hi=cO;function uO(t,e,r,n){var i=e+n;return i>>>0}o(uO,"sum64_lo");Qt.sum64_lo=uO;function lO(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(lO,"sum64_4_hi");Qt.sum64_4_hi=lO;function hO(t,e,r,n,i,a,c,u){var m=e+n+a+u;return m>>>0}o(hO,"sum64_4_lo");Qt.sum64_4_lo=hO;function dO(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(dO,"sum64_5_hi");Qt.sum64_5_hi=dO;function pO(t,e,r,n,i,a,c,u,m,v){var x=e+n+a+u+v;return x>>>0}o(pO,"sum64_5_lo");Qt.sum64_5_lo=pO;function mO(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}o(mO,"rotr64_hi");Qt.rotr64_hi=mO;function bO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(bO,"rotr64_lo");Qt.rotr64_lo=bO;function gO(t,e,r){return t>>>r}o(gO,"shr64_hi");Qt.shr64_hi=gO;function vO(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}o(vO,"shr64_lo");Qt.shr64_lo=vO});var zf=De(I3=>{"use strict";var k3=Bi(),yO=Ts();function Kh(){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(Kh,"BlockHash");I3.BlockHash=Kh;Kh.prototype.update=o(function(e,r){if(e=k3.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=k3.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");Kh.prototype.digest=o(function(e){return this.update(this._pad()),yO(this.pending===null),this._digest(e)},"digest");Kh.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 Jm=De(zo=>{"use strict";var xO=Bi(),oo=xO.rotr32;function wO(t,e,r,n){if(t===0)return D3(e,r,n);if(t===1||t===3)return R3(e,r,n);if(t===2)return O3(e,r,n)}o(wO,"ft_1");zo.ft_1=wO;function D3(t,e,r){return t&e^~t&r}o(D3,"ch32");zo.ch32=D3;function O3(t,e,r){return t&e^t&r^e&r}o(O3,"maj32");zo.maj32=O3;function R3(t,e,r){return t^e^r}o(R3,"p32");zo.p32=R3;function _O(t){return oo(t,2)^oo(t,13)^oo(t,22)}o(_O,"s0_256");zo.s0_256=_O;function EO(t){return oo(t,6)^oo(t,11)^oo(t,25)}o(EO,"s1_256");zo.s1_256=EO;function AO(t){return oo(t,7)^oo(t,18)^t>>>3}o(AO,"g0_256");zo.g0_256=AO;function SO(t){return oo(t,17)^oo(t,19)^t>>>10}o(SO,"g1_256");zo.g1_256=SO});var L3=De((gK,P3)=>{"use strict";var Kf=Bi(),MO=zf(),TO=Jm(),Ym=Kf.rotl32,bu=Kf.sum32,CO=Kf.sum32_5,kO=TO.ft_1,N3=MO.BlockHash,IO=[1518500249,1859775393,2400959708,3395469782];function so(){if(!(this instanceof so))return new so;N3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(so,"SHA1");Kf.inherits(so,N3);P3.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]=Ym(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=CO(Ym(a,5),kO(x,c,u,m),v,n[i],IO[x]);v=m,m=u,u=Ym(c,30),c=a,a=S}this.h[0]=bu(this.h[0],a),this.h[1]=bu(this.h[1],c),this.h[2]=bu(this.h[2],u),this.h[3]=bu(this.h[3],m),this.h[4]=bu(this.h[4],v)},"_update");so.prototype._digest=o(function(e){return e==="hex"?Kf.toHex32(this.h,"big"):Kf.split32(this.h,"big")},"digest")});var Xm=De((vK,U3)=>{"use strict";var jf=Bi(),DO=zf(),Gf=Jm(),OO=Ts(),Ui=jf.sum32,RO=jf.sum32_4,NO=jf.sum32_5,PO=Gf.ch32,LO=Gf.maj32,BO=Gf.s0_256,UO=Gf.s1_256,$O=Gf.g0_256,FO=Gf.g1_256,B3=DO.BlockHash,qO=[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;B3.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=qO,this.W=new Array(64)}o(ao,"SHA256");jf.inherits(ao,B3);U3.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]=RO(FO(n[i-2]),n[i-7],$O(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(OO(this.k.length===n.length),i=0;i<n.length;i++){var R=NO(O,UO(v),PO(v,x,S),this.k[i],n[i]),D=Ui(BO(a),LO(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"?jf.toHex32(this.h,"big"):jf.split32(this.h,"big")},"digest")});var q3=De((yK,F3)=>{"use strict";var Zm=Bi(),$3=Xm();function Ko(){if(!(this instanceof Ko))return new Ko;$3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(Ko,"SHA224");Zm.inherits(Ko,$3);F3.exports=Ko;Ko.blockSize=512;Ko.outSize=224;Ko.hmacStrength=192;Ko.padLength=64;Ko.prototype._digest=o(function(e){return e==="hex"?Zm.toHex32(this.h.slice(0,7),"big"):Zm.split32(this.h.slice(0,7),"big")},"digest")});var t1=De((xK,j3)=>{"use strict";var vn=Bi(),HO=zf(),zO=Ts(),fo=vn.rotr64_hi,co=vn.rotr64_lo,H3=vn.shr64_hi,z3=vn.shr64_lo,Is=vn.sum64,Qm=vn.sum64_hi,e1=vn.sum64_lo,KO=vn.sum64_4_hi,jO=vn.sum64_4_lo,GO=vn.sum64_5_hi,VO=vn.sum64_5_lo,K3=HO.BlockHash,WO=[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;K3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=WO,this.W=new Array(160)}o($i,"SHA512");vn.inherits($i,K3);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=oR(n[i-4],n[i-3]),c=sR(n[i-4],n[i-3]),u=n[i-14],m=n[i-13],v=nR(n[i-30],n[i-29]),x=iR(n[i-30],n[i-29]),S=n[i-32],O=n[i-31];n[i]=KO(a,c,u,m,v,x,S,O),n[i+1]=jO(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];zO(this.k.length===n.length);for(var Y=0;Y<n.length;Y+=2){var oe=W,K=Q,q=tR(O,R),j=rR(O,R),le=JO(O,R,D,P,J,L),T=YO(O,R,D,P,J,L),h=this.k[Y],y=this.k[Y+1],b=n[Y],l=n[Y+1],p=GO(oe,K,q,j,le,T,h,y,b,l),_=VO(oe,K,q,j,le,T,h,y,b,l);oe=QO(i,a),K=eR(i,a),q=XO(i,a,c,u,m,v),j=ZO(i,a,c,u,m,v);var A=Qm(oe,K,q,j),E=e1(oe,K,q,j);W=J,Q=L,J=D,L=P,D=O,P=R,O=Qm(x,S,p,_),R=e1(S,S,p,_),x=m,S=v,m=c,v=u,c=i,u=a,i=Qm(p,_,A,E),a=e1(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 JO(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}o(JO,"ch64_hi");function YO(t,e,r,n,i,a){var c=e&n^~e&a;return c<0&&(c+=4294967296),c}o(YO,"ch64_lo");function XO(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}o(XO,"maj64_hi");function ZO(t,e,r,n,i,a){var c=e&n^e&a^n&a;return c<0&&(c+=4294967296),c}o(ZO,"maj64_lo");function QO(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(QO,"s0_512_hi");function eR(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(eR,"s0_512_lo");function tR(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(tR,"s1_512_hi");function rR(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(rR,"s1_512_lo");function nR(t,e){var r=fo(t,e,1),n=fo(t,e,8),i=H3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(nR,"g0_512_hi");function iR(t,e){var r=co(t,e,1),n=co(t,e,8),i=z3(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}o(iR,"g0_512_lo");function oR(t,e){var r=fo(t,e,19),n=fo(e,t,29),i=H3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(oR,"g1_512_hi");function sR(t,e){var r=co(t,e,19),n=co(e,t,29),i=z3(t,e,6),a=r^n^i;return a<0&&(a+=4294967296),a}o(sR,"g1_512_lo")});var W3=De((wK,V3)=>{"use strict";var r1=Bi(),G3=t1();function jo(){if(!(this instanceof jo))return new jo;G3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(jo,"SHA384");r1.inherits(jo,G3);V3.exports=jo;jo.blockSize=1024;jo.outSize=384;jo.hmacStrength=192;jo.padLength=128;jo.prototype._digest=o(function(e){return e==="hex"?r1.toHex32(this.h.slice(0,12),"big"):r1.split32(this.h.slice(0,12),"big")},"digest")});var J3=De(Vf=>{"use strict";Vf.sha1=L3();Vf.sha224=q3();Vf.sha256=Xm();Vf.sha384=W3();Vf.sha512=t1()});var t6=De(e6=>{"use strict";var Ta=Bi(),aR=zf(),jh=Ta.rotl32,Y3=Ta.sum32,gu=Ta.sum32_3,X3=Ta.sum32_4,Q3=aR.BlockHash;function uo(){if(!(this instanceof uo))return new uo;Q3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(uo,"RIPEMD160");Ta.inherits(uo,Q3);e6.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=Y3(jh(X3(n,Z3(R,i,a,c),e[uR[R]+r],fR(R)),hR[R]),u);n=u,u=c,c=jh(a,10),a=i,i=D,D=Y3(jh(X3(m,Z3(79-R,v,x,S),e[lR[R]+r],cR(R)),dR[R]),O),m=O,O=S,S=jh(x,10),x=v,v=D}D=gu(this.h[1],a,S),this.h[1]=gu(this.h[2],c,O),this.h[2]=gu(this.h[3],u,m),this.h[3]=gu(this.h[4],n,v),this.h[4]=gu(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 Z3(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(Z3,"f");function fR(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}o(fR,"K");function cR(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}o(cR,"Kh");var uR=[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],lR=[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],hR=[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],dR=[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 n6=De((AK,r6)=>{"use strict";var pR=Bi(),mR=Ts();function Wf(t,e,r){if(!(this instanceof Wf))return new Wf(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(pR.toArray(e,r))}o(Wf,"Hmac");r6.exports=Wf;Wf.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),mR(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");Wf.prototype.update=o(function(e,r){return this.inner.update(e,r),this},"update");Wf.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var vu=De(i6=>{var Br=i6;Br.utils=Bi();Br.common=zf();Br.sha=J3();Br.ripemd=t6();Br.hmac=n6();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 s6=De((MK,o6)=>{o6.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 Gh=De(c6=>{"use strict";var i1=c6,Ds=vu(),n1=Wm(),bR=Ln(),a6=bR.assert;function f6(t){t.type==="short"?this.curve=new n1.short(t):t.type==="edwards"?this.curve=new n1.edwards(t):this.curve=new n1.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a6(this.g.validate(),"Invalid curve"),a6(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(f6,"PresetCurve");i1.PresetCurve=f6;function Os(t,e){Object.defineProperty(i1,t,{configurable:!0,enumerable:!0,get:function(){var r=new f6(e);return Object.defineProperty(i1,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 o1;try{o1=s6()}catch{o1=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",o1]})});var h6=De((CK,l6)=>{"use strict";var gR=vu(),Ca=qm(),u6=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");u6(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(Rs,"HmacDRBG");l6.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 gR.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),u6(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 p6=De((kK,d6)=>{"use strict";var vR=no(),yR=Ln(),s1=yR.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");d6.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 vR(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"?s1(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&s1(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()||s1(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 g6=De((IK,b6)=>{"use strict";var Vh=no(),c1=Ln(),xR=c1.assert;function Wh(t,e){if(t instanceof Wh)return t;this._importDER(t,e)||(xR(t.r&&t.s,"Signature without r or s"),this.r=new Vh(t.r,16),this.s=new Vh(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}o(Wh,"Signature");b6.exports=Wh;function wR(){this.place=0}o(wR,"Position");function a1(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(a1,"getLength");function m6(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(m6,"rmPadding");Wh.prototype._importDER=o(function(e,r){e=c1.toArray(e,r);var n=new wR;if(e[n.place++]!==48)return!1;var i=a1(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=a1(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=a1(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 Vh(c),this.s=new Vh(m),this.recoveryParam=null,!0},"_importDER");function f1(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(f1,"constructLength");Wh.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=m6(r),n=m6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];f1(i,r.length),i=i.concat(r),i.push(2),f1(i,n.length);var a=i.concat(n),c=[48];return f1(c,a.length),c=c.concat(a),c1.encode(c,e)},"toDER")});var w6=De((DK,x6)=>{"use strict";var ka=no(),v6=h6(),_R=Ln(),u1=Gh(),ER=jm(),y6=_R.assert,l1=p6(),Jh=g6();function mi(t){if(!(this instanceof mi))return new mi(t);typeof t=="string"&&(y6(Object.prototype.hasOwnProperty.call(u1,t),"Unknown curve "+t),t=u1[t]),t instanceof u1.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");x6.exports=mi;mi.prototype.keyPair=o(function(e){return new l1(this,e)},"keyPair");mi.prototype.keyFromPrivate=o(function(e,r){return l1.fromPrivate(this,e,r)},"keyFromPrivate");mi.prototype.keyFromPublic=o(function(e,r){return l1.fromPublic(this,e,r)},"keyFromPublic");mi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new v6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ER(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 v6({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 Jh({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 Jh(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){y6((3&r)===r,"The recovery param is more than two bits"),e=new Jh(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 Jh(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 S6=De((OK,A6)=>{"use strict";var yu=Ln(),E6=yu.assert,_6=yu.parseBytes,Jf=yu.cachedProperty;function Tr(t,e){this.eddsa=t,this._secret=_6(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=_6(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");Jf(Tr,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));Jf(Tr,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));Jf(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"));Jf(Tr,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));Jf(Tr,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));Jf(Tr,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Tr.prototype.sign=o(function(e){return E6(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 E6(this._secret,"KeyPair is public only"),yu.encode(this.secret(),e)},"getSecret");Tr.prototype.getPublic=o(function(e){return yu.encode(this.pubBytes(),e)},"getPublic");A6.exports=Tr});var T6=De((RK,M6)=>{"use strict";var AR=no(),Yh=Ln(),SR=Yh.assert,Xh=Yh.cachedProperty,MR=Yh.parseBytes;function Ia(t,e){this.eddsa=t,typeof e!="object"&&(e=MR(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),SR(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof AR&&(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");Xh(Ia,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));Xh(Ia,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));Xh(Ia,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));Xh(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 Yh.encode(this.toBytes(),"hex").toUpperCase()},"toHex");M6.exports=Ia});var O6=De((NK,D6)=>{"use strict";var TR=vu(),CR=Gh(),Yf=Ln(),kR=Yf.assert,k6=Yf.parseBytes,I6=S6(),C6=T6();function yn(t){if(kR(t==="ed25519","only tested with ed25519 so far"),!(this instanceof yn))return new yn(t);t=CR[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=TR.sha512}o(yn,"EDDSA");D6.exports=yn;yn.prototype.sign=o(function(e,r){e=k6(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=k6(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 Yf.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");yn.prototype.keyFromPublic=o(function(e){return I6.fromPublic(this,e)},"keyFromPublic");yn.prototype.keyFromSecret=o(function(e){return I6.fromSecret(this,e)},"keyFromSecret");yn.prototype.makeSignature=o(function(e){return e instanceof C6?e:new C6(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=Yf.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,a=Yf.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 Yf.intFromLE(e)},"decodeInt");yn.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var N6=De(R6=>{"use strict";var Da=R6;Da.version=f3().version;Da.utils=Ln();Da.rand=jm();Da.curve=Wm();Da.curves=Gh();Da.ec=w6();Da.eddsa=O6()});var L6=De(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.BrowserRandomSource=void 0;var P6=65536,Zh=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+=P6)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,P6)));return r}};o(Zh,"BrowserRandomSource");Qh.BrowserRandomSource=Zh});var B6=De(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.NodeRandomSource=void 0;var IR=hi(),ed=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,IR.wipe)(r),n}};o(ed,"NodeRandomSource");td.NodeRandomSource=ed});var U6=De(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.SystemRandomSource=void 0;var DR=L6(),OR=B6(),rd=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new DR.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new OR.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(rd,"SystemRandomSource");nd.SystemRandomSource=rd});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 RR=U6(),NR=Sa(),$6=hi();Vr.defaultRandomSource=new RR.SystemRandomSource;function h1(t,e=Vr.defaultRandomSource){return e.randomBytes(t)}o(h1,"randomBytes");Vr.randomBytes=h1;function PR(t=Vr.defaultRandomSource){let e=h1(4,t),r=(0,NR.readUint32LE)(e);return(0,$6.wipe)(e),r}o(PR,"randomUint32");Vr.randomUint32=PR;var F6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function q6(t,e=F6,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=h1(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,$6.wipe)(c)}return n}o(q6,"randomString");Vr.randomString=q6;function LR(t,e=F6,r=Vr.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return q6(n,e,r)}o(LR,"randomStringForEntropy");Vr.randomStringForEntropy=LR});var K6=De(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var Zf=Sa(),Xf=hi();Go.DIGEST_LENGTH=64;Go.BLOCK_SIZE=128;var z6=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(){Xf.wipe(this._buffer),Xf.wipe(this._tempHi),Xf.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&&(d1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=d1(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;Zf.writeUint32BE(i,this._buffer,c-8),Zf.writeUint32BE(a,this._buffer,c-4),d1(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,c),this._finished=!0}for(var u=0;u<this.digestLength/8;u++)Zf.writeUint32BE(this._stateHi[u],e,u*8),Zf.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){Xf.wipe(e.stateHi),Xf.wipe(e.stateLo),e.buffer&&Xf.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();Go.SHA512=z6;var H6=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 d1(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],K=n[7],q,j,le,T,h,y,b,l;c>=128;){for(var p=0;p<16;p++){var _=8*p+a;t[p]=Zf.readUint32BE(i,_),e[p]=Zf.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,F=W,$=Q,ee=Y,ne=oe,ae=K;if(q=D,j=K,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=(S>>>14|Q<<32-14)^(S>>>18|Q<<32-18)^(Q>>>41-32|S<<32-(41-32)),j=(Q>>>14|S<<32-14)^(Q>>>18|S<<32-18)^(S>>>41-32|Q<<32-(41-32)),h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,q=S&O^~S&R,j=Q&Y^~Q&oe,h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,q=H6[p*2],j=H6[p*2+1],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,q=t[p%16],j=e[p%16],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,le=b&65535|l<<16,T=h&65535|y<<16,q=le,j=T,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=(u>>>28|P<<32-28)^(P>>>34-32|u<<32-(34-32))^(P>>>39-32|u<<32-(39-32)),j=(P>>>28|u<<32-28)^(u>>>34-32|P<<32-(34-32))^(u>>>39-32|P<<32-(39-32)),h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,q=u&m^u&v^m&v,j=P&J^P&L^J&L,h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,he=b&65535|l<<16,ae=h&65535|y<<16,q=C,j=F,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=le,j=T,h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,C=b&65535|l<<16,F=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=F,Y=$,oe=ee,K=ne,P=ae,p%16===15)for(var _=0;_<16;_++)q=t[_],j=e[_],h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=t[(_+9)%16],j=e[(_+9)%16],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,le=t[(_+1)%16],T=e[(_+1)%16],q=(le>>>1|T<<32-1)^(le>>>8|T<<32-8)^le>>>7,j=(T>>>1|le<<32-1)^(T>>>8|le<<32-8)^(T>>>7|le<<32-7),h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,le=t[(_+14)%16],T=e[(_+14)%16],q=(le>>>19|T<<32-19)^(T>>>61-32|le<<32-(61-32))^le>>>6,j=(T>>>19|le<<32-19)^(le>>>61-32|T<<32-(61-32))^(T>>>6|le<<32-6),h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,t[_]=b&65535|l<<16,e[_]=h&65535|y<<16}q=u,j=P,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[0],j=n[0],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[0]=u=b&65535|l<<16,n[0]=P=h&65535|y<<16,q=m,j=J,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[1],j=n[1],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[1]=m=b&65535|l<<16,n[1]=J=h&65535|y<<16,q=v,j=L,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[2],j=n[2],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[2]=v=b&65535|l<<16,n[2]=L=h&65535|y<<16,q=x,j=W,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[3],j=n[3],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[3]=x=b&65535|l<<16,n[3]=W=h&65535|y<<16,q=S,j=Q,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[4],j=n[4],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[4]=S=b&65535|l<<16,n[4]=Q=h&65535|y<<16,q=O,j=Y,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[5],j=n[5],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[5]=O=b&65535|l<<16,n[5]=Y=h&65535|y<<16,q=R,j=oe,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[6],j=n[6],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[6]=R=b&65535|l<<16,n[6]=oe=h&65535|y<<16,q=D,j=K,h=j&65535,y=j>>>16,b=q&65535,l=q>>>16,q=r[7],j=n[7],h+=j&65535,y+=j>>>16,b+=q&65535,l+=q>>>16,y+=h>>>16,b+=y>>>16,l+=b>>>16,r[7]=D=b&65535|l<<16,n[7]=K=h&65535|y<<16,a+=128,c-=128}return a}o(d1,"hashBlocks");function BR(t){var e=new z6;e.update(t);var r=e.digest();return e.clean(),r}o(BR,"hash");Go.hash=BR});var _u=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 UR=Oa(),xu=K6(),J6=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 $R=new Uint8Array(32);$R[0]=9;var b1=Ge(),Qf=Ge([1]),FR=Ge([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),qR=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]),G6=Ge([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),HR=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 p1(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(p1,"car25519");function Y6(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(Y6,"sel25519");function wu(t,e){let r=Ge(),n=Ge();for(let i=0;i<16;i++)n[i]=e[i];p1(n),p1(n),p1(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,Y6(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(wu,"pack25519");function X6(t,e){let r=0;for(let n=0;n<32;n++)r|=t[n]^e[n];return(1&r-1>>>8)-1}o(X6,"verify32");function V6(t,e){let r=new Uint8Array(32),n=new Uint8Array(32);return wu(r,t),wu(n,e),X6(r,n)}o(V6,"neq25519");function Z6(t){let e=new Uint8Array(32);return wu(e,t),e[0]&1}o(Z6,"par25519");function zR(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(zR,"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,K=0,q=0,j=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],F=r[8],$=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*F,D+=n*$,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*F,P+=n*$,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*F,J+=n*$,L+=n*ee,W+=n*ne,Q+=n*ae,Y+=n*Ae,oe+=n*ge,K+=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*F,L+=n*$,W+=n*ee,Q+=n*ne,Y+=n*ae,oe+=n*Ae,K+=n*ge,q+=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*F,W+=n*$,Q+=n*ee,Y+=n*ne,oe+=n*ae,K+=n*Ae,q+=n*ge,j+=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*F,Q+=n*$,Y+=n*ee,oe+=n*ne,K+=n*ae,q+=n*Ae,j+=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*F,Y+=n*$,oe+=n*ee,K+=n*ne,q+=n*ae,j+=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*F,oe+=n*$,K+=n*ee,q+=n*ne,j+=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*F,K+=n*$,q+=n*ee,j+=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,K+=n*F,q+=n*$,j+=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,K+=n*se,q+=n*F,j+=n*$,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,K+=n*Z,q+=n*se,j+=n*F,le+=n*$,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,K+=n*I,q+=n*Z,j+=n*se,le+=n*F,T+=n*$,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,K+=n*he,q+=n*I,j+=n*Z,le+=n*se,T+=n*F,h+=n*$,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,K+=n*k,q+=n*he,j+=n*I,le+=n*Z,T+=n*se,h+=n*F,y+=n*$,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,K+=n*w,q+=n*k,j+=n*he,le+=n*I,T+=n*Z,h+=n*se,y+=n*F,b+=n*$,l+=n*ee,p+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*K,u+=38*q,m+=38*j,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 Q6(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(Q6,"inv25519");function KR(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(KR,"pow2523");function g1(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,qR),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(g1,"edadd");function W6(t,e,r){for(let n=0;n<4;n++)Y6(t[n],e[n],r)}o(W6,"cswap");function y1(t,e){let r=Ge(),n=Ge(),i=Ge();Q6(i,e[2]),Yt(r,e[0],i),Yt(n,e[1],i),wu(t,n),t[31]^=Z6(r)<<7}o(y1,"pack");function ex(t,e,r){Ns(t[0],b1),Ns(t[1],Qf),Ns(t[2],Qf),Ns(t[3],b1);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(n&7)&1;W6(t,e,i),g1(e,t),g1(t,t),W6(t,e,i)}}o(ex,"scalarmult");function x1(t,e){let r=[Ge(),Ge(),Ge(),Ge()];Ns(r[0],j6),Ns(r[1],G6),Ns(r[2],Qf),Yt(r[3],j6,G6),ex(t,r,e)}o(x1,"scalarbase");function tx(t){if(t.length!==Gt.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Gt.SEED_LENGTH} bytes`);let e=(0,xu.hash)(t);e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(32),n=[Ge(),Ge(),Ge(),Ge()];x1(n,e),y1(r,n);let i=new Uint8Array(64);return i.set(t),i.set(r,32),{publicKey:r,secretKey:i}}o(tx,"generateKeyPairFromSeed");Gt.generateKeyPairFromSeed=tx;function jR(t){let e=(0,UR.randomBytes)(32,t),r=tx(e);return(0,J6.wipe)(e),r}o(jR,"generateKeyPair");Gt.generateKeyPair=jR;function GR(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(GR,"extractPublicKeyFromSecretKey");Gt.extractPublicKeyFromSecretKey=GR;var m1=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 rx(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]*m1[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)*m1[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*m1[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=e[n]&255}o(rx,"modL");function v1(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;rx(t,e)}o(v1,"reduce");function VR(t,e){let r=new Float64Array(64),n=[Ge(),Ge(),Ge(),Ge()],i=(0,xu.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 xu.SHA512;c.update(a.subarray(32)),c.update(e);let u=c.digest();c.clean(),v1(u),x1(n,u),y1(a,n),c.reset(),c.update(a.subarray(0,32)),c.update(t.subarray(32)),c.update(e);let m=c.digest();v1(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 rx(a.subarray(32),r),a}o(VR,"sign");Gt.sign=VR;function nx(t,e){let r=Ge(),n=Ge(),i=Ge(),a=Ge(),c=Ge(),u=Ge(),m=Ge();return Ns(t[2],Qf),zR(t[1],e),Na(i,t[1]),Yt(a,i,FR),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),KR(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),V6(n,i)&&Yt(t[0],t[0],HR),Na(n,t[0]),Yt(n,n,a),V6(n,i)?-1:(Z6(t[0])===e[31]>>7&&Pa(t[0],b1,t[0]),Yt(t[3],t[0],t[1]),0)}o(nx,"unpackneg");function WR(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(nx(a,t))return!1;let c=new xu.SHA512;c.update(r.subarray(0,32)),c.update(t),c.update(e);let u=c.digest();return v1(u),ex(i,a,u),x1(a,r.subarray(32)),g1(i,a),y1(n,i),!X6(r,n)}o(WR,"verify");Gt.verify=WR;function JR(t){let e=[Ge(),Ge(),Ge(),Ge()];if(nx(e,t))throw new Error("Ed25519: invalid public key");let r=Ge(),n=Ge(),i=e[1];Ra(r,Qf,i),Pa(n,Qf,i),Q6(n,n),Yt(r,r,n);let a=new Uint8Array(32);return wu(a,r),a}o(JR,"convertPublicKeyToX25519");Gt.convertPublicKeyToX25519=JR;function YR(t){let e=(0,xu.hash)(t.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;let r=new Uint8Array(e.subarray(0,32));return(0,J6.wipe)(e),r}o(YR,"convertSecretKeyToX25519");Gt.convertSecretKeyToX25519=YR});var ox=De((HK,ix)=>{"use strict";ix.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 cx=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 XR=Oa(),ZR=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 sx=new Uint8Array(32);sx[0]=9;var QR=lo([56129,1]);function w1(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(w1,"car25519");function Eu(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(Eu,"sel25519");function eN(t,e){let r=lo(),n=lo();for(let i=0;i<16;i++)n[i]=e[i];w1(n),w1(n),w1(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,Eu(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(eN,"pack25519");function tN(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}o(tN,"unpack25519");function id(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}o(id,"add");function od(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}o(od,"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,K=0,q=0,j=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],F=r[8],$=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*F,D+=n*$,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*F,P+=n*$,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*F,J+=n*$,L+=n*ee,W+=n*ne,Q+=n*ae,Y+=n*Ae,oe+=n*ge,K+=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*F,L+=n*$,W+=n*ee,Q+=n*ne,Y+=n*ae,oe+=n*Ae,K+=n*ge,q+=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*F,W+=n*$,Q+=n*ee,Y+=n*ne,oe+=n*ae,K+=n*Ae,q+=n*ge,j+=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*F,Q+=n*$,Y+=n*ee,oe+=n*ne,K+=n*ae,q+=n*Ae,j+=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*F,Y+=n*$,oe+=n*ee,K+=n*ne,q+=n*ae,j+=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*F,oe+=n*$,K+=n*ee,q+=n*ne,j+=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*F,K+=n*$,q+=n*ee,j+=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,K+=n*F,q+=n*$,j+=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,K+=n*se,q+=n*F,j+=n*$,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,K+=n*Z,q+=n*se,j+=n*F,le+=n*$,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,K+=n*I,q+=n*Z,j+=n*se,le+=n*F,T+=n*$,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,K+=n*he,q+=n*I,j+=n*Z,le+=n*se,T+=n*F,h+=n*$,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,K+=n*k,q+=n*he,j+=n*I,le+=n*Z,T+=n*se,h+=n*F,y+=n*$,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,K+=n*w,q+=n*k,j+=n*he,le+=n*I,T+=n*Z,h+=n*se,y+=n*F,b+=n*$,l+=n*ee,p+=n*ne,_+=n*ae,A+=n*Ae,E+=n*ge,g+=n*re,a+=38*oe,c+=38*K,u+=38*q,m+=38*j,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 Au(t,e){Vo(t,e,e)}o(Au,"square");function rN(t,e){let r=lo();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)Au(r,r),n!==2&&n!==4&&Vo(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}o(rN,"inv25519");function _1(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,tN(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;Eu(i,a,D),Eu(c,u,D),id(m,i,c),od(i,i,c),id(c,a,u),od(a,a,u),Au(u,m),Au(v,i),Vo(i,c,i),Vo(c,a,m),id(m,i,c),od(i,i,c),Au(a,i),od(c,u,v),Vo(i,c,QR),id(i,i,u),Vo(c,c,i),Vo(i,u,v),Vo(u,a,n),Au(a,m),Eu(i,a,D),Eu(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);rN(x,x),Vo(S,S,x);let O=new Uint8Array(32);return eN(O,S),O}o(_1,"scalarMult");lr.scalarMult=_1;function ax(t){return _1(t,sx)}o(ax,"scalarMultBase");lr.scalarMultBase=ax;function fx(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:ax(e),secretKey:e}}o(fx,"generateKeyPairFromSeed");lr.generateKeyPairFromSeed=fx;function nN(t){let e=(0,XR.randomBytes)(32,t),r=fx(e);return(0,ZR.wipe)(e),r}o(nN,"generateKeyPair");lr.generateKeyPair=nN;function iN(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=_1(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(iN,"sharedKey");lr.sharedKey=iN});var A1=De(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var Wr=Sa(),E1=hi(),oN=20;function sN(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,K=c,q=u,j=m,le=v,T=x,h=S,y=O,b=R,l=D,p=P,_=J,A=L,E=W,g=0;g<oN;g+=2)Q=Q+q|0,p^=Q,p=p>>>32-16|p<<16,h=h+p|0,q^=h,q=q>>>32-12|q<<12,Y=Y+j|0,_^=Y,_=_>>>32-16|_<<16,y=y+_|0,j^=y,j=j>>>32-12|j<<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,K=K+T|0,E^=K,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,K=K+T|0,E^=K,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+j|0,_^=Y,_=_>>>32-8|_<<8,y=y+_|0,j^=y,j=j>>>32-7|j<<7,Q=Q+q|0,p^=Q,p=p>>>32-8|p<<8,h=h+p|0,q^=h,q=q>>>32-7|q<<7,Q=Q+j|0,E^=Q,E=E>>>32-16|E<<16,b=b+E|0,j^=b,j=j>>>32-12|j<<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,K=K+q|0,A^=K,A=A>>>32-16|A<<16,y=y+A|0,q^=y,q=q>>>32-12|q<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,K=K+q|0,A^=K,A=A>>>32-8|A<<8,y=y+A|0,q^=y,q=q>>>32-7|q<<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+j|0,E^=Q,E=E>>>32-8|E<<8,b=b+E|0,j^=b,j=j>>>32-7|j<<7;Wr.writeUint32LE(Q+n|0,t,0),Wr.writeUint32LE(Y+i|0,t,4),Wr.writeUint32LE(oe+a|0,t,8),Wr.writeUint32LE(K+c|0,t,12),Wr.writeUint32LE(q+u|0,t,16),Wr.writeUint32LE(j+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(sN,"core");function ux(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){sN(u,a,t);for(var v=m;v<m+64&&v<r.length;v++)n[v]=r[v]^u[v-m];fN(a,0,c)}return E1.wipe(u),i===0&&E1.wipe(a),n}o(ux,"streamXOR");sd.streamXOR=ux;function aN(t,e,r,n){return n===void 0&&(n=0),E1.wipe(r),ux(t,e,r,r,n)}o(aN,"stream");sd.stream=aN;function fN(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(fN,"incrementCounter")});var px=De(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});var Ps=Sa(),lx=hi(),cN=A1(),uN=20;function hx(t,e,r,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=dx(t,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var c=cN.streamXOR(i,a,r,n);return lx.wipe(i),c}o(hx,"streamXOR");Su.streamXOR=hx;function lN(t,e,r){return lx.wipe(r),hx(t,e,r,r)}o(lN,"stream");Su.stream=lN;function dx(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,K=c,q=u,j=m,le=v,T=x,h=S,y=O,b=R,l=D,p=P,_=J,A=L,E=W,g=0;g<uN;g+=2)Q=Q+q|0,p^=Q,p=p>>>32-16|p<<16,h=h+p|0,q^=h,q=q>>>32-12|q<<12,Y=Y+j|0,_^=Y,_=_>>>32-16|_<<16,y=y+_|0,j^=y,j=j>>>32-12|j<<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,K=K+T|0,E^=K,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,K=K+T|0,E^=K,E=E>>>32-8|E<<8,l=l+E|0,T^=l,T=T>>>32-7|T<<7,Y=Y+j|0,_^=Y,_=_>>>32-8|_<<8,y=y+_|0,j^=y,j=j>>>32-7|j<<7,Q=Q+q|0,p^=Q,p=p>>>32-8|p<<8,h=h+p|0,q^=h,q=q>>>32-7|q<<7,Q=Q+j|0,E^=Q,E=E>>>32-16|E<<16,b=b+E|0,j^=b,j=j>>>32-12|j<<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,K=K+q|0,A^=K,A=A>>>32-16|A<<16,y=y+A|0,q^=y,q=q>>>32-12|q<<12,oe=oe+T|0,_^=oe,_=_>>>32-8|_<<8,h=h+_|0,T^=h,T=T>>>32-7|T<<7,K=K+q|0,A^=K,A=A>>>32-8|A<<8,y=y+A|0,q^=y,q=q>>>32-7|q<<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+j|0,E^=Q,E=E>>>32-8|E<<8,b=b+E|0,j^=b,j=j>>>32-7|j<<7;return Ps.writeUint32LE(Q,r,0),Ps.writeUint32LE(Y,r,4),Ps.writeUint32LE(oe,r,8),Ps.writeUint32LE(K,r,12),Ps.writeUint32LE(p,r,16),Ps.writeUint32LE(_,r,20),Ps.writeUint32LE(A,r,24),Ps.writeUint32LE(E,r,28),r}o(dx,"hchacha");Su.hchacha=dx});var S1=De(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});function hN(t,e,r){return~(t-1)&e|t-1&r}o(hN,"select");ec.select=hN;function dN(t,e){return(t|0)-(e|0)-1>>>31&1}o(dN,"lessOrEqual");ec.lessOrEqual=dN;function mx(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(mx,"compare");ec.compare=mx;function pN(t,e){return t.length===0||e.length===0?!1:mx(t,e)!==0}o(pN,"equal");ec.equal=pN});var gx=De(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var mN=S1(),ad=hi();Wo.DIGEST_LENGTH=16;var bx=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],K=this._r[7],q=this._r[8],j=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*j),E+=u*(5*q),E+=m*(5*K),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*j),g+=m*(5*q),g+=v*(5*K),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*j),C+=v*(5*q),A=C>>>13,C&=8191,C+=x*(5*K),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*j),A=N>>>13,N&=8191,N+=x*(5*q),N+=S*(5*K),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*j),w+=S*(5*q),w+=O*(5*K),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*j),k+=O*(5*q),k+=R*(5*K),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*j),he+=R*(5*q),he+=D*(5*K),A+=he>>>13,he&=8191;var I=A;I+=a*K,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*j),I+=D*(5*q),A+=I>>>13,I&=8191;var Z=A;Z+=a*q,Z+=c*K,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*j),A+=Z>>>13,Z&=8191;var se=A;se+=a*j,se+=c*q,se+=u*K,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 ad.wipe(this._buffer),ad.wipe(this._r),ad.wipe(this._h),ad.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();Wo.Poly1305=bx;function bN(t,e){var r=new bx(t);r.update(e);var n=r.digest();return r.clean(),n}o(bN,"oneTimeAuth");Wo.oneTimeAuth=bN;function gN(t,e){return t.length!==Wo.DIGEST_LENGTH||e.length!==Wo.DIGEST_LENGTH?!1:mN.equal(t,e)}o(gN,"equal");Wo.equal=gN});var xx=De(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var fd=A1(),vN=gx(),Mu=hi(),vx=Sa(),yN=S1();Jo.KEY_LENGTH=32;Jo.NONCE_LENGTH=12;Jo.TAG_LENGTH=16;var yx=new Uint8Array(16),xN=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);fd.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 fd.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),Mu.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);fd.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),!yN.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 fd.streamXOR(this._key,a,r.subarray(0,r.length-this.tagLength),v,4),Mu.wipe(a),v},t.prototype.clean=function(){return Mu.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var a=new vN.Poly1305(r);i&&(a.update(i),i.length%16>0&&a.update(yx.subarray(i.length%16))),a.update(n),n.length%16>0&&a.update(yx.subarray(n.length%16));var c=new Uint8Array(8);i&&vx.writeUint64LE(i.length,c),a.update(c),vx.writeUint64LE(n.length,c),a.update(c);for(var u=a.digest(),m=0;m<u.length;m++)e[m]=u[m];a.clean(),Mu.wipe(u),Mu.wipe(c)},t}();Jo.ChaCha20Poly1305=xN});var Ex=De(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var wx=px(),_x=xx(),Tu=hi();Yo.KEY_LENGTH=32;Yo.NONCE_LENGTH=24;Yo.TAG_LENGTH=16;var wN=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=wx.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new _x.ChaCha20Poly1305(a),m=u.seal(c,r,n,i);return Tu.wipe(a),Tu.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=wx.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new _x.ChaCha20Poly1305(a),m=u.open(c,r,n,i);return Tu.wipe(a),Tu.wipe(c),u.clean(),m},t.prototype.clean=function(){return Tu.wipe(this._key),this},t}();Yo.XChaCha20Poly1305=wN});var zi=De((EG,h4)=>{h4.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 Bu=De((AG,d4)=>{d4.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 b4=De($r=>{var p4=$r,Md=4294967292,Td=4294967293,X1=4294967294,m4=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"],qP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),qn=[];qP.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 Td;let J=((D&Be[5])<<6)+(P&Be[6]);return J<128?Md:J}o(r,"bytes2");function n(D,P,J){if((J&192)!==128||(P&192)!==128)return Td;let L=((D&Be[4])<<12)+((P&Be[6])<<6)+(J&Be[6]);return L<2048?Md:L>=55296&&L<=57343?X1:L}o(n,"bytes3");function i(D,P,J,L){if((L&192)!==128||(J&192)!==128||(P&192)!==128)return Td;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?Md:W>1114111?X1: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=m4;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===m4?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${P}`):a===Td?new RangeError(`utf8.decode: illegal trailing byte found at: ${P}`):a===X1?new RangeError(`utf8.decode: code point out of range found at: ${P}`):a===Md?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 p4.utf16le.encode(t).toString("utf16le")},decode(t){return p4.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 Uu=13,yi=10;$r.lineEnds={crlf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Uu:r+1<t.length&&t[r+1]===yi?r+=2:r+=1,e.push(Uu),e.push(yi);break;case yi:e.push(Uu),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(Uu),e.push(yi)),e},lf(t){let e=[],r=0;for(;r<t.length;)switch(t[r]){case Uu: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
|
+
${a}${c}${u}${m}`,r=4;break;case 75:e+=`${a}\r
|
|
36
|
+
${c}${u}${m}`,r=3;break;case 74:e+=`${a+c}\r
|
|
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 tb=De(Fu=>{var g4=Fu,zt=b4(),$u="UTF8",Q1="UTF16",po="UTF16BE",Zo="UTF16LE",eb="UTF32",mo="UTF32BE",Qo="UTF32LE",cc="UINT7",v4="ASCII",y4="BINARY",uc="UINT8",x4="UINT16",Cd="UINT16LE",lc="UINT16BE",w4="UINT32",kd="UINT32LE",hc="UINT32BE",Id="ESCAPED",Fs="STRING",HP=o(function(e){e.type=$u;let r=e.data;e.bom=0,r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191&&(e.bom=3)},"bom8"),zP=o(function(e){let r=e.data;switch(e.bom=0,e.type){case Q1:e.type=po,r.length>=2&&(r[0]===254&&r[1]===255?e.bom=2:r[0]===255&&r[1]===254&&(e.type=Zo,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 "${Zo}"`)}break;case Zo:if(e.type=Zo,r.length>=0){if(r[0]===254&&r[1]===255)throw new TypeError(`src type: "${Zo}" 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"),KP=o(function(e){let r=e.data;switch(e.bom=0,e.type){case eb: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=Qo,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 ${Qo}"`);break;case Qo:if(e.type=Qo,r.length>=4){if(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255)throw new TypeError(`src type: "${Qo}" 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"),jP=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===Fs)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${Fs}`);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 $u:HP(i);break;case Q1:case po:case Zo:zP(i);break;case eb:case mo:case Qo:KP(i);break;case x4:i.type=lc;break;case w4:i.type=hc;break;case v4:i.type=cc;break;case y4:i.type=uc;break;case cc:case uc:case Cd:case lc:case kd:case hc:case Fs:case Id:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===Fs){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"),GP=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 $u:case po:case Zo:case mo:case Qo:case cc:case uc:case Cd:case lc:case kd:case hc:case Id:break;case Fs:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${Fs}`);break;case v4:i.type=cc;break;case y4:i.type=uc;break;case Q1:i.type=po;break;case eb:i.type=mo;break;case x4:i.type=lc;break;case w4:i.type=hc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),Z1=o(function(e,r){switch(e){case $u:return zt.utf8.encode(r);case po:return zt.utf16be.encode(r);case Zo:return zt.utf16le.encode(r);case mo:return zt.utf32be.encode(r);case Qo:return zt.utf32le.encode(r);case cc:return zt.uint7.encode(r);case uc:return zt.uint8.encode(r);case lc:return zt.uint16be.encode(r);case Cd:return zt.uint16le.encode(r);case hc:return zt.uint32be.encode(r);case kd:return zt.uint32le.encode(r);case Fs:return zt.string.encode(r);case Id:return zt.escaped.encode(r);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),VP=o(function(e){switch(e.type){case $u:return zt.utf8.decode(e.data,e.bom);case Zo: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 Qo:return zt.utf32le.decode(e.data,e.bom);case cc:return zt.uint7.decode(e.data);case uc:return zt.uint8.decode(e.data);case lc:return zt.uint16be.decode(e.data);case Cd:return zt.uint16le.decode(e.data);case hc:return zt.uint32be.decode(e.data);case kd:return zt.uint32le.decode(e.data);case Fs:return zt.string.decode(e.data);case Id:return zt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Fu.decode=o(function(e,r){let n=jP(e,r);return VP(n)},"exportsDecode");Fu.encode=o(function(e,r){let n,i,a=GP(e,r);return a.crlf?(n=zt.lineEnds.crlf(r),i=Z1(a.type,n)):a.lf?(n=zt.lineEnds.lf(r),i=Z1(a.type,n)):i=Z1(a.type,r),a.base64&&(i=zt.base64.encode(i)),i},"exportsEncode");Fu.convert=o(function(e,r,n){return g4.encode(n,g4.decode(e,r))},"convert")});var rb=De((TG,_4)=>{_4.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
|
|
252
|
+
`},"emittcss")});var za=De(kr=>{var _n=Bu(),nb=tb(),WP=rb(),hr=zi(),qs="utilities.js: ",es=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(`${qs}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+=WP(),n+=`</style>
|
|
259
259
|
`,n+=`</head>
|
|
260
260
|
<body>
|
|
261
261
|
`,n+=`<p>${new Date}</p>
|
|
@@ -280,30 +280,30 @@ 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?
|
|
284
|
-
`,
|
|
285
|
-
`,
|
|
286
|
-
`,
|
|
287
|
-
`,O.forEach(Y=>{Y.state===e.SEM_PRE?(
|
|
288
|
-
`,
|
|
289
|
-
`):(
|
|
290
|
-
`,
|
|
291
|
-
`,V},"toSml"),this.phrases=o(function(){let N={},J,L;for(J=0;J<O.length;J+=1)L=O[J],L.state===e.SEM_PRE&&(Array.isArray(N[L.name])||(N[L.name]=[]),N[L.name].push({index:L.phraseIndex,length:L.phraseLength}));return N},"phrases")},"exportsAst")});var fb=De((aV,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((fV,I4)=>{I4.exports=o(function(){let e=zi(),r=Ha(),n="parser.js: ",i=this,a;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let c=null,u=null,p,v,y,S,O=0,R=0,I=0,N=null,J=null,L=null,V=null,Z=null,Y=0,oe=1/0,K=1/0,q=o(function(ie,U,X){let me=`${n}evaluateRule(): `;if(ie>=L.length)throw new Error(`${me}rule index: ${ie} out of range`);if(U>=y)throw new Error(`${me}phrase index: ${U} out of range`);let{length:ye}=c;c.push({type:e.RNM,index:ie}),a(ye,U,X),c.pop()},"evaluateRule"),j=o(function(ue,ie,U){let X=`${n}evaluateUdt(): `;if(ue>=V.length)throw new Error(`${X}udt index: ${ue} out of range`);if(ie>=y)throw new Error(`${X}phrase index: ${ie} out of range`);let{length:me}=c;c.push({type:e.UDT,empty:V[ue].empty,index:ue}),a(me,ie,U),c.pop()},"evaluateUdt"),le=o(function(){O=0,R=0,I=0,Y=0,S=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],L=null,V=null,u=null,p=0,v=0,y=0,N=null,J=null,Z=null,c=null},"clear"),T=o(function(){let ue=[],ie=o(function(){let X={};L.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),V.length>0&&V.forEach(me=>{me.isBkr&&(X[me.lower]=null)}),ue.push(X)},"init"),U=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(U())},"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=q,this.evaluateUdt=j,this.refresh=o(function(){ie.state=e.ACTIVE,ie.phraseLength=0,ie.lookAround=S[S.length-1]},"refresh")},"systemData"),x=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"),m=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,V,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,V,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,V)},"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,V=ue.udts},"initializeGrammar"),g=o(function(ue){let ie=`${n}initializeStartRule(): `,U=null;if(typeof ue=="number"){if(ue>=L.length)throw new Error(`${ie}start rule index too large: max: ${L.length}: index: ${ue}`);U=ue}else if(typeof ue=="string"){let X=ue.toLowerCase();for(let me=0;me<L.length;me+=1)if(X===L[me].lower){U=L[me].index;break}if(U===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 U},"initializeStartRule"),C=o(function(ie,U,X){let me=`${n}initializeInputChars(): `,ye=ie,we=U,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,p=we,v=ke,y=p+v},"initializeInputChars"),P=o(function(){let ue=`${n}initializeCallbacks(): `,ie;for(N=[],J=[],ie=0;ie<L.length;ie+=1)N[ie]=null;for(ie=0;ie<V.length;ie+=1)J[ie]=null;let U,X=[];for(ie=0;ie<L.length;ie+=1)X.push(L[ie].lower);for(ie=0;ie<V.length;ie+=1)X.push(V[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(U=i.callbacks[me],U||(U=null),typeof U=="function"||U===null)ie<L.length?N[ie]=U:J[ie-L.length]=U;else throw new Error(`${ue}syntax callback[${me}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(ie=0;ie<V.length;ie+=1)if(J[ie]===null)throw new Error(`${ue}all UDT callbacks must be defined. UDT callback[${V[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(K=Math.floor(ue),K<=0)throw new Error(`parser: max node hits must be integer > 0: ${ue}`)};let w=o(function(ue,ie,U){let X,me=`${n}parse(): `;E(ue);let ye=g(ie);P(),_(),A(),m();let we=new h;switch(U!=null&&(Z=U),c=[{type:e.RNM,index:ye}],a(0,p,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:I,inputLength:u.length,subBegin:p,subEnd:y,subLength:v}},"privateParse");this.parseSubstring=o(function(ie,U,X,me,ye,we){return le(),C(X,me,ye),w(ie,U,we)},"parseSubstring"),this.parse=o(function(ie,U,X,me){return le(),C(X,0,X.length),w(ie,U,me)},"parse");let k=o(function(ue,ie,U){let X=c[ue];for(let me=0;me<X.children.length&&(a(X.children[me],ie,U),U.state===e.NOMATCH);me+=1);},"opALT"),he=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue],It=U.uFrame.length(),Ue=U.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,U),U.state===e.NOMATCH){X=!1;break}else ye+=U.phraseLength,we+=U.phraseLength;X?(U.state=we===0?e.EMPTY:e.MATCH,U.phraseLength=we):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCAT"),D=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=y||(a(ue+1,me,U),U.state===e.NOMATCH)||U.state===e.EMPTY||(we+=1,ye+=U.phraseLength,me+=U.phraseLength,we===ke.max)););U.state===e.EMPTY||we>=ke.min?(U.state=ye===0?e.EMPTY:e.MATCH,U.phraseLength=ye):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREP"),Q=o(function(ue,ie,U,X){if(ie.phraseLength>U){let me=`${n}opRNM(${ue.name}): callback function error: `;throw me+=`sysData.phraseLength: ${ie.phraseLength}`,me+=` must be <= remaining chars: ${U}`,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,U){let X,me,ye,we,ke,It,Ue=c[ue],Oe=L[Ue.index],Bt=N[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=U.uFrame.length(),ke=U.pFrame.length(),U.uFrame.push(),U.pFrame.push(),It=U.pFrame,U.pFrame=new T),Bt===null)ye=c,c=Oe.opcodes,a(0,ie,U),c=ye;else{let Je=y-ie;U.ruleIndex=Oe.index,Bt(U,u,ie,Z),Q(Oe,U,Je,!0),U.state===e.ACTIVE&&(ye=c,c=Oe.opcodes,a(0,ie,U),c=ye,U.ruleIndex=Oe.index,Bt(U,u,ie,Z),Q(Oe,U,Je,!1))}je&&(me&&(U.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Ue.index,Oe.name,ie,U.phraseLength)),U.pFrame=It,U.state===e.NOMATCH?(U.uFrame.pop(we),U.pFrame.pop(ke)):Oe.isBkr&&(U.pFrame.savePhrase(Oe.lower,ie,U.phraseLength),U.uFrame.savePhrase(Oe.lower,ie,U.phraseLength)))},"opRNM"),F=o(function(ue,ie,U){if(ie.phraseLength>U){let X=`${n}opUDT(${ue.name}): callback function error: `;throw X+=`sysData.phraseLength: ${ie.phraseLength}`,X+=` must be <= remaining chars: ${U}`,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"),$=o(function(ue,ie,U){let X,me,ye,we,ke,It,Ue=c[ue],Oe=V[Ue.index];U.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=U.uFrame.length(),ke=U.pFrame.length(),U.uFrame.push(),U.pFrame.push(),It=U.pFrame,U.pFrame=new T);let je=y-ie;J[Ue.index](U,u,ie,Z),F(Oe,U,je),Bt&&(ye&&(U.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Oe.name,ie,U.phraseLength)),U.pFrame=It,U.state===e.NOMATCH?(U.uFrame.pop(we),U.pFrame.pop(ke)):Oe.isBkr&&(U.pFrame.savePhrase(Oe.lower,ie,U.phraseLength),U.uFrame.savePhrase(Oe.lower,ie,U.phraseLength)))},"opUDT"),ee=o(function(ue,ie,U){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:y,charsLength:v}),y=u.length,v=u.length-p,a(ue+1,ie,U);let X=S.pop();switch(y=X.charsEnd,v=X.charsLength,U.phraseLength=0,U.state){case e.EMPTY:U.state=e.EMPTY;break;case e.MATCH:U.state=e.EMPTY;break;case e.NOMATCH:U.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${U.state}`)}},"opAND"),ne=o(function(ue,ie,U){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:y,charsLength:v}),y=u.length,v=u.length-p,a(ue+1,ie,U);let X=S.pop();switch(y=X.charsEnd,v=X.charsLength,U.phraseLength=0,U.state){case e.EMPTY:case e.MATCH:U.state=e.NOMATCH;break;case e.NOMATCH:U.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${U.state}`)}},"opNOT"),ae=o(function(ue,ie,U){let X=c[ue];U.state=e.NOMATCH,ie<y&&X.min<=u[ie]&&u[ie]<=X.max&&(U.state=e.MATCH,U.phraseLength=1)},"opTRG"),Ae=o(function(ue,ie,U){let X,me=c[ue],ye=me.string.length;if(U.state=e.NOMATCH,ie+ye<=y){for(X=0;X<ye;X+=1)if(u[ie+X]!==me.string[X])return;U.state=e.MATCH,U.phraseLength=ye}},"opTBS"),ge=o(function(ue,ie,U){let X,me,ye=c[ue];U.state=e.NOMATCH;let we=ye.string.length;if(we===0){U.state=e.EMPTY;return}if(ie+we<=y){for(X=0;X<we;X+=1)if(me=u[ie+X],me>=65&&me<=90&&(me+=32),me!==ye.string[X])return;U.state=e.MATCH,U.phraseLength=we}},"opTLS"),re=o(function(ue,ie,U){U.state=e.NOMATCH,U.phraseLength=0,U.state=ie===0?e.EMPTY:e.NOMATCH},"opABG"),Se=o(function(ue,ie,U){U.state=e.NOMATCH,U.phraseLength=0,U.state=ie===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ce=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];U.state=e.NOMATCH,ke.index<L.length?we=L[ke.index].lower:we=V[ke.index-L.length].lower;let It=ke.bkrMode===e.BKR_MODE_PM?U.pFrame.getPhrase(we):U.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){U.state=e.EMPTY;return}if(ie+Bt<=y){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;U.state=e.MATCH,U.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me!==ye)return;U.state=e.MATCH,U.phraseLength=Bt}},"opBKR"),ve=o(function(ue,ie,U){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,U),S.pop(),U.phraseLength=0,U.state){case e.EMPTY:U.state=e.EMPTY;break;case e.MATCH:U.state=e.EMPTY;break;case e.NOMATCH:U.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${U.state}`)}},"opBKA"),G=o(function(ue,ie,U){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,U),S.pop(),U.phraseLength=0,U.state){case e.EMPTY:case e.MATCH:U.state=e.NOMATCH;break;case e.NOMATCH:U.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${U.state}`)}},"opBKN"),pe=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue],It=U.uFrame.length(),Ue=U.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,U),ye-=U.phraseLength,we+=U.phraseLength,U.state===e.NOMATCH){X=!1;break}X?(U.state=we===0?e.EMPTY:e.MATCH,U.phraseLength=we):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCATBehind"),Ce=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(a(ue+1,me,U),U.state===e.NOMATCH)||U.state===e.EMPTY||(we+=1,ye+=U.phraseLength,me-=U.phraseLength,we===ke.max)););U.state===e.EMPTY||we>=ke.min?(U.state=ye===0?e.EMPTY:e.MATCH,U.phraseLength=ye):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREPBehind"),He=o(function(ue,ie,U){let X=c[ue];if(U.state=e.NOMATCH,U.phraseLength=0,ie>0){let me=u[ie-1];X.min<=me&&me<=X.max&&(U.state=e.MATCH,U.phraseLength=1)}},"opTRGBehind"),Re=o(function(ue,ie,U){let X,me=c[ue];U.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;U.state=e.MATCH,U.phraseLength=ye}},"opTBSBehind"),Ve=o(function(ue,ie,U){let X,me=c[ue];U.state=e.NOMATCH;let ye=me.string.length;if(ye===0){U.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;U.state=e.MATCH,U.phraseLength=ye}},"opTLSBehind"),pr=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];U.state=e.NOMATCH,U.phraseLength=0,ke.index<L.length?we=L[ke.index].lower:we=V[ke.index-L.length].lower;let It=ke.bkrMode===e.BKR_MODE_PM?U.pFrame.getPhrase(we):U.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){U.state=e.EMPTY,U.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;U.state=e.MATCH,U.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[je+X],ye=u[Oe+X],me!==ye)return;U.state=e.MATCH,U.phraseLength=Bt}},"opBKRBehind");a=o(function(ie,U,X){let me=!0,ye=c[ie];if(I+=1,I>K)throw new Error(`parser: maximum number of node hits exceeded: ${K}`);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=x();i.trace.down(ye,X.state,U,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(ie,U,X);break;case e.CAT:pe(ie,U,X);break;case e.REP:Ce(ie,U,X);break;case e.RNM:se(ie,U,X);break;case e.UDT:$(ie,U,X);break;case e.AND:ee(ie,U,X);break;case e.NOT:ne(ie,U,X);break;case e.TRG:He(ie,U,X);break;case e.TBS:Re(ie,U,X);break;case e.TLS:Ve(ie,U,X);break;case e.BKR:pr(ie,U,X);break;case e.BKA:ve(ie,U,X);break;case e.BKN:G(ie,U,X);break;case e.ABG:re(ie,U,X);break;case e.AEN:Se(ie,U,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(ie,U,X);break;case e.CAT:he(ie,U,X);break;case e.REP:D(ie,U,X);break;case e.RNM:se(ie,U,X);break;case e.UDT:$(ie,U,X);break;case e.AND:ee(ie,U,X);break;case e.NOT:ne(ie,U,X);break;case e.TRG:ae(ie,U,X);break;case e.TBS:Ae(ie,U,X);break;case e.TLS:ge(ie,U,X);break;case e.BKR:ce(ie,U,X);break;case e.BKA:ve(ie,U,X);break;case e.BKN:G(ie,U,X);break;case e.ABG:re(ie,U,X);break;case e.AEN:Se(ie,U,X);break;default:me=!1;break}if(!b()&&U+X.phraseLength>Y&&(Y=U+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=x();i.trace.up(ye,X.state,U,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var R4=De((cV,O4)=>{O4.exports=o(function(){let e=zi(),r=Ha(),n=Bu(),i="stats.js: ",a=[],c=[],u=[],p,v=[],y=[];this.statsObject="statsObject";let S="stats",O=o(function(K,q){return K.lower<q.lower?-1:K.lower>q.lower?1:0},"sortAlpha"),R=o(function(K,q){return K.total<q.total?1:K.total>q.total?-1:O(K,q)},"sortHits"),I=o(function(K,q){return K.index<q.index?-1:K.index>q.index?1:0},"sortIndex"),N=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),J=o(function(){u.length=0,p=new N,u[e.ALT]=new N,u[e.CAT]=new N,u[e.REP]=new N,u[e.RNM]=new N,u[e.TRG]=new N,u[e.TBS]=new N,u[e.TLS]=new N,u[e.UDT]=new N,u[e.AND]=new N,u[e.NOT]=new N,u[e.BKR]=new N,u[e.BKA]=new N,u[e.BKN]=new N,u[e.ABG]=new N,u[e.AEN]=new N,v.length=0;for(let K=0;K<a.length;K+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:a[K].name,lower:a[K].lower,index:a[K].index});if(c.length>0){y.length=0;for(let K=0;K<c.length;K+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:c[K].name,lower:c[K].lower,index:c[K].index})}},"clear"),L=o(function(K,q){switch(K.total+=1,q){case e.EMPTY:K.empty+=1;break;case e.MATCH:K.match+=1;break;case e.NOMATCH:K.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${q}`)}},"incStat"),V=o(function(K,q){let j="";return j+="<tr>",j+=`<td class="${n.CLASS_ACTIVE}">${K}</td>`,j+=`<td class="${n.CLASS_EMPTY}">${q.empty}</td>`,j+=`<td class="${n.CLASS_MATCH}">${q.match}</td>`,j+=`<td class="${n.CLASS_NOMATCH}">${q.nomatch}</td>`,j+=`<td class="${n.CLASS_ACTIVE}">${q.total}</td>`,j+=`</tr>
|
|
292
|
-
`,j},"displayRow"),
|
|
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?nb.encode("UTF16LE",t.slice(n,i)).toString("utf16le"):""};kr.stringToChars=function(t){return nb.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(`${qs}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(`${qs}charsToHex: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg){n+=`\\x${es.charToHex(t[i.beg])}`;for(let a=i.beg+1;a<i.end;a+=1)n+=`,\\x${es.charToHex(t[a])}`}return n};kr.charsToHtmlEntities=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}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 JP(t){return!(t>=55296&&t<=57343||t>1114111)}o(JP,"isUnicode");kr.charsToUnicode=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}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)JP(t[a])?n+=`&#${t[a]};`:n+=` U+${es.charToHex(t[a])}`;return n};kr.charsToJsUnicode=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}charsToJsUnicode: input must be an array of integers`);let i=Ha(t.length,e,r);if(i.end>i.beg){n+=`\\u${es.charToHex(t[i.beg])}`;for(let a=i.beg+1;a<i.end;a+=1)n+=`,\\u${es.charToHex(t[a])}`}return n};kr.charsToAscii=function(t,e,r){let n="";if(!Array.isArray(t))throw new Error(`${qs}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${es.charToHex(c)}`}return n};kr.charsToAsciiHtml=function(t,e,r){if(!Array.isArray(t))throw new Error(`${qs}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}">${es.asciiChars[i]}</span>`:i>127?n+=`<span class="${_n.CLASS_CTRLCHAR}">U+${es.charToHex(i)}</span>`:n+=es.asciiChars[i];return n};kr.stringToAsciiHtml=function(t){let e=nb.decode("STRING",t);return this.charsToAsciiHtml(e)}});var A4=De((kG,E4)=>{E4.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,L){S.length=0,O.length=0,v.length=0,m=0,a=P,c=J,u=L;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 L=O.length;return S.push(L),O.push({name:J,thisIndex:L,thatIndex:null,state:e.SEM_PRE,callbackIndex:P,phraseIndex:null,phraseLength:null,stack:S.length}),L},"down"),this.up=o(function(P,J,L,W){let Q=O.length,Y=S.pop();return O.push({name:J,thisIndex:Q,thatIndex:Y,state:e.SEM_POST,callbackIndex:P,phraseIndex:L,phraseLength:W,stack:S.length}),O[Y].thatIndex=Q,O[Y].phraseIndex=L,O[Y].phraseLength=W,Q},"up"),this.translate=o(function(P){let J,L,W;for(let Q=0;Q<O.length;Q+=1)W=O[Q],L=x[W.callbackIndex],W.state===e.SEM_PRE?L!==null&&(J=L(e.SEM_PRE,u,W.phraseIndex,W.phraseLength,P),J===e.SEM_SKIP&&(Q=W.thatIndex)):L!==null&&L(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,L="decimal integer character codes";if(typeof P=="string"&&P.length>=3){let Y=P.slice(0,3).toLowerCase();Y==="asc"?(J=r.charsToAscii,L="ASCII for printing characters, hex for non-printing"):Y==="hex"?(J=r.charsToHex,L="hexadecimal integer character codes"):Y==="uni"&&(J=r.charsToUnicode,L="Unicode UTF-32 integer character codes")}let W="",Q=0;return W+=`<?xml version="1.0" encoding="utf-8"?>
|
|
284
|
+
`,W+=`<root nodes="${O.length/2}" characters="${u.length}">
|
|
285
|
+
`,W+=`<!-- input string, ${L} -->
|
|
286
|
+
`,W+=R(Q+2),W+=J(u),W+=`
|
|
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
|
+
`,W+=R(Q+2),W+=J(u,Y.phraseIndex,Y.phraseLength),W+=`
|
|
289
|
+
`):(W+=R(Q),W+=`</node><!-- name="${Y.name}" -->
|
|
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 ib=De((IG,S4)=>{S4.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 T4=De((DG,M4)=>{M4.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,K=1/0,q=o(function(ie,U,X){let me=`${n}evaluateRule(): `;if(ie>=L.length)throw new Error(`${me}rule index: ${ie} out of range`);if(U>=x)throw new Error(`${me}phrase index: ${U} out of range`);let{length:ye}=c;c.push({type:e.RNM,index:ie}),a(ye,U,X),c.pop()},"evaluateRule"),j=o(function(ue,ie,U){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,U),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"),U=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(U())},"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=q,this.evaluateUdt=j,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(): `,U=null;if(typeof ue=="number"){if(ue>=L.length)throw new Error(`${ie}start rule index too large: max: ${L.length}: index: ${ue}`);U=ue}else if(typeof ue=="string"){let X=ue.toLowerCase();for(let me=0;me<L.length;me+=1)if(X===L[me].lower){U=L[me].index;break}if(U===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 U},"initializeStartRule"),C=o(function(ie,U,X){let me=`${n}initializeInputChars(): `,ye=ie,we=U,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 U,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(U=i.callbacks[me],U||(U=null),typeof U=="function"||U===null)ie<L.length?P[ie]=U:J[ie-L.length]=U;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(K=Math.floor(ue),K<=0)throw new Error(`parser: max node hits must be integer > 0: ${ue}`)};let w=o(function(ue,ie,U){let X,me=`${n}parse(): `;E(ue);let ye=g(ie);N(),_(),A(),p();let we=new h;switch(U!=null&&(Q=U),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,U,X,me,ye,we){return le(),C(X,me,ye),w(ie,U,we)},"parseSubstring"),this.parse=o(function(ie,U,X,me){return le(),C(X,0,X.length),w(ie,U,me)},"parse");let k=o(function(ue,ie,U){let X=c[ue];for(let me=0;me<X.children.length&&(a(X.children[me],ie,U),U.state===e.NOMATCH);me+=1);},"opALT"),he=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue],It=U.uFrame.length(),Ue=U.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,U),U.state===e.NOMATCH){X=!1;break}else ye+=U.phraseLength,we+=U.phraseLength;X?(U.state=we===0?e.EMPTY:e.MATCH,U.phraseLength=we):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCAT"),I=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me>=x||(a(ue+1,me,U),U.state===e.NOMATCH)||U.state===e.EMPTY||(we+=1,ye+=U.phraseLength,me+=U.phraseLength,we===ke.max)););U.state===e.EMPTY||we>=ke.min?(U.state=ye===0?e.EMPTY:e.MATCH,U.phraseLength=ye):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREP"),Z=o(function(ue,ie,U,X){if(ie.phraseLength>U){let me=`${n}opRNM(${ue.name}): callback function error: `;throw me+=`sysData.phraseLength: ${ie.phraseLength}`,me+=` must be <= remaining chars: ${U}`,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,U){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=U.uFrame.length(),ke=U.pFrame.length(),U.uFrame.push(),U.pFrame.push(),It=U.pFrame,U.pFrame=new T),Bt===null)ye=c,c=Oe.opcodes,a(0,ie,U),c=ye;else{let Je=x-ie;U.ruleIndex=Oe.index,Bt(U,u,ie,Q),Z(Oe,U,Je,!0),U.state===e.ACTIVE&&(ye=c,c=Oe.opcodes,a(0,ie,U),c=ye,U.ruleIndex=Oe.index,Bt(U,u,ie,Q),Z(Oe,U,Je,!1))}je&&(me&&(U.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(Ue.index,Oe.name,ie,U.phraseLength)),U.pFrame=It,U.state===e.NOMATCH?(U.uFrame.pop(we),U.pFrame.pop(ke)):Oe.isBkr&&(U.pFrame.savePhrase(Oe.lower,ie,U.phraseLength),U.uFrame.savePhrase(Oe.lower,ie,U.phraseLength)))},"opRNM"),F=o(function(ue,ie,U){if(ie.phraseLength>U){let X=`${n}opUDT(${ue.name}): callback function error: `;throw X+=`sysData.phraseLength: ${ie.phraseLength}`,X+=` must be <= remaining chars: ${U}`,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"),$=o(function(ue,ie,U){let X,me,ye,we,ke,It,Ue=c[ue],Oe=W[Ue.index];U.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=U.uFrame.length(),ke=U.pFrame.length(),U.uFrame.push(),U.pFrame.push(),It=U.pFrame,U.pFrame=new T);let je=x-ie;J[Ue.index](U,u,ie,Q),F(Oe,U,je),Bt&&(ye&&(U.state===e.NOMATCH?i.ast.setLength(X):i.ast.up(me,Oe.name,ie,U.phraseLength)),U.pFrame=It,U.state===e.NOMATCH?(U.uFrame.pop(we),U.pFrame.pop(ke)):Oe.isBkr&&(U.pFrame.savePhrase(Oe.lower,ie,U.phraseLength),U.uFrame.savePhrase(Oe.lower,ie,U.phraseLength)))},"opUDT"),ee=o(function(ue,ie,U){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:x,charsLength:v}),x=u.length,v=u.length-m,a(ue+1,ie,U);let X=S.pop();switch(x=X.charsEnd,v=X.charsLength,U.phraseLength=0,U.state){case e.EMPTY:U.state=e.EMPTY;break;case e.MATCH:U.state=e.EMPTY;break;case e.NOMATCH:U.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${U.state}`)}},"opAND"),ne=o(function(ue,ie,U){S.push({lookAround:e.LOOKAROUND_AHEAD,anchor:ie,charsEnd:x,charsLength:v}),x=u.length,v=u.length-m,a(ue+1,ie,U);let X=S.pop();switch(x=X.charsEnd,v=X.charsLength,U.phraseLength=0,U.state){case e.EMPTY:case e.MATCH:U.state=e.NOMATCH;break;case e.NOMATCH:U.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${U.state}`)}},"opNOT"),ae=o(function(ue,ie,U){let X=c[ue];U.state=e.NOMATCH,ie<x&&X.min<=u[ie]&&u[ie]<=X.max&&(U.state=e.MATCH,U.phraseLength=1)},"opTRG"),Ae=o(function(ue,ie,U){let X,me=c[ue],ye=me.string.length;if(U.state=e.NOMATCH,ie+ye<=x){for(X=0;X<ye;X+=1)if(u[ie+X]!==me.string[X])return;U.state=e.MATCH,U.phraseLength=ye}},"opTBS"),ge=o(function(ue,ie,U){let X,me,ye=c[ue];U.state=e.NOMATCH;let we=ye.string.length;if(we===0){U.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;U.state=e.MATCH,U.phraseLength=we}},"opTLS"),re=o(function(ue,ie,U){U.state=e.NOMATCH,U.phraseLength=0,U.state=ie===0?e.EMPTY:e.NOMATCH},"opABG"),Se=o(function(ue,ie,U){U.state=e.NOMATCH,U.phraseLength=0,U.state=ie===u.length?e.EMPTY:e.NOMATCH},"opAEN"),ce=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];U.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?U.pFrame.getPhrase(we):U.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){U.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;U.state=e.MATCH,U.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[ie+X],ye=u[Oe+X],me!==ye)return;U.state=e.MATCH,U.phraseLength=Bt}},"opBKR"),ve=o(function(ue,ie,U){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,U),S.pop(),U.phraseLength=0,U.state){case e.EMPTY:U.state=e.EMPTY;break;case e.MATCH:U.state=e.EMPTY;break;case e.NOMATCH:U.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${U.state}`)}},"opBKA"),G=o(function(ue,ie,U){switch(S.push({lookAround:e.LOOKAROUND_BEHIND,anchor:ie}),a(ue+1,ie,U),S.pop(),U.phraseLength=0,U.state){case e.EMPTY:case e.MATCH:U.state=e.NOMATCH;break;case e.NOMATCH:U.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${U.state}`)}},"opBKN"),pe=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue],It=U.uFrame.length(),Ue=U.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,U),ye-=U.phraseLength,we+=U.phraseLength,U.state===e.NOMATCH){X=!1;break}X?(U.state=we===0?e.EMPTY:e.MATCH,U.phraseLength=we):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(me))},"opCATBehind"),Ce=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];me=ie,ye=0,we=0;let It=U.uFrame.length(),Ue=U.pFrame.length();i.ast&&(X=i.ast.getLength());let Oe=!0;for(;Oe&&!(me<=0||(a(ue+1,me,U),U.state===e.NOMATCH)||U.state===e.EMPTY||(we+=1,ye+=U.phraseLength,me-=U.phraseLength,we===ke.max)););U.state===e.EMPTY||we>=ke.min?(U.state=ye===0?e.EMPTY:e.MATCH,U.phraseLength=ye):(U.state=e.NOMATCH,U.phraseLength=0,U.uFrame.pop(It),U.pFrame.pop(Ue),i.ast&&i.ast.setLength(X))},"opREPBehind"),He=o(function(ue,ie,U){let X=c[ue];if(U.state=e.NOMATCH,U.phraseLength=0,ie>0){let me=u[ie-1];X.min<=me&&me<=X.max&&(U.state=e.MATCH,U.phraseLength=1)}},"opTRGBehind"),Re=o(function(ue,ie,U){let X,me=c[ue];U.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;U.state=e.MATCH,U.phraseLength=ye}},"opTBSBehind"),Ve=o(function(ue,ie,U){let X,me=c[ue];U.state=e.NOMATCH;let ye=me.string.length;if(ye===0){U.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;U.state=e.MATCH,U.phraseLength=ye}},"opTLSBehind"),pr=o(function(ue,ie,U){let X,me,ye,we,ke=c[ue];U.state=e.NOMATCH,U.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?U.pFrame.getPhrase(we):U.uFrame.getPhrase(we),Ue=ke.bkrCase===e.BKR_MODE_CI;if(It===null)return;let Oe=It.phraseIndex,Bt=It.phraseLength;if(Bt===0){U.state=e.EMPTY,U.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;U.state=e.MATCH,U.phraseLength=Bt}else for(X=0;X<Bt;X+=1)if(me=u[je+X],ye=u[Oe+X],me!==ye)return;U.state=e.MATCH,U.phraseLength=Bt}},"opBKRBehind");a=o(function(ie,U,X){let me=!0,ye=c[ie];if(D+=1,D>K)throw new Error(`parser: maximum number of node hits exceeded: ${K}`);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,U,X.phraseLength,we.anchor,we.lookAround)}if(l())switch(ye.type){case e.ALT:k(ie,U,X);break;case e.CAT:pe(ie,U,X);break;case e.REP:Ce(ie,U,X);break;case e.RNM:se(ie,U,X);break;case e.UDT:$(ie,U,X);break;case e.AND:ee(ie,U,X);break;case e.NOT:ne(ie,U,X);break;case e.TRG:He(ie,U,X);break;case e.TBS:Re(ie,U,X);break;case e.TLS:Ve(ie,U,X);break;case e.BKR:pr(ie,U,X);break;case e.BKA:ve(ie,U,X);break;case e.BKN:G(ie,U,X);break;case e.ABG:re(ie,U,X);break;case e.AEN:Se(ie,U,X);break;default:me=!1;break}else switch(ye.type){case e.ALT:k(ie,U,X);break;case e.CAT:he(ie,U,X);break;case e.REP:I(ie,U,X);break;case e.RNM:se(ie,U,X);break;case e.UDT:$(ie,U,X);break;case e.AND:ee(ie,U,X);break;case e.NOT:ne(ie,U,X);break;case e.TRG:ae(ie,U,X);break;case e.TBS:Ae(ie,U,X);break;case e.TLS:ge(ie,U,X);break;case e.BKR:ce(ie,U,X);break;case e.BKA:ve(ie,U,X);break;case e.BKN:G(ie,U,X);break;case e.ABG:re(ie,U,X);break;case e.AEN:Se(ie,U,X);break;default:me=!1;break}if(!b()&&U+X.phraseLength>Y&&(Y=U+X.phraseLength),i.stats!==null&&i.stats.collect(ye,X),i.trace!==null){let we=y();i.trace.up(ye,X.state,U,X.phraseLength,we.anchor,we.lookAround)}return O-=1,me},"opExecuteFunc")},"parser")});var k4=De((OG,C4)=>{C4.exports=o(function(){let e=zi(),r=za(),n=Bu(),i="stats.js: ",a=[],c=[],u=[],m,v=[],x=[];this.statsObject="statsObject";let S="stats",O=o(function(K,q){return K.lower<q.lower?-1:K.lower>q.lower?1:0},"sortAlpha"),R=o(function(K,q){return K.total<q.total?1:K.total>q.total?-1:O(K,q)},"sortHits"),D=o(function(K,q){return K.index<q.index?-1:K.index>q.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 K=0;K<a.length;K+=1)v.push({empty:0,match:0,nomatch:0,total:0,name:a[K].name,lower:a[K].lower,index:a[K].index});if(c.length>0){x.length=0;for(let K=0;K<c.length;K+=1)x.push({empty:0,match:0,nomatch:0,total:0,name:c[K].name,lower:c[K].lower,index:c[K].index})}},"clear"),L=o(function(K,q){switch(K.total+=1,q){case e.EMPTY:K.empty+=1;break;case e.MATCH:K.match+=1;break;case e.NOMATCH:K.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${q}`)}},"incStat"),W=o(function(K,q){let j="";return j+="<tr>",j+=`<td class="${n.CLASS_ACTIVE}">${K}</td>`,j+=`<td class="${n.CLASS_EMPTY}">${q.empty}</td>`,j+=`<td class="${n.CLASS_MATCH}">${q.match}</td>`,j+=`<td class="${n.CLASS_NOMATCH}">${q.nomatch}</td>`,j+=`<td class="${n.CLASS_ACTIVE}">${q.total}</td>`,j+=`</tr>
|
|
292
|
+
`,j},"displayRow"),Q=o(function(){let K="";return K+=W("ALT",u[e.ALT]),K+=W("CAT",u[e.CAT]),K+=W("REP",u[e.REP]),K+=W("RNM",u[e.RNM]),K+=W("TRG",u[e.TRG]),K+=W("TBS",u[e.TBS]),K+=W("TLS",u[e.TLS]),K+=W("UDT",u[e.UDT]),K+=W("AND",u[e.AND]),K+=W("NOT",u[e.NOT]),K+=W("BKR",u[e.BKR]),K+=W("BKA",u[e.BKA]),K+=W("BKN",u[e.BKN]),K+=W("ABG",u[e.ABG]),K+=W("AEN",u[e.AEN]),K+=W("totals",m),K},"displayOpsOnly"),Y=o(function(){let K="";K+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
293
293
|
`,K+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
|
|
294
294
|
`;for(let q=0;q<a.length;q+=1)v[q].total>0&&(K+="<tr>",K+=`<td class="${n.CLASS_ACTIVE}">${v[q].name}</td>`,K+=`<td class="${n.CLASS_EMPTY}">${v[q].empty}</td>`,K+=`<td class="${n.CLASS_MATCH}">${v[q].match}</td>`,K+=`<td class="${n.CLASS_NOMATCH}">${v[q].nomatch}</td>`,K+=`<td class="${n.CLASS_ACTIVE}">${v[q].total}</td>`,K+=`</tr>
|
|
295
295
|
`);if(c.length>0){K+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
296
296
|
`,K+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
|
|
297
|
-
`;for(let q=0;q<c.length;q+=1)
|
|
298
|
-
`)}return K},"displayRules");this.validate=o(function(K){let q=!1;return typeof K=="string"&&S===K&&(q=!0),q},"validate"),this.init=o(function(K,q){a=K,c=q,J()},"init"),this.collect=o(function(K,q){L(
|
|
297
|
+
`;for(let q=0;q<c.length;q+=1)x[q].total>0&&(K+="<tr>",K+=`<td class="${n.CLASS_ACTIVE}">${x[q].name}</td>`,K+=`<td class="${n.CLASS_EMPTY}">${x[q].empty}</td>`,K+=`<td class="${n.CLASS_MATCH}">${x[q].match}</td>`,K+=`<td class="${n.CLASS_NOMATCH}">${x[q].nomatch}</td>`,K+=`<td class="${n.CLASS_ACTIVE}">${x[q].total}</td>`,K+=`</tr>
|
|
298
|
+
`)}return K},"displayRules");this.validate=o(function(K){let q=!1;return typeof K=="string"&&S===K&&(q=!0),q},"validate"),this.init=o(function(K,q){a=K,c=q,J()},"init"),this.collect=o(function(K,q){L(m,q.state,q.phraseLength),L(u[K.type],q.state,q.phraseLength),K.type===e.RNM&&L(v[K.index],q.state,q.phraseLength),K.type===e.UDT&&L(x[K.index],q.state,q.phraseLength)},"collect"),this.toHtml=o(function(K,q){let j="";j+=`<table class="${n.CLASS_STATS}">
|
|
299
299
|
`,typeof q=="string"&&(j+=`<caption>${q}</caption>
|
|
300
300
|
`),j+=`<tr><th class="${n.CLASS_ACTIVE}">ops</th>
|
|
301
301
|
`,j+=`<th class="${n.CLASS_EMPTY}">EMPTY</th>
|
|
302
302
|
`,j+=`<th class="${n.CLASS_MATCH}">MATCH</th>
|
|
303
303
|
`,j+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
|
|
304
304
|
`,j+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
|
|
305
|
-
`;let le=!0;for(;le;){if(K===void 0){j+=
|
|
306
|
-
`,j},"toHtml"),this.toHtmlPage=o(function(K,q,j){return r.htmlToPage(this.toHtml(K,q),j)},"toHtmlPage")},"statsFunc")});var
|
|
305
|
+
`;let le=!0;for(;le;){if(K===void 0){j+=Q();break}if(K===null){j+=Q();break}if(K==="ops"){j+=Q();break}if(K==="index"){v.sort(D),x.length>0&&x.sort(D),j+=Q(),j+=Y();break}if(K==="hits"){v.sort(R),x.length>0&&x.sort(D),j+=Q(),j+=Y();break}if(K==="alpha"){v.sort(O),x.length>0&&x.sort(O),j+=Q(),j+=Y();break}break}return j+=`</table>
|
|
306
|
+
`,j},"toHtml"),this.toHtmlPage=o(function(K,q,j){return r.htmlToPage(this.toHtml(K,q),j)},"toHtmlPage")},"statsFunc")});var D4=De((RG,I4)=>{I4.exports=o(function(){let e=za(),r=Bu(),n=new(ib()),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,L=0,W=[],Q=null,Y=null,oe=null,K=[],q=[],j=`<span class="${r.CLASS_LINEEND}">•</span>`,le=`<span class="${r.CLASS_LINEEND}">…</span>`,T=`<span class="${r.CLASS_EMPTY}">𝜺</span>`,h=o(function(){let F=o(function(ee){K[i.ALT]=ee,K[i.CAT]=ee,K[i.REP]=ee,K[i.TLS]=ee,K[i.TBS]=ee,K[i.TRG]=ee,K[i.AND]=ee,K[i.NOT]=ee,K[i.BKR]=ee,K[i.BKA]=ee,K[i.BKN]=ee,K[i.ABG]=ee,K[i.AEN]=ee},"setOperators"),$=0;for(let ee in c.filter.operators)$+=1;if($===0){F(!1);return}for(let ee in c.filter.operators){let ne=ee.toUpperCase();if(ne==="<ALL>"){F(!0);return}if(ne==="<NONE>"){F(!1);return}}F(!1);for(let ee in c.filter.operators){let ne=ee.toUpperCase();if(ne==="ALT")K[i.ALT]=c.filter.operators[ee]===!0;else if(ne==="CAT")K[i.CAT]=c.filter.operators[ee]===!0;else if(ne==="REP")K[i.REP]=c.filter.operators[ee]===!0;else if(ne==="AND")K[i.AND]=c.filter.operators[ee]===!0;else if(ne==="NOT")K[i.NOT]=c.filter.operators[ee]===!0;else if(ne==="TLS")K[i.TLS]=c.filter.operators[ee]===!0;else if(ne==="TBS")K[i.TBS]=c.filter.operators[ee]===!0;else if(ne==="TRG")K[i.TRG]=c.filter.operators[ee]===!0;else if(ne==="BKR")K[i.BKR]=c.filter.operators[ee]===!0;else if(ne==="BKA")K[i.BKA]=c.filter.operators[ee]===!0;else if(ne==="BKN")K[i.BKN]=c.filter.operators[ee]===!0;else if(ne==="ABG")K[i.ABG]=c.filter.operators[ee]===!0;else if(ne==="AEN")K[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 F=o(function(ae){K[i.RNM]=ae,K[i.UDT]=ae;let Ae=Y.length+oe.length;q.length=0;for(let ge=0;ge<Ae;ge+=1)q.push(ae)},"setRules"),$,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);q.length=0,$=0;for(let ae in c.filter.rules)$+=1;if($===0){F(!0);return}for(let ae in c.filter.rules){let Ae=ae.toLowerCase();if(Ae==="<all>"){F(!0);return}if(Ae==="<none>"){F(!1);return}}F(!1),K[i.RNM]=!0,K[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`);q[ee]=c.filter.rules[ae]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(F,$){if(P=-1,typeof F=="number"&&F>0)D=Math.ceil(F);else{D=0;return}typeof $=="number"&&(P=Math.floor($),P<0&&(P=-1))},this.getMaxRecords=function(){return D},this.getLastRecord=function(){return P},this.init=function(F,$,ee){R.length=0,W.length=0,J=0,L=0,Q=ee,Y=F,oe=$,h(),y(),n.init(D)};let b=o(function(F){let $=!1;return F.type===i.RNM?K[F.type]&&q[F.index]?$=!0:$=!1:F.type===i.UDT?K[F.type]&&q[Y.length+F.index]?$=!0:$=!1:$=K[F.type],$},"filterOps"),l=o(function(F){return P===-1||F<=P},"filterRecords");this.down=function(F,$,ee,ne,ae,Ae){l(J)&&b(F)&&(W.push(J),R[n.increment()]={dirUp:!1,depth:L,thisLine:J,thatLine:void 0,opcode:F,state:$,phraseIndex:ee,phraseLength:ne,lookAnchor:ae,lookAround:Ae},J+=1,L+=1)},this.up=function(F,$,ee,ne,ae,Ae){if(l(J)&&b(F)){let ge=J,re=W.pop(),Se=n.getListIndex(re);Se!==-1&&(R[Se].thatLine=ge),L-=1,R[n.increment()]={dirUp:!0,depth:L,thisLine:ge,thatLine:re,opcode:F,state:$,phraseIndex:ee,phraseLength:ne,lookAnchor:ae,lookAround:Ae},J+=1}};let p=o(function(){function F(U,X){let me,ye,we;if(X)switch(U.op={id:X.type,name:e.opcodeToString(X.type)},U.opData=void 0,X.type){case i.RNM:U.opData=Y[X.index].name;break;case i.UDT:U.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",U.opData=`\\\\${ye}${we}${me}`;break;case i.TLS:U.opData=[];for(let ke=0;ke<X.string.length;ke+=1)U.opData.push(X.string[ke]);break;case i.TBS:U.opData=[];for(let ke=0;ke<X.string.length;ke+=1)U.opData.push(X.string[ke]);break;case i.TRG:U.opData=[X.min,X.max];break;case i.REP:U.opData=[X.min,X.max];break;default:throw new Error("unrecognized opcode")}else U.op={id:void 0,name:void 0},U.opData=void 0}o(F,"nodeOpcode");function $(U,X,me){return U===i.MATCH?{index:X,length:me}:U===i.NOMATCH?{index:X,length:0}:U===i.EMPTY?{index:X,length:0}:null}o($,"nodePhrase");let ee=-1;function ne(U,X,me){let ye={id:ee++,branch:-1,parent:U,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,F(ye,X.opcode)):(ye.state={id:void 0,name:void 0},ye.phrase=$(),F(ye,void 0)),ye}o(ne,"nodeDown");function ae(U,X){X&&(U.up=!0,U.state={id:X.state,name:e.stateToString(X.state)},U.phrase=$(X.state,X.phraseIndex,X.phraseLength),U.down||F(U,X.opcode))}o(ae,"nodeUp");let Ae=0,ge=-1,re=1;function Se(U){if(ge+=1,U.branch=re,ge>L&&(L=ge),U.children.length===0)Ae+=1;else for(let X=0;X<U.children.length;X+=1)X>0&&(re+=1),U.children[X].leftMost=!1,U.children[X].rightMost=!1,U.leftMost&&(U.children[X].leftMost=X===0),U.rightMost&&(U.children[X].rightMost=X===U.children.length-1),Se(U.children[X]);ge-=1}o(Se,"walk");function ce(U,X){let me,ye={};if(ye.id=U.id,ye.branch=U.branch,ye.leftMost=U.leftMost,ye.rightMost=U.rightMost,me=U.state.name?U.state.name:"ACTIVE",ye.state={id:U.state.id,name:me},me=U.op.name?U.op.name:"?",ye.op={id:U.op.id,name:me},typeof U.opData=="string")ye.opData=U.opData;else if(Array.isArray(U.opData)){ye.opData=[];for(let we=0;we<U.opData.length;we+=1)ye.opData[we]=U.opData[we]}else ye.opData=void 0;U.phrase?ye.phrase={index:U.phrase.index,length:U.phrase.length}:ye.phrase=null,ye.depth=U.depth,ye.children=[];for(let we=0;we<U.children.length;we+=1){let ke=we!==U.children.length-1;ye.children[we]=ce(U.children[we],X,ke)}return ye}o(ce,"display");let ve=[],G,pe,Ce,He,Re=!0,Ve=ne(null,null,-1);for(ve.push(Ve),pe=Ve,n.forEach(U=>{if(He=R[U],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?");G=Ve.children[0];let pr=G;for(;G&&!G.down&&!G.up;)pr=G,G=G.children[0];G=pr,G.leftMost=!0,G.rightMost=!0,Se(G),G.branch=0;let ue={};ue.string=[];for(let U=0;U<Q.length;U+=1)ue.string[U]=Q[U];ue.rules=[];for(let U=0;U<Y.length;U+=1)ue.rules[U]=Y[U].name;ue.udts=[];for(let U=0;U<oe.length;U+=1)ue.udts[U]=oe[U].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=L,ue.leafNodes=Ae;let ie;return G.down?G.up?ie="none":ie="right":G.up?ie="left":ie="both",ue.branchesIncomplete=ie,ue.tree=ce(G,G.depth,!1),ue},"toTreeObj");this.toTree=function(F){let $=p();return F?JSON.stringify($):$},this.toHtmlPage=function(F,$,ee){return e.htmlToPage(this.toHtml(F,$),ee)};let _=o(function(F,$){let ee;switch(F){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: ${F}`)}let ne="";return ne+=`<p>display mode: ${ee}</p>
|
|
307
307
|
`,ne+=`<table class="${r.CLASS_TRACE}">
|
|
308
308
|
`,typeof $=="string"&&(ne+=`<caption>${$}</caption>`),ne},"htmlHeader"),A=o(function(){let F="";return F+=`</table>
|
|
309
309
|
`,F+=`<p class="${r.CLASS_MONOSPACE}">legend:<br>
|
|
@@ -348,11 +348,11 @@ table.apg-attrs a:hover {
|
|
|
348
348
|
`,F+=`ABG - anchor - begin of input string<br>
|
|
349
349
|
`,F+=`AEN - anchor - end of input string<br>
|
|
350
350
|
`,F+=`</p>
|
|
351
|
-
`,F},"htmlFooter");this.indent=function(F){let $="";for(let ee=0;ee<F;ee+=1)$+=".";return $};let E=o(function(F,$){let ee="";if($.type===i.TRG)if(F===u||F===
|
|
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),$+="<tr>",$+=`<td>${ee}</td><td>${ne}</td>`,$+=`<td>${ce.phraseIndex}</td>`,$+=`<td>${ce.phraseLength}</td>`,$+=`<td>${ce.depth}</td>`,$+="<td>",ce.state){case i.ACTIVE:$+=`<span class="${r.CLASS_ACTIVE}">↓ </span>`;break;case i.MATCH:$+=`<span class="${r.CLASS_MATCH}">↑M</span>`;break;case i.NOMATCH:$+=`<span class="${r.CLASS_NOMATCH}">↑N</span>`;break;case i.EMPTY:$+=`<span class="${r.CLASS_EMPTY}">↑E</span>`;break;default:$+=`<span class="${r.CLASS_ACTIVE}">--</span>`;break}if($+="</td>",$+="<td>",$+=c.indent(ce.depth),ae?$+=`<span class="${r.CLASS_LOOKAHEAD}">`:Ae&&($+=`<span class="${r.CLASS_LOOKBEHIND}">`),$+=e.opcodeToString(ce.opcode.type),ce.opcode.type===i.RNM&&($+=`(${Y[ce.opcode.index].name}) `),ce.opcode.type===i.BKR){let ve=ce.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",G=ce.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";$+=`(\\${ve}${G}${Y[ce.opcode.index].name}) `}ce.opcode.type===i.UDT&&($+=`(${oe[ce.opcode.index].name}) `),ce.opcode.type===i.TRG&&($+=`(${E(F,ce.opcode)}) `),ce.opcode.type===i.TBS&&($+=`(${C(F,ce.opcode)}) `),ce.opcode.type===i.TLS&&($+=`(${
|
|
351
|
+
`,F},"htmlFooter");this.indent=function(F){let $="";for(let ee=0;ee<F;ee+=1)$+=".";return $};let E=o(function(F,$){let ee="";if($.type===i.TRG)if(F===u||F===x){let ne=$.min.toString(16).toUpperCase();ne.length%2!==0&&(ne=`0${ne}`),ee+=F===u?"%x":"U+",ee+=ne,ne=$.max.toString(16).toUpperCase(),ne.length%2!==0&&(ne=`0${ne}`),ee+=`–${ne}`}else ee=`%d${$.min.toString(10)}–${$.max.toString(10)}`;return ee},"displayTrg"),g=o(function(F,$){let ee="";if($.type===i.REP)if(F===u){let ne=$.min.toString(16).toUpperCase();ne.length%2!==0&&(ne=`0${ne}`),ee=`x${ne}`,$.max<1/0?(ne=$.max.toString(16).toUpperCase(),ne.length%2!==0&&(ne=`0${ne}`)):ne="inf",ee+=`–${ne}`}else $.max<1/0?ee=`${$.min.toString(10)}–${$.max.toString(10)}`:ee=`${$.min.toString(10)}–inf`;return ee},"displayRep"),C=o(function(F,$){let ee="";if($.type===i.TBS){let ne=Math.min($.string.length,O*2);if(F===u||F===x){ee+=F===u?"%x":"U+";for(let ae=0;ae<ne;ae+=1){let Ae;ae>0&&(ee+="."),Ae=$.string[ae].toString(16).toUpperCase(),Ae.length%2!==0&&(Ae=`0${Ae}`),ee+=Ae}}else{ee="%d";for(let ae=0;ae<ne;ae+=1)ae>0&&(ee+="."),ee+=$.string[ae].toString(10)}ne<$.string.length&&(ee+=le)}return ee},"displayTbs"),N=o(function(F,$){let ee="";if($.type===i.TLS){let ne=Math.min($.string.length,O);if(F===u||F===m){let ae,Ae,ge;F===u?(ee="%x",ge=16):(ee="%d",ge=10);for(let re=0;re<ne;re+=1)re>0&&(ee+="."),Ae=$.string[re],Ae>=97&&Ae<=122?(ae=Ae-32,ee+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):Ae>=65&&Ae<=90?(ae=Ae,Ae+=32,ee+=`${ae.toString(ge)}/${Ae.toString(ge)}`.toUpperCase()):ee+=Ae.toString(ge).toUpperCase();ne<$.string.length&&(ee+=le)}else{ee='"';for(let ae=0;ae<ne;ae+=1)ee+=e.asciiChars[$.string[ae]];ne<$.string.length&&(ee+=le),ee+='"'}}return ee},"displayTls"),w=o(function(F,$,ee,ne,ae){if(ne===0)return"";let Ae="",ge=ae?",":"";switch(F){case u:Ae=ge+e.charsToHex($,ee,ne);break;case m:if(ae)return`,${e.charsToDec($,ee,ne)}`;Ae=ge+e.charsToDec($,ee,ne);break;case x:Ae=e.charsToUnicode($,ee,ne);break;case v:default:Ae=e.charsToAsciiHtml($,ee,ne);break}return Ae},"subPhrase"),k=o(function(F,$,ee,ne,ae,Ae){let ge="",re,Se,ce,ve,G=j,pe=`<span class="${r.CLASS_LOOKBEHIND}">`,Ce=`<span class="${r.CLASS_REMAINDER}">`,He="</span>",Re=!1;switch(ee){case i.EMPTY:ge+=T;case i.NOMATCH:case i.MATCH:case i.ACTIVE:re=ne-ae,Se=Ae-re,ce=Ae,ve=$.length-ce;break;default:throw new Error("unrecognized state")}return G=j,Se>S?(Se=S,G=le,ve=0):Se+ve>S&&(G=le,ve=S-Se),Se>0&&(ge+=pe,ge+=w(F,$,re,Se,Re),ge+=He,Re=!0),ve>0&&(ge+=Ce,ge+=w(F,$,ce,ve,Re),ge+=He),ge+G},"displayBehind"),he=o(function(F,$,ee,ne,ae,Ae){let ge="",re,Se,ce,ve,G=j,pe=`<span class="${r.CLASS_REMAINDER}">`,Ce="</span>",He=!1;switch(ee){case i.EMPTY:ge+=T;case i.NOMATCH:case i.ACTIVE:re=ne,Se=0,ce=ne,ve=$.length-ce;break;case i.MATCH:re=ne,Se=ae,ce=ne+Se,ve=$.length-ce;break;default:throw new Error("unrecognized state")}return G=j,Se>S?(Se=S,G=le,ve=0):Se+ve>S&&(G=le,ve=S-Se),Se>0&&(ge+=Ae,ge+=w(F,$,re,Se,He),ge+=Ce,He=!0),ve>0&&(ge+=pe,ge+=w(F,$,ce,ve,He),ge+=Ce),ge+G},"displayForward"),I=o(function(F,$,ee,ne,ae){let Ae=`<span class="${r.CLASS_LOOKAHEAD}">`;return he(F,$,ee,ne,ae,Ae)},"displayAhead"),Z=o(function(F,$,ee,ne,ae){let Ae=`<span class="${r.CLASS_MATCH}">`;return he(F,$,ee,ne,ae,Ae)},"displayNone"),se=o(function(F){if(Y===null)return"";let $="",ee,ne,ae,Ae,ge,re;return $+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",$+=`<th>operator</th><th>phrase</th></tr>
|
|
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),$+="<tr>",$+=`<td>${ee}</td><td>${ne}</td>`,$+=`<td>${ce.phraseIndex}</td>`,$+=`<td>${ce.phraseLength}</td>`,$+=`<td>${ce.depth}</td>`,$+="<td>",ce.state){case i.ACTIVE:$+=`<span class="${r.CLASS_ACTIVE}">↓ </span>`;break;case i.MATCH:$+=`<span class="${r.CLASS_MATCH}">↑M</span>`;break;case i.NOMATCH:$+=`<span class="${r.CLASS_NOMATCH}">↑N</span>`;break;case i.EMPTY:$+=`<span class="${r.CLASS_EMPTY}">↑E</span>`;break;default:$+=`<span class="${r.CLASS_ACTIVE}">--</span>`;break}if($+="</td>",$+="<td>",$+=c.indent(ce.depth),ae?$+=`<span class="${r.CLASS_LOOKAHEAD}">`:Ae&&($+=`<span class="${r.CLASS_LOOKBEHIND}">`),$+=e.opcodeToString(ce.opcode.type),ce.opcode.type===i.RNM&&($+=`(${Y[ce.opcode.index].name}) `),ce.opcode.type===i.BKR){let ve=ce.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",G=ce.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";$+=`(\\${ve}${G}${Y[ce.opcode.index].name}) `}ce.opcode.type===i.UDT&&($+=`(${oe[ce.opcode.index].name}) `),ce.opcode.type===i.TRG&&($+=`(${E(F,ce.opcode)}) `),ce.opcode.type===i.TBS&&($+=`(${C(F,ce.opcode)}) `),ce.opcode.type===i.TLS&&($+=`(${N(F,ce.opcode)}) `),ce.opcode.type===i.REP&&($+=`(${g(F,ce.opcode)}) `),ge&&($+="</span>"),$+="</td>",$+="<td>",Ae?$+=k(F,Q,ce.state,ce.phraseIndex,ce.phraseLength,re):ae?$+=I(F,Q,ce.state,ce.phraseIndex,ce.phraseLength):$+=Z(F,Q,ce.state,ce.phraseIndex,ce.phraseLength),$+=`</td></tr>
|
|
353
353
|
`}),$+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",$+=`<th>operator</th><th>phrase</th></tr>
|
|
354
354
|
`,$+=`</table>
|
|
355
|
-
`,$},"htmlTable");this.toHtml=function(F,$){let ee=v;if(typeof F=="string"&&F.length>=3){let ae=F.toLowerCase().slice(0,3);ae==="hex"?ee=u:ae==="dec"?ee=
|
|
355
|
+
`,$},"htmlTable");this.toHtml=function(F,$){let ee=v;if(typeof F=="string"&&F.length>=3){let ae=F.toLowerCase().slice(0,3);ae==="hex"?ee=u:ae==="dec"?ee=m:ae==="uni"&&(ee=x)}let ne="";return ne+=_(ee,$),ne+=se(ee),ne+=A(),ne}},"exportTrace")});var Ka=De((NG,O4)=>{O4.exports={ast:A4(),circular:ib(),ids:zi(),parser:T4(),stats:k4(),trace:D4(),utils:za(),emitcss:rb(),style:Bu()}});var N4=De((PG,R4)=>{R4.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 F4=De($4=>{var Jr=zi(),TL=Ha();function CL(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(CL,"semLine");function kL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.textLength=n),Jr.SEM_OK}o(kL,"semLineText");function IL(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(IL,"semLastLine");function DL(t,e,r,n,i){return t===Jr.SEM_PRE&&i.errors.push({line:i.lineNo,char:r,msg:`invalid character found '\\x${TL.charToHex(e[r])}'`}),Jr.SEM_OK}o(DL,"semInvalid");function OL(t,e,r,n,i){return t===Jr.SEM_POST&&(i.lineNo+=1),Jr.SEM_OK}o(OL,"semEnd");function RL(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(RL,"semLF");function NL(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(NL,"semCR");function PL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CRLF"),Jr.SEM_OK}o(PL,"semCRLF");var ts=[];ts.line=CL;ts["line-text"]=kL;ts["last-line"]=IL;ts.invalid=DL;ts.end=OL;ts.lf=RL;ts.cr=NL;ts.crlf=PL;$4.callbacks=ts});var H4=De((pV,q4)=>{q4.exports=o(function(e,r,n,i){let a="scanner.js: ",c=za(),u=new(U4()),{callbacks:p}=F4(),v=[],y=new c.parser;if(y.ast=new c.ast,y.ast.callbacks=p,i){if(i.traceObject!=="traceObject")throw new TypeError(`${a}trace argument is not a trace object`);y.trace=i}if(y.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 y.ast.translate(O),v},"exfn")});var K4=De((mV,z4)=>{z4.exports=o(function(){let e="syntax-callbacks.js: ",r=za(),n=r.ids,i,a=o(function(P,w,k,he){switch(P.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,P,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,P,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"),p=o(function(C,P,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,P,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"),y=o(function(C,P,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,P,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,P,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,P,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"),I=o(function(C,P,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"),N=o(function(C,P,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,P,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(P,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,P,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(P,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"),V=o(function(C,P,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"),Z=o(function(C,P,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,P,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,P,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"),K=o(function(C,P,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"),q=o(function(C,P,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"),j=o(function(C,P,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,P,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,P,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,P,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"),x=o(function(C,P,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,P,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,P,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"),m=o(function(C,P,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,P,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,P,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=P[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,P,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,P,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=y,this.callbacks.basicelementerr=_,this.callbacks.clsclose=j,this.callbacks.clsopen=K,this.callbacks.clsstring=q,this.callbacks.definedaserror=v,this.callbacks.file=a,this.callbacks.groupclose=b,this.callbacks.groupopen=x,this.callbacks.lineenderror=E,this.callbacks.lineend=A,this.callbacks.notop=S,this.callbacks.optionclose=m,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=p,this.callbacks.stringtab=Y,this.callbacks.tlsclose=oe,this.callbacks.tlsopen=V,this.callbacks.tlsstring=Z,this.callbacks.udtop=L,this.callbacks.bkaop=O,this.callbacks.bknop=R,this.callbacks.bkrop=J,this.callbacks.abgop=I,this.callbacks.aenop=N},"exfn")});var G4=De((bV,j4)=>{j4.exports=o(function(){let e=za(),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,G=ce.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===G){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1)G=10*G+Se[pe]-48;return G},"decnum"),a=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1)G=2*G+Se[pe]-48;return G},"binnum"),c=o(function(Se,ce,ve){let G=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");G=16*G+Ce}return G},"hexnum");function u(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)G.ruleNames=new n,G.udtNames=new n,G.rules=[],G.udts=[],G.rulesLineMap=[],G.opcodes=[],G.altStack=[],G.topStack=null,G.topRule=null;else if(re===r.SEM_POST){let Ce;G.rules.forEach(He=>{He.isBkr=!1,He.opcodes.forEach(Re=>{Re.type===r.RNM&&(Ce=G.ruleNames.get(Re.index.name),Ce===-1?(G.errors.push({line:G.findLine(G.lines,Re.index.phraseIndex,G.charsLength),char:Re.index.phraseIndex,msg:`Rule name '${Re.index.name}' used but not defined.`}),Re.index=-1):Re.index=Ce.index)})}),G.udts.forEach(He=>{He.isBkr=!1}),G.rules.forEach(He=>{He.opcodes.forEach(Re=>{Re.type===r.BKR&&(He.hasBkr=!0,Ce=G.ruleNames.get(Re.index.name),Ce!==-1?(G.rules[Ce.index].isBkr=!0,Re.index=Ce.index):(Ce=G.udtNames.get(Re.index.name),Ce!==-1?(G.udts[Ce.index].isBkr=!0,Re.index=G.rules.length+Ce.index):(G.errors.push({line:G.findLine(G.lines,Re.index.phraseIndex,G.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 p(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.altStack.length=0,G.topStack=null,G.rulesLineMap.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce})),pe}o(p,"semRule");function v(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)G.ruleName="",G.definedas="";else if(re===r.SEM_POST){let Ce;G.definedas==="="?(Ce=G.ruleNames.add(G.ruleName),Ce===-1?(G.definedas=null,G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`Rule name '${G.ruleName}' previously defined.`})):(G.topRule={name:Ce.name,lower:Ce.lower,opcodes:[],index:Ce.index},G.rules.push(G.topRule),G.opcodes=G.topRule.opcodes)):(Ce=G.ruleNames.get(G.ruleName),Ce===-1?(G.definedas=null,G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`Rule name '${G.ruleName}' for incremental alternate not previously defined.`})):(G.topRule=G.rules[Ce.index],G.opcodes=G.topRule.opcodes))}return pe}o(v,"semRuleLookup");function y(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)for(;;){if(G.definedas===null){pe=r.SEM_SKIP;break}if(G.topStack===null){if(G.definedas==="="){G.topStack={alt:{type:r.ALT,children:[]},cat:null},G.altStack.push(G.topStack),G.opcodes.push(G.topStack.alt);break}G.topStack={alt:G.opcodes[0],cat:null},G.altStack.push(G.topStack);break}G.topStack={alt:{type:r.ALT,children:[]},cat:null},G.altStack.push(G.topStack),G.opcodes.push(G.topStack.alt);break}else re===r.SEM_POST&&(G.altStack.pop(),G.altStack.length>0?G.topStack=G.altStack[G.altStack.length-1]:G.topStack=null);return pe}o(y,"semAlternation");function S(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.topStack.alt.children.push(G.opcodes.length),G.topStack.cat={type:r.CAT,children:[]},G.opcodes.push(G.topStack.cat)):re===r.SEM_POST&&(G.topStack.cat=null),pe}o(S,"semConcatenation");function O(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&G.topStack.cat.children.push(G.opcodes.length),pe}o(O,"semRepetition");function R(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.REP,min:0,max:1,char:ce}),pe}o(R,"semOptionOpen");function I(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.ruleName=e.utils.charsToString(Se,ce,ve)),pe}o(I,"semRuleName");function N(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.definedas="="),pe}o(N,"semDefined");function J(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.definedas="=/"),pe}o(J,"semIncAlt");function L(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.min=0,G.max=1/0,G.topRep={type:r.REP,min:0,max:1/0},G.opcodes.push(G.topRep)):re===r.SEM_POST&&(G.min>G.max&&G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`repetition min cannot be greater than max: min: ${G.min}: max: ${G.max}`}),G.topRep.min=G.min,G.topRep.max=G.max),pe}o(L,"semRepOp");function V(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=i(Se,ce,ve)),pe}o(V,"semRepMin");function Z(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve)),pe}o(Z,"semRepMax");function Y(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve),G.min=G.max),pe}o(Y,"semRepMinMax");function oe(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.AND}),pe}o(oe,"semAndOp");function K(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.NOT}),pe}o(K,"semNotOp");function q(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.RNM,index:{phraseIndex:ce,name:e.utils.charsToString(Se,ce,ve)}}),pe}o(q,"semRnmOp");function j(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.ABG}),pe}o(j,"semAbgOp");function le(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.AEN}),pe}o(le,"semAenOp");function T(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.BKA}),pe}o(T,"semBkaOp");function h(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.BKN}),pe}o(h,"semBknOp");function x(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.ci=!0,G.cs=!1,G.um=!0,G.pm=!1):re===r.SEM_POST&&G.opcodes.push({type:r.BKR,bkrCase:G.cs===!0?r.BKR_MODE_CS:r.BKR_MODE_CI,bkrMode:G.pm===!0?r.BKR_MODE_PM:r.BKR_MODE_UM,index:{phraseIndex:G.bkrname.phraseIndex,name:e.utils.charsToString(Se,G.bkrname.phraseIndex,G.bkrname.phraseLength)}}),pe}o(x,"semBkrOp");function b(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.ci=!0),pe}o(b,"semBkrCi");function l(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.cs=!0),pe}o(l,"semBkrCs");function m(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.um=!0),pe}o(m,"semBkrUm");function _(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.pm=!0),pe}o(_,"semBkrPm");function A(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.bkrname={phraseIndex:ce,phraseLength:ve}),pe}o(A,"semBkrName");function E(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=G.udtNames.add(Ce);if(He===-1){if(He=G.udtNames.get(Ce),He===-1)throw new Error("semUdtEmpty: name look up error")}else G.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!0});G.opcodes.push({type:r.UDT,empty:!0,index:He.index})}return pe}o(E,"semUdtEmpty");function g(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=G.udtNames.add(Ce);if(He===-1){if(He=G.udtNames.get(Ce),He===-1)throw new Error("semUdtNonEmpty: name look up error")}else G.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!1});G.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,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.tlscase=!0),pe}o(C,"semTlsOp");function P(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&ve>0&&(Se[ce+1]===83||Se[ce+1]===115)&&(G.tlscase=!1),pe}o(P,"semTlsCase");function w(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST)if(G.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);G.opcodes.push({type:r.TLS,string:Ce})}else G.opcodes.push({type:r.TBS,string:Se.slice(ce,ce+ve)});return pe}o(w,"semTlsString");function k(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(ve<=2?G.opcodes.push({type:r.TLS,string:[]}):G.opcodes.push({type:r.TBS,string:Se.slice(ce+1,ce+ve-1)})),pe}o(k,"semClsOp");function he(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?G.tbsstr=[]:re===r.SEM_POST&&G.opcodes.push({type:r.TBS,string:G.tbsstr}),pe}o(he,"semTbsOp");function D(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.min=0,G.max=0):re===r.SEM_POST&&(G.min>G.max&&G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${G.min}: max: ${G.max}`}),G.opcodes.push({type:r.TRG,min:G.min,max:G.max})),pe}o(D,"semTrgOp");function Q(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=i(Se,ce,ve)),pe}o(Q,"semDmin");function se(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve)),pe}o(se,"semDmax");function F(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=a(Se,ce,ve)),pe}o(F,"semBmin");function $(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=a(Se,ce,ve)),pe}o($,"semBmax");function ee(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=c(Se,ce,ve)),pe}o(ee,"semXmin");function ne(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=c(Se,ce,ve)),pe}o(ne,"semXmax");function ae(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(i(Se,ce,ve)),pe}o(ae,"semDstring");function Ae(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(a(Se,ce,ve)),pe}o(Ae,"semBstring");function ge(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(c(Se,ce,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=j,this.callbacks.aenop=le,this.callbacks.alternation=y,this.callbacks.andop=oe,this.callbacks.bmax=$,this.callbacks.bmin=F,this.callbacks.bkaop=T,this.callbacks.bknop=h,this.callbacks.bkrop=x,this.callbacks["bkr-name"]=A,this.callbacks.bstring=Ae,this.callbacks.clsop=k,this.callbacks.ci=b,this.callbacks.cs=l,this.callbacks.um=m,this.callbacks.pm=_,this.callbacks.concatenation=S,this.callbacks.defined=N,this.callbacks.dmax=se,this.callbacks.dmin=Q,this.callbacks.dstring=ae,this.callbacks.file=u,this.callbacks.incalt=J,this.callbacks.notop=K,this.callbacks.optionopen=R,this.callbacks["rep-max"]=Z,this.callbacks["rep-min"]=V,this.callbacks["rep-min-max"]=Y,this.callbacks.repetition=O,this.callbacks.repop=L,this.callbacks.rnmop=q,this.callbacks.rule=p,this.callbacks.rulelookup=v,this.callbacks.rulename=I,this.callbacks.tbsop=he,this.callbacks.tlscase=P,this.callbacks.tlsstring=w,this.callbacks.tlsop=C,this.callbacks.trgop=D,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((gV,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+=`;
|
|
365
|
+
`,r},"toString")},"grammar")});var L4=De(P4=>{var Jr=zi(),YP=za();function XP(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(XP,"semLine");function ZP(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.textLength=n),Jr.SEM_OK}o(ZP,"semLineText");function QP(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(QP,"semLastLine");function eL(t,e,r,n,i){return t===Jr.SEM_PRE&&i.errors.push({line:i.lineNo,char:r,msg:`invalid character found '\\x${YP.charToHex(e[r])}'`}),Jr.SEM_OK}o(eL,"semInvalid");function tL(t,e,r,n,i){return t===Jr.SEM_POST&&(i.lineNo+=1),Jr.SEM_OK}o(tL,"semEnd");function rL(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(rL,"semLF");function nL(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(nL,"semCR");function iL(t,e,r,n,i){return t===Jr.SEM_PRE&&(i.endType="CRLF"),Jr.SEM_OK}o(iL,"semCRLF");var ts=[];ts.line=XP;ts["line-text"]=ZP;ts["last-line"]=QP;ts.invalid=eL;ts.end=tL;ts.lf=rL;ts.cr=nL;ts.crlf=iL;P4.callbacks=ts});var U4=De((BG,B4)=>{B4.exports=o(function(e,r,n,i){let a="scanner.js: ",c=Ka(),u=new(N4()),{callbacks:m}=L4(),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 F4=De((UG,$4)=>{$4.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"),K=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"),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."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),j=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=j,this.callbacks.clsopen=K,this.callbacks.clsstring=q,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 H4=De(($G,q4)=>{q4.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,G=ce.toLowerCase();for(let pe=0;pe<this.names.length;pe+=1)if(this.names[pe].lower===G){ve=this.names[pe];break}return ve},"get")},"NameList"),i=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1)G=10*G+Se[pe]-48;return G},"decnum"),a=o(function(Se,ce,ve){let G=0;for(let pe=ce;pe<ce+ve;pe+=1)G=2*G+Se[pe]-48;return G},"binnum"),c=o(function(Se,ce,ve){let G=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");G=16*G+Ce}return G},"hexnum");function u(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)G.ruleNames=new n,G.udtNames=new n,G.rules=[],G.udts=[],G.rulesLineMap=[],G.opcodes=[],G.altStack=[],G.topStack=null,G.topRule=null;else if(re===r.SEM_POST){let Ce;G.rules.forEach(He=>{He.isBkr=!1,He.opcodes.forEach(Re=>{Re.type===r.RNM&&(Ce=G.ruleNames.get(Re.index.name),Ce===-1?(G.errors.push({line:G.findLine(G.lines,Re.index.phraseIndex,G.charsLength),char:Re.index.phraseIndex,msg:`Rule name '${Re.index.name}' used but not defined.`}),Re.index=-1):Re.index=Ce.index)})}),G.udts.forEach(He=>{He.isBkr=!1}),G.rules.forEach(He=>{He.opcodes.forEach(Re=>{Re.type===r.BKR&&(He.hasBkr=!0,Ce=G.ruleNames.get(Re.index.name),Ce!==-1?(G.rules[Ce.index].isBkr=!0,Re.index=Ce.index):(Ce=G.udtNames.get(Re.index.name),Ce!==-1?(G.udts[Ce.index].isBkr=!0,Re.index=G.rules.length+Ce.index):(G.errors.push({line:G.findLine(G.lines,Re.index.phraseIndex,G.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,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.altStack.length=0,G.topStack=null,G.rulesLineMap.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce})),pe}o(m,"semRule");function v(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)G.ruleName="",G.definedas="";else if(re===r.SEM_POST){let Ce;G.definedas==="="?(Ce=G.ruleNames.add(G.ruleName),Ce===-1?(G.definedas=null,G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`Rule name '${G.ruleName}' previously defined.`})):(G.topRule={name:Ce.name,lower:Ce.lower,opcodes:[],index:Ce.index},G.rules.push(G.topRule),G.opcodes=G.topRule.opcodes)):(Ce=G.ruleNames.get(G.ruleName),Ce===-1?(G.definedas=null,G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`Rule name '${G.ruleName}' for incremental alternate not previously defined.`})):(G.topRule=G.rules[Ce.index],G.opcodes=G.topRule.opcodes))}return pe}o(v,"semRuleLookup");function x(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_PRE)for(;;){if(G.definedas===null){pe=r.SEM_SKIP;break}if(G.topStack===null){if(G.definedas==="="){G.topStack={alt:{type:r.ALT,children:[]},cat:null},G.altStack.push(G.topStack),G.opcodes.push(G.topStack.alt);break}G.topStack={alt:G.opcodes[0],cat:null},G.altStack.push(G.topStack);break}G.topStack={alt:{type:r.ALT,children:[]},cat:null},G.altStack.push(G.topStack),G.opcodes.push(G.topStack.alt);break}else re===r.SEM_POST&&(G.altStack.pop(),G.altStack.length>0?G.topStack=G.altStack[G.altStack.length-1]:G.topStack=null);return pe}o(x,"semAlternation");function S(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.topStack.alt.children.push(G.opcodes.length),G.topStack.cat={type:r.CAT,children:[]},G.opcodes.push(G.topStack.cat)):re===r.SEM_POST&&(G.topStack.cat=null),pe}o(S,"semConcatenation");function O(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&G.topStack.cat.children.push(G.opcodes.length),pe}o(O,"semRepetition");function R(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.REP,min:0,max:1,char:ce}),pe}o(R,"semOptionOpen");function D(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.ruleName=e.utils.charsToString(Se,ce,ve)),pe}o(D,"semRuleName");function P(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.definedas="="),pe}o(P,"semDefined");function J(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.definedas="=/"),pe}o(J,"semIncAlt");function L(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.min=0,G.max=1/0,G.topRep={type:r.REP,min:0,max:1/0},G.opcodes.push(G.topRep)):re===r.SEM_POST&&(G.min>G.max&&G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`repetition min cannot be greater than max: min: ${G.min}: max: ${G.max}`}),G.topRep.min=G.min,G.topRep.max=G.max),pe}o(L,"semRepOp");function W(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=i(Se,ce,ve)),pe}o(W,"semRepMin");function Q(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve)),pe}o(Q,"semRepMax");function Y(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve),G.min=G.max),pe}o(Y,"semRepMinMax");function oe(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.AND}),pe}o(oe,"semAndOp");function K(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.NOT}),pe}o(K,"semNotOp");function q(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.RNM,index:{phraseIndex:ce,name:e.utils.charsToString(Se,ce,ve)}}),pe}o(q,"semRnmOp");function j(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.ABG}),pe}o(j,"semAbgOp");function le(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.AEN}),pe}o(le,"semAenOp");function T(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.BKA}),pe}o(T,"semBkaOp");function h(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.opcodes.push({type:r.BKN}),pe}o(h,"semBknOp");function y(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.ci=!0,G.cs=!1,G.um=!0,G.pm=!1):re===r.SEM_POST&&G.opcodes.push({type:r.BKR,bkrCase:G.cs===!0?r.BKR_MODE_CS:r.BKR_MODE_CI,bkrMode:G.pm===!0?r.BKR_MODE_PM:r.BKR_MODE_UM,index:{phraseIndex:G.bkrname.phraseIndex,name:e.utils.charsToString(Se,G.bkrname.phraseIndex,G.bkrname.phraseLength)}}),pe}o(y,"semBkrOp");function b(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.ci=!0),pe}o(b,"semBkrCi");function l(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.cs=!0),pe}o(l,"semBkrCs");function p(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.um=!0),pe}o(p,"semBkrUm");function _(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.pm=!0),pe}o(_,"semBkrPm");function A(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.bkrname={phraseIndex:ce,phraseLength:ve}),pe}o(A,"semBkrName");function E(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=G.udtNames.add(Ce);if(He===-1){if(He=G.udtNames.get(Ce),He===-1)throw new Error("semUdtEmpty: name look up error")}else G.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!0});G.opcodes.push({type:r.UDT,empty:!0,index:He.index})}return pe}o(E,"semUdtEmpty");function g(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST){let Ce=e.utils.charsToString(Se,ce,ve),He=G.udtNames.add(Ce);if(He===-1){if(He=G.udtNames.get(Ce),He===-1)throw new Error("semUdtNonEmpty: name look up error")}else G.udts.push({name:He.name,lower:He.lower,index:He.index,empty:!1});G.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,G){let pe=r.SEM_OK;return re===r.SEM_PRE&&(G.tlscase=!0),pe}o(C,"semTlsOp");function N(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&ve>0&&(Se[ce+1]===83||Se[ce+1]===115)&&(G.tlscase=!1),pe}o(N,"semTlsCase");function w(re,Se,ce,ve,G){let pe=r.SEM_OK;if(re===r.SEM_POST)if(G.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);G.opcodes.push({type:r.TLS,string:Ce})}else G.opcodes.push({type:r.TBS,string:Se.slice(ce,ce+ve)});return pe}o(w,"semTlsString");function k(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(ve<=2?G.opcodes.push({type:r.TLS,string:[]}):G.opcodes.push({type:r.TBS,string:Se.slice(ce+1,ce+ve-1)})),pe}o(k,"semClsOp");function he(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?G.tbsstr=[]:re===r.SEM_POST&&G.opcodes.push({type:r.TBS,string:G.tbsstr}),pe}o(he,"semTbsOp");function I(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_PRE?(G.min=0,G.max=0):re===r.SEM_POST&&(G.min>G.max&&G.errors.push({line:G.findLine(G.lines,ce,G.charsLength),char:ce,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${G.min}: max: ${G.max}`}),G.opcodes.push({type:r.TRG,min:G.min,max:G.max})),pe}o(I,"semTrgOp");function Z(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=i(Se,ce,ve)),pe}o(Z,"semDmin");function se(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=i(Se,ce,ve)),pe}o(se,"semDmax");function F(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=a(Se,ce,ve)),pe}o(F,"semBmin");function $(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=a(Se,ce,ve)),pe}o($,"semBmax");function ee(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.min=c(Se,ce,ve)),pe}o(ee,"semXmin");function ne(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&(G.max=c(Se,ce,ve)),pe}o(ne,"semXmax");function ae(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(i(Se,ce,ve)),pe}o(ae,"semDstring");function Ae(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(a(Se,ce,ve)),pe}o(Ae,"semBstring");function ge(re,Se,ce,ve,G){let pe=r.SEM_OK;return re===r.SEM_POST&&G.tbsstr.push(c(Se,ce,ve)),pe}o(ge,"semXstring"),this.callbacks=[],this.callbacks.abgop=j,this.callbacks.aenop=le,this.callbacks.alternation=x,this.callbacks.andop=oe,this.callbacks.bmax=$,this.callbacks.bmin=F,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=K,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=q,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 K4=De((FG,z4)=>{z4.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,28 +533,28 @@ 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
|
|
536
|
+
`,r},"toString")},"grammar")});var G4=De((qG,j4)=>{j4.exports=o(function(){let e="parser: ",r=Ka(),n=r.ids,i=new(F4()),a=new(H4()),c=new(K4()),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(L=>{L.type===n.ALT&&L.children.length===1||L.type===n.CAT&&L.children.length===1||L.type===n.REP&&L.min===1&&L.max===1?P.push(null):(P.push(J),D.push(L),J+=1)}),P.push(J),D.forEach(L=>{if(L.type===n.ALT||L.type===n.CAT)for(let W=0;W<L.children.length;W+=1)L.children[W]=v(P,L.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 L={};L.errors=D,L.strict=!!P,L.lines=R,L.findLine=m,L.charsLength=O.length,L.ruleCount=0,u.parse(c,"file",O,L).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 L="",W,Q,Y,oe=0,K=1/0,q=0,j=[],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=>{j.push(se.lower),oe+=se.opcodes.length,se.opcodes.forEach(F=>{switch(F.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<F.string.length;W+=1)F.string[W]<K&&(K=F.string[W]),F.string[W]>q&&(q=F.string[W]);break;case n.TBS:for(E+=1,W=0;W<F.string.length;W+=1)F.string[W]<K&&(K=F.string[W]),F.string[W]>q&&(q=F.string[W]);break;case n.TRG:g+=1,F.min<K&&(K=F.min),F.max>q&&(q=F.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),j.sort(),P.length>0&&(P.forEach(se=>{le.push(se.lower)}),le.sort());let I="module.exports";J&&typeof J=="string"&&(I=`let ${J}`),L+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
|
|
537
537
|
`,L+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
|
|
538
538
|
`,L+=`//
|
|
539
539
|
`,L+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
|
|
540
|
-
`,L+=`${
|
|
540
|
+
`,L+=`${I} = function grammar(){
|
|
541
541
|
`,L+=" // ```\n",L+=` // SUMMARY
|
|
542
|
-
`,L+=` // rules = ${
|
|
543
|
-
`,L+=` // udts = ${
|
|
542
|
+
`,L+=` // rules = ${D.length}
|
|
543
|
+
`,L+=` // udts = ${P.length}
|
|
544
544
|
`,L+=` // opcodes = ${oe}
|
|
545
545
|
`,L+=` // --- ABNF original opcodes
|
|
546
546
|
`,L+=` // ALT = ${T}
|
|
547
547
|
`,L+=` // CAT = ${h}
|
|
548
548
|
`,L+=` // REP = ${l}
|
|
549
|
-
`,L+=` // RNM = ${
|
|
549
|
+
`,L+=` // RNM = ${y}
|
|
550
550
|
`,L+=` // TLS = ${A}
|
|
551
551
|
`,L+=` // TBS = ${E}
|
|
552
552
|
`,L+=` // TRG = ${g}
|
|
553
553
|
`,L+=` // --- SABNF superset opcodes
|
|
554
554
|
`,L+=` // UDT = ${b}
|
|
555
|
-
`,L+=` // AND = ${
|
|
555
|
+
`,L+=` // AND = ${p}
|
|
556
556
|
`,L+=` // NOT = ${_}
|
|
557
|
-
`,L+=` // BKA = ${
|
|
557
|
+
`,L+=` // BKA = ${N}
|
|
558
558
|
`,L+=` // BKN = ${w}
|
|
559
559
|
`,L+=` // BKR = ${C}
|
|
560
560
|
`,L+=` // ABG = ${k}
|
|
@@ -565,21 +565,21 @@ table.apg-attrs a:hover {
|
|
|
565
565
|
`,L+=`
|
|
566
566
|
`,L+=` /* RULES */
|
|
567
567
|
`,L+=` this.rules = [];
|
|
568
|
-
`,
|
|
568
|
+
`,D.forEach((se,F)=>{let $=" this.rules[";$+=F,$+="] = {name: '",$+=se.name,$+="', lower: '",$+=se.lower,$+="', index: ",$+=se.index,$+=", isBkr: ",$+=se.isBkr,$+=`};
|
|
569
569
|
`,L+=$}),L+=`
|
|
570
570
|
`,L+=` /* UDTS */
|
|
571
571
|
`,L+=` this.udts = [];
|
|
572
|
-
`,
|
|
572
|
+
`,P.length>0&&P.forEach((se,F)=>{let $=" this.udts[";$+=F,$+="] = {name: '",$+=se.name,$+="', lower: '",$+=se.lower,$+="', index: ",$+=se.index,$+=", empty: ",$+=se.empty,$+=", isBkr: ",$+=se.isBkr,$+=`};
|
|
573
573
|
`,L+=$}),L+=`
|
|
574
574
|
`,L+=` /* OPCODES */
|
|
575
|
-
`,
|
|
575
|
+
`,D.forEach((se,F)=>{F>0&&(L+=`
|
|
576
576
|
`),L+=` /* ${se.name} */
|
|
577
577
|
`,L+=` this.rules[${F}].opcodes = [];
|
|
578
578
|
`,se.opcodes.forEach(($,ee)=>{let ne;switch($.type){case n.ALT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, children: [${$.children.toString()}]};// ALT
|
|
579
579
|
`;break;case n.CAT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, children: [${$.children.toString()}]};// CAT
|
|
580
|
-
`;break;case n.RNM:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, index: ${$.index}};// RNM(${
|
|
581
|
-
`;break;case n.BKR:$.index>=
|
|
582
|
-
`;break;case n.UDT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, empty: ${$.empty}, index: ${$.index}};// UDT(${
|
|
580
|
+
`;break;case n.RNM:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, index: ${$.index}};// RNM(${D[$.index].name})
|
|
581
|
+
`;break;case n.BKR:$.index>=D.length?(Q=P[$.index-D.length].name,Y=P[$.index-D.length].lower):(Q=D[$.index].name,Y=D[$.index].lower),ne="%i",$.bkrCase===n.BKR_MODE_CS&&(ne="%s"),$.bkrMode===n.BKR_MODE_UM?ne+="%u":ne+="%p",Q=ne+Q,L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, index: ${$.index}, lower: '${Y}', bkrCase: ${$.bkrCase}, bkrMode: ${$.bkrMode}};// BKR(\\${Q})
|
|
582
|
+
`;break;case n.UDT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, empty: ${$.empty}, index: ${$.index}};// UDT(${P[$.index].name})
|
|
583
583
|
`;break;case n.REP:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}, min: ${$.min}, max: ${$.max}};// REP
|
|
584
584
|
`;break;case n.AND:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// AND
|
|
585
585
|
`;break;case n.NOT:L+=` this.rules[${F}].opcodes[${ee}] = {type: ${$.type}};// NOT
|
|
@@ -593,63 +593,63 @@ table.apg-attrs a:hover {
|
|
|
593
593
|
`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),L+=`
|
|
594
594
|
`,L+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",L+=` this.toString = function toString(){
|
|
595
595
|
`,L+=` let str = "";
|
|
596
|
-
`;let
|
|
596
|
+
`;let Z;return R.forEach(se=>{let F=se.beginChar+se.length;Z="",L+=' str += "';for(let $=se.beginChar;$<F;$+=1){switch(O[$]){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[$]);break}L+=Z}L+=`";
|
|
597
597
|
`}),L+=` return str;
|
|
598
598
|
`,L+=` }
|
|
599
599
|
`,L+=`}
|
|
600
|
-
`,L},"generateSource"),this.generateObject=o(function(O,R,
|
|
600
|
+
`,L},"generateSource"),this.generateObject=o(function(O,R,D){let P={},J=[],L=[],W=O.slice(0);return P.grammarObject="grammarObject",R.forEach(Q=>{J.push(Q.lower)}),J.sort(),D.length>0&&(D.forEach(Q=>{L.push(Q.lower)}),L.sort()),P.callbacks=[],J.forEach(Q=>{P.callbacks[Q]=!1}),D.length>0&&L.forEach(Q=>{P.callbacks[Q]=!1}),P.rules=R,P.udts=D,P.toString=o(function(){return W},"toStringFunc"),P},"generateObject")},"exportParser")});var W4=De((HG,V4)=>{V4.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 L=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"),K=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
|
-
`,T},"showLegend"),q=o(()=>{let T=null,h=null,
|
|
604
|
-
`,
|
|
605
|
-
`;return
|
|
603
|
+
`,T},"showLegend"),q=o(()=>{let T=null,h=null,y="";if(y+=`RULE ATTRIBUTES WITH ERRORS
|
|
604
|
+
`,y+=K(),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"),j=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:L,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
|
-
`,h+=
|
|
608
|
-
`,h+=
|
|
609
|
-
`,h+=
|
|
610
|
-
`,
|
|
611
|
-
${
|
|
612
|
-
${
|
|
613
|
-
`),
|
|
614
|
-
`),
|
|
615
|
-
${
|
|
616
|
-
`),
|
|
617
|
-
`),
|
|
618
|
-
`}return
|
|
607
|
+
`,h+=y,h+=K(),h+=j(97)):T.charCodeAt(0)===116?(h+=`ordered by rule type
|
|
608
|
+
`,h+=y,h+=K(),h+=j(116)):(h+=`ordered by rule index
|
|
609
|
+
`,h+=y,h+=K(),h+=j()),h},"showAttributes"),showAttributeErrors:q}},"exportRuleAttributes")()});var Y4=De((zG,J4)=>{J4.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="=> ",L="<= ",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
|
+
`,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
|
+
${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
|
+
${P}${J}`,x=D.length);for(v===0&&(D+=`=> <none>
|
|
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+=L,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
|
+
${P}${J}`,x=D.length);v===0&&(D+=`<= <none>
|
|
616
|
+
`),W===!1&&(D+=`
|
|
617
|
+
`),D+=`
|
|
618
|
+
`}return D},"show");return{ruleDependencies:n,showRuleDependencies:o((c="index")=>{let u=`RULE DEPENDENCIES(index:type:[group number:])
|
|
619
619
|
`;return u+=`=> refers to rule names
|
|
620
620
|
`,u+=`<= referenced by rule names
|
|
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
|
-
`,L=0;L<
|
|
626
|
-
`;if(
|
|
624
|
+
`,u+=i(null))),u},"showRuleDependencies")}})()});var Z4=De((KG,X4)=>{X4.exports=o(function(){let e=zi(),{ruleAttributes:r,showAttributes:n,showAttributeErrors:i}=W4(),{ruleDependencies:a,showRuleDependencies:c}=Y4();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 e5=De((jG,Q4)=>{Q4.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",L;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(L=0;L<D;L+=1)x.push(L);if(m=x.slice(0),m.sort(W),P){for(L=0;L<P;L+=1)S.push(L);v=S.slice(0),v.sort(Q)}if(c.charCodeAt(0)===97){for(J+=` - alphabetical by rule/UDT name
|
|
625
|
+
`,L=0;L<D;L+=1)J+=`${L}: ${m[L]}: ${O[m[L]].name}
|
|
626
|
+
`;if(P)for(L=0;L<P;L+=1)J+=`${L}: ${v[L]}: ${R[v[L]].name}
|
|
627
627
|
`}else{for(J+=` - ordered by rule/UDT index
|
|
628
|
-
`,L=0;L<
|
|
629
|
-
`;if(
|
|
630
|
-
`}return J},"showRules")},"exfn")()});var
|
|
631
|
-
`,h+=`line no: ${
|
|
628
|
+
`,L=0;L<D;L+=1)J+=`${L}: ${O[L].name}
|
|
629
|
+
`;if(P)for(L=0;L<P;L+=1)J+=`${L}: ${R[L].name}
|
|
630
|
+
`}return J},"showRules")},"exfn")()});var r5=De((GG,t5)=>{t5.exports=o(function(e){let r="api.js: ",n=this,i=Ka(),a=tb(),c=U4(),u=new(G4()),{attributes:m,showAttributes:v,showAttributeErrors:x,showRuleDependencies:S}=Z4(),O=e5(),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
|
+
`,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"),L=o(function(T,h,
|
|
638
|
-
`,b&&typeof b=="string"&&(
|
|
639
|
-
`),
|
|
640
|
-
`,T.forEach(A=>{let E,g,C,
|
|
641
|
-
`,
|
|
642
|
-
`)}),
|
|
643
|
-
`,
|
|
637
|
+
`,h},"linesToHtml"),L=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
|
+
`,b&&typeof b=="string"&&(p+=`<caption>${b}</caption>
|
|
639
|
+
`),p+=`<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>
|
|
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>
|
|
641
|
+
`,p+="<tr>",p+=`<td colspan="3"></td><td>↑: ${i.utils.stringToAsciiHtml(A.msg)}</td>`,p+=`</tr>
|
|
642
|
+
`)}),p+=`</table></p>
|
|
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"),Z=!1,Y=!1,oe=!1,K=!1,q=0,j;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),Z=!0},"scan"),this.parse=o(function(T,h){if(!Z)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,j=T.lineMap,oe=!0)},"translate"),this.attributes=o(function(){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return q=p(this.rules,this.udts,j,this.errors),K=!0,q},"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,j=h.lineMap,q=p(this.rules,this.udts,j,this.errors),K=!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(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return S(T)},"displayRuleDependencies"),this.displayAttributes=o(function(T="index"){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return q&&y(T),v(T)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return y()},"displayAttributeErrors"),this.toSource=o(function(T){if(!K)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(q)throw new Error(`${r}can't generate parser source - attributes have ${q} errors`);return u.generateSource(this.chars,this.lines,this.rules,this.udts,T)},"toSource"),this.toObject=o(function(){if(!K)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(q)throw new Error(`${r}can't generate parser source - attributes have ${q} errors`);return u.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return V(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 N(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 m=o(function(){},"TempCtor");m.prototype=l.prototype,b.prototype=new m,b.prototype.constructor=b}o(n,"inherits");function i(b,l,m){if(i.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((l==="le"||l==="be")&&(m=l,l=10),this._init(b||0,l||10,m||"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,m){return l.cmp(m)>0?l:m},"max"),i.min=o(function(l,m){return l.cmp(m)<0?l:m},"min"),i.prototype._init=o(function(l,m,_){if(typeof l=="number")return this._initNumber(l,m,_);if(typeof l=="object")return this._initArray(l,m,_);m==="hex"&&(m=16),r(m===(m|0)&&m>=2&&m<=36),l=l.toString().replace(/\s+/g,"");var A=0;l[0]==="-"&&(A++,this.negative=1),A<l.length&&(m===16?this._parseHex(l,A,_):(this._parseBase(l,m,A),_==="le"&&this._initArray(this.toArray(),m,_)))},"init"),i.prototype._initNumber=o(function(l,m,_){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(),m,_)},"_initNumber"),i.prototype._initArray=o(function(l,m,_){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 m=b.charCodeAt(l);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;r(!1,"Invalid character in "+b)}o(c,"parseHex4Bits");function u(b,l,m){var _=c(b,m);return m-1>=l&&(_|=c(b,m-1)<<4),_}o(u,"parseHexByte"),i.prototype._parseHex=o(function(l,m,_){this.length=Math.ceil((l.length-m)/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>=m;A-=2)C=u(l,m,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8;else{var P=l.length-m;for(A=P%2===0?m+1:m;A<l.length;A+=2)C=u(l,m,A)<<E,this.words[g]|=C&67108863,E>=18?(E-=18,g+=1,this.words[g]|=C>>>26):E+=8}this._strip()},"_parseHex");function p(b,l,m,_){for(var A=0,E=0,g=Math.min(b.length,m),C=l;C<g;C++){var P=b.charCodeAt(C)-48;A*=_,P>=49?E=P-49+10:P>=17?E=P-17+10:E=P,r(P>=0&&E<_,"Invalid character"),A+=E}return A}o(p,"parseBase"),i.prototype._parseBase=o(function(l,m,_){this.words=[0],this.length=1;for(var A=0,E=1;E<=67108863;E*=m)A++;A--,E=E/m|0;for(var g=l.length-_,C=g%A,P=Math.min(g,g-C)+_,w=0,k=_;k<P;k+=A)w=p(l,k,k+A,m),this.imuln(E),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(C!==0){var he=1;for(w=p(l,k,l.length,m),k=0;k<C;k++)he*=m;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 m=0;m<this.length;m++)l.words[m]=this.words[m];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")]=y}catch{i.prototype.inspect=y}else i.prototype.inspect=y;function y(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(y,"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,m){l=l||10,m=m|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],P=((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-P.length]+P+_:_=P+_}for(E!==0&&(_=E.toString(16)+_);_.length%m!==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 D=he.modrn(k).toString(l);he=he.idivn(k),he.isZero()?_=D+_:_=S[w-D.length]+D+_}for(this.isZero()&&(_="0"+_);_.length%m!==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,m){return this.toArrayLike(a,l,m)},"toBuffer")),i.prototype.toArray=o(function(l,m){return this.toArrayLike(Array,l,m)},"toArray");var I=o(function(l,m){return l.allocUnsafe?l.allocUnsafe(m):new l(m)},"allocate");i.prototype.toArrayLike=o(function(l,m,_){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=I(l,E),C=m==="le"?"LE":"BE";return this["_toArrayLike"+C](g,A),g},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(l,m){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,m){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 m=l,_=0;return m>=4096&&(_+=13,m>>>=13),m>=64&&(_+=7,m>>>=7),m>=8&&(_+=4,m>>>=4),m>=2&&(_+=2,m>>>=2),_+m},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var m=l,_=0;return(m&8191)===0&&(_+=13,m>>>=13),(m&127)===0&&(_+=7,m>>>=7),(m&15)===0&&(_+=4,m>>>=4),(m&3)===0&&(_+=2,m>>>=2),(m&1)===0&&_++,_},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],m=this._countBits(l);return(this.length-1)*26+m},"bitLength");function N(b){for(var l=new Array(b.bitLength()),m=0;m<l.length;m++){var _=m/26|0,A=m%26;l[m]=b.words[_]>>>A&1}return l}o(N,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,m=0;m<this.length;m++){var _=this._zeroBits(this.words[m]);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 m=0;m<l.length;m++)this.words[m]=this.words[m]|l.words[m];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 m;this.length>l.length?m=l:m=this;for(var _=0;_<m.length;_++)this.words[_]=this.words[_]&l.words[_];return this.length=m.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 m,_;this.length>l.length?(m=this,_=l):(m=l,_=this);for(var A=0;A<_.length;A++)this.words[A]=m.words[A]^_.words[A];if(this!==m)for(;A<m.length;A++)this.words[A]=m.words[A];return this.length=m.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 m=Math.ceil(l/26)|0,_=l%26;this._expand(m),_>0&&m--;for(var A=0;A<m;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,m){r(typeof l=="number"&&l>=0);var _=l/26|0,A=l%26;return this._expand(_+1),m?this.words[_]=this.words[_]|1<<A:this.words[_]=this.words[_]&~(1<<A),this._strip()},"setn"),i.prototype.iadd=o(function(l){var m;if(this.negative!==0&&l.negative===0)return this.negative=0,m=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,m=this.isub(l),l.negative=1,m._normSign();var _,A;this.length>l.length?(_=this,A=l):(_=l,A=this);for(var E=0,g=0;g<A.length;g++)m=(_.words[g]|0)+(A.words[g]|0)+E,this.words[g]=m&67108863,E=m>>>26;for(;E!==0&&g<_.length;g++)m=(_.words[g]|0)+E,this.words[g]=m&67108863,E=m>>>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 m;return l.negative!==0&&this.negative===0?(l.negative=0,m=this.sub(l),l.negative^=1,m):l.negative===0&&this.negative!==0?(this.negative=0,m=l.sub(this),this.negative=1,m):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 m=this.iadd(l);return l.negative=1,m._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++)m=(A.words[C]|0)-(E.words[C]|0)+g,g=m>>26,this.words[C]=m&67108863;for(;g!==0&&C<A.length;C++)m=(A.words[C]|0)+g,g=m>>26,this.words[C]=m&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,m){m.negative=l.negative^b.negative;var _=b.length+l.length|0;m.length=_,_=_-1|0;var A=b.words[0]|0,E=l.words[0]|0,g=A*E,C=g&67108863,P=g/67108864|0;m.words[0]=C;for(var w=1;w<_;w++){for(var k=P>>>26,he=P&67108863,D=Math.min(w,l.length-1),Q=Math.max(0,w-b.length+1);Q<=D;Q++){var se=w-Q|0;A=b.words[se]|0,E=l.words[Q]|0,g=A*E+he,k+=g/67108864|0,he=g&67108863}m.words[w]=he|0,P=k|0}return P!==0?m.words[w]=P|0:m.length--,m._strip()}o(J,"smallMulTo");var L=o(function(l,m,_){var A=l.words,E=m.words,g=_.words,C=0,P,w,k,he=A[0]|0,D=he&8191,Q=he>>>13,se=A[1]|0,F=se&8191,$=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,G=A[5]|0,pe=G&8191,Ce=G>>>13,He=A[6]|0,Re=He&8191,Ve=He>>>13,pr=A[7]|0,ue=pr&8191,ie=pr>>>13,U=A[8]|0,X=U&8191,me=U>>>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^m.negative,_.length=19,P=Math.imul(D,Ue),w=Math.imul(D,Oe),w=w+Math.imul(Q,Ue)|0,k=Math.imul(Q,Oe);var un=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(un>>>26)|0,un&=67108863,P=Math.imul(F,Ue),w=Math.imul(F,Oe),w=w+Math.imul($,Ue)|0,k=Math.imul($,Oe),P=P+Math.imul(D,je)|0,w=w+Math.imul(D,Je)|0,w=w+Math.imul(Q,je)|0,k=k+Math.imul(Q,Je)|0;var ln=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ln>>>26)|0,ln&=67108863,P=Math.imul(ne,Ue),w=Math.imul(ne,Oe),w=w+Math.imul(ae,Ue)|0,k=Math.imul(ae,Oe),P=P+Math.imul(F,je)|0,w=w+Math.imul(F,Je)|0,w=w+Math.imul($,je)|0,k=k+Math.imul($,Je)|0,P=P+Math.imul(D,nt)|0,w=w+Math.imul(D,it)|0,w=w+Math.imul(Q,nt)|0,k=k+Math.imul(Q,it)|0;var hn=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(hn>>>26)|0,hn&=67108863,P=Math.imul(ge,Ue),w=Math.imul(ge,Oe),w=w+Math.imul(re,Ue)|0,k=Math.imul(re,Oe),P=P+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,P=P+Math.imul(F,nt)|0,w=w+Math.imul(F,it)|0,w=w+Math.imul($,nt)|0,k=k+Math.imul($,it)|0,P=P+Math.imul(D,ot)|0,w=w+Math.imul(D,et)|0,w=w+Math.imul(Q,ot)|0,k=k+Math.imul(Q,et)|0;var Nr=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,P=Math.imul(ce,Ue),w=Math.imul(ce,Oe),w=w+Math.imul(ve,Ue)|0,k=Math.imul(ve,Oe),P=P+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,P=P+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,P=P+Math.imul(F,ot)|0,w=w+Math.imul(F,et)|0,w=w+Math.imul($,ot)|0,k=k+Math.imul($,et)|0,P=P+Math.imul(D,st)|0,w=w+Math.imul(D,at)|0,w=w+Math.imul(Q,st)|0,k=k+Math.imul(Q,at)|0;var dn=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,P=Math.imul(pe,Ue),w=Math.imul(pe,Oe),w=w+Math.imul(Ce,Ue)|0,k=Math.imul(Ce,Oe),P=P+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,P=P+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,P=P+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,P=P+Math.imul(F,st)|0,w=w+Math.imul(F,at)|0,w=w+Math.imul($,st)|0,k=k+Math.imul($,at)|0,P=P+Math.imul(D,ft)|0,w=w+Math.imul(D,Xe)|0,w=w+Math.imul(Q,ft)|0,k=k+Math.imul(Q,Xe)|0;var ti=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ti>>>26)|0,ti&=67108863,P=Math.imul(Re,Ue),w=Math.imul(Re,Oe),w=w+Math.imul(Ve,Ue)|0,k=Math.imul(Ve,Oe),P=P+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,P=P+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,P=P+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,P=P+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,P=P+Math.imul(F,ft)|0,w=w+Math.imul(F,Xe)|0,w=w+Math.imul($,ft)|0,k=k+Math.imul($,Xe)|0,P=P+Math.imul(D,ct)|0,w=w+Math.imul(D,ut)|0,w=w+Math.imul(Q,ct)|0,k=k+Math.imul(Q,ut)|0;var Ao=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,P=Math.imul(ue,Ue),w=Math.imul(ue,Oe),w=w+Math.imul(ie,Ue)|0,k=Math.imul(ie,Oe),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+Math.imul(F,ct)|0,w=w+Math.imul(F,ut)|0,w=w+Math.imul($,ct)|0,k=k+Math.imul($,ut)|0,P=P+Math.imul(D,lt)|0,w=w+Math.imul(D,ht)|0,w=w+Math.imul(Q,lt)|0,k=k+Math.imul(Q,ht)|0;var So=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(So>>>26)|0,So&=67108863,P=Math.imul(X,Ue),w=Math.imul(X,Oe),w=w+Math.imul(me,Ue)|0,k=Math.imul(me,Oe),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+Math.imul(F,lt)|0,w=w+Math.imul(F,ht)|0,w=w+Math.imul($,lt)|0,k=k+Math.imul($,ht)|0,P=P+Math.imul(D,dt)|0,w=w+Math.imul(D,tt)|0,w=w+Math.imul(Q,dt)|0,k=k+Math.imul(Q,tt)|0;var Mo=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,P=Math.imul(we,Ue),w=Math.imul(we,Oe),w=w+Math.imul(ke,Ue)|0,k=Math.imul(ke,Oe),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+Math.imul(F,dt)|0,w=w+Math.imul(F,tt)|0,w=w+Math.imul($,dt)|0,k=k+Math.imul($,tt)|0,P=P+Math.imul(D,Ft)|0,w=w+Math.imul(D,qt)|0,w=w+Math.imul(Q,Ft)|0,k=k+Math.imul(Q,qt)|0;var Xi=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,P=Math.imul(we,je),w=Math.imul(we,Je),w=w+Math.imul(ke,je)|0,k=Math.imul(ke,Je),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+Math.imul(F,Ft)|0,w=w+Math.imul(F,qt)|0,w=w+Math.imul($,Ft)|0,k=k+Math.imul($,qt)|0;var Zi=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,P=Math.imul(we,nt),w=Math.imul(we,it),w=w+Math.imul(ke,nt)|0,k=Math.imul(ke,it),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,P=Math.imul(we,ot),w=Math.imul(we,et),w=w+Math.imul(ke,ot)|0,k=Math.imul(ke,et),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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,P=P+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+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(To>>>26)|0,To&=67108863,P=Math.imul(we,st),w=Math.imul(we,at),w=w+Math.imul(ke,st)|0,k=Math.imul(ke,at),P=P+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,P=P+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,P=P+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,P=P+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,P=P+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+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Co>>>26)|0,Co&=67108863,P=Math.imul(we,ft),w=Math.imul(we,Xe),w=w+Math.imul(ke,ft)|0,k=Math.imul(ke,Xe),P=P+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,P=P+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,P=P+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,P=P+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+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(ko>>>26)|0,ko&=67108863,P=Math.imul(we,ct),w=Math.imul(we,ut),w=w+Math.imul(ke,ct)|0,k=Math.imul(ke,ut),P=P+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,P=P+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,P=P+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+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(Io>>>26)|0,Io&=67108863,P=Math.imul(we,lt),w=Math.imul(we,ht),w=w+Math.imul(ke,lt)|0,k=Math.imul(ke,ht),P=P+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,P=P+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 bf=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(bf>>>26)|0,bf&=67108863,P=Math.imul(we,dt),w=Math.imul(we,tt),w=w+Math.imul(ke,dt)|0,k=Math.imul(ke,tt),P=P+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 gf=(C+P|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(gf>>>26)|0,gf&=67108863,P=Math.imul(we,Ft),w=Math.imul(we,qt),w=w+Math.imul(ke,Ft)|0,k=Math.imul(ke,qt);var vf=(C+P|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(vf>>>26)|0,vf&=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]=bf,g[17]=gf,g[18]=vf,C!==0&&(g[19]=C,_.length++),_},"comb10MulTo");Math.imul||(L=J);function V(b,l,m){m.negative=l.negative^b.negative,m.length=b.length+l.length;for(var _=0,A=0,E=0;E<m.length-1;E++){var g=A;A=0;for(var C=_&67108863,P=Math.min(E,l.length-1),w=Math.max(0,E-b.length+1);w<=P;w++){var k=E-w,he=b.words[k]|0,D=l.words[w]|0,Q=he*D,se=Q&67108863;g=g+(Q/67108864|0)|0,se=se+C|0,C=se&67108863,g=g+(se>>>26)|0,A+=g>>>26,g&=67108863}m.words[E]=C,_=g,g=A}return _!==0?m.words[E]=_:m.length--,m._strip()}o(V,"bigMulTo");function Z(b,l,m){return V(b,l,m)}o(Z,"jumboMulTo"),i.prototype.mulTo=o(function(l,m){var _,A=this.length+l.length;return this.length===10&&l.length===10?_=L(this,l,m):A<63?_=J(this,l,m):A<1024?_=V(this,l,m):_=Z(this,l,m),_},"mulTo");function Y(b,l){this.x=b,this.y=l}o(Y,"FFTM"),Y.prototype.makeRBT=o(function(l){for(var m=new Array(l),_=i.prototype._countBits(l)-1,A=0;A<l;A++)m[A]=this.revBin(A,_,l);return m},"makeRBT"),Y.prototype.revBin=o(function(l,m,_){if(l===0||l===_-1)return l;for(var A=0,E=0;E<m;E++)A|=(l&1)<<m-E-1,l>>=1;return A},"revBin"),Y.prototype.permute=o(function(l,m,_,A,E,g){for(var C=0;C<g;C++)A[C]=m[l[C]],E[C]=_[l[C]]},"permute"),Y.prototype.transform=o(function(l,m,_,A,E,g){this.permute(g,l,m,_,A,E);for(var C=1;C<E;C<<=1)for(var P=C<<1,w=Math.cos(2*Math.PI/P),k=Math.sin(2*Math.PI/P),he=0;he<E;he+=P)for(var D=w,Q=k,se=0;se<C;se++){var F=_[he+se],$=A[he+se],ee=_[he+se+C],ne=A[he+se+C],ae=D*ee-Q*ne;ne=D*ne+Q*ee,ee=ae,_[he+se]=F+ee,A[he+se]=$+ne,_[he+se+C]=F-ee,A[he+se+C]=$-ne,se!==P&&(ae=w*D-k*Q,Q=w*Q+k*D,D=ae)}},"transform"),Y.prototype.guessLen13b=o(function(l,m){var _=Math.max(m,l)|1,A=_&1,E=0;for(_=_/2|0;_;_=_>>>1)E++;return 1<<E+1+A},"guessLen13b"),Y.prototype.conjugate=o(function(l,m,_){if(!(_<=1))for(var A=0;A<_/2;A++){var E=l[A];l[A]=l[_-A-1],l[_-A-1]=E,E=m[A],m[A]=-m[_-A-1],m[_-A-1]=-E}},"conjugate"),Y.prototype.normalize13b=o(function(l,m){for(var _=0,A=0;A<m/2;A++){var E=Math.round(l[2*A+1]/m)*8192+Math.round(l[2*A]/m)+_;l[A]=E&67108863,E<67108864?_=0:_=E/67108864|0}return l},"normalize13b"),Y.prototype.convert13b=o(function(l,m,_,A){for(var E=0,g=0;g<m;g++)E=E+(l[g]|0),_[2*g]=E&8191,E=E>>>13,_[2*g+1]=E&8191,E=E>>>13;for(g=2*m;g<A;++g)_[g]=0;r(E===0),r((E&-8192)===0)},"convert13b"),Y.prototype.stub=o(function(l){for(var m=new Array(l),_=0;_<l;_++)m[_]=0;return m},"stub"),Y.prototype.mulp=o(function(l,m,_){var A=2*this.guessLen13b(l.length,m.length),E=this.makeRBT(A),g=this.stub(A),C=new Array(A),P=new Array(A),w=new Array(A),k=new Array(A),he=new Array(A),D=new Array(A),Q=_.words;Q.length=A,this.convert13b(l.words,l.length,C,A),this.convert13b(m.words,m.length,k,A),this.transform(C,g,P,w,A,E),this.transform(k,g,he,D,A,E);for(var se=0;se<A;se++){var F=P[se]*he[se]-w[se]*D[se];w[se]=P[se]*D[se]+w[se]*he[se],P[se]=F}return this.conjugate(P,w,A),this.transform(P,w,Q,g,A,E),this.conjugate(Q,g,A),this.normalize13b(Q,A),_.negative=l.negative^m.negative,_.length=l.length+m.length,_._strip()},"mulp"),i.prototype.mul=o(function(l){var m=new i(null);return m.words=new Array(this.length+l.length),this.mulTo(l,m)},"mul"),i.prototype.mulf=o(function(l){var m=new i(null);return m.words=new Array(this.length+l.length),Z(this,l,m)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){var m=l<0;m&&(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++),m?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 m=N(l);if(m.length===0)return new i(1);for(var _=this,A=0;A<m.length&&m[A]===0;A++,_=_.sqr());if(++A<m.length)for(var E=_.sqr();A<m.length;A++,E=E.sqr())m[A]!==0&&(_=_.mul(E));return _},"pow"),i.prototype.iushln=o(function(l){r(typeof l=="number"&&l>=0);var m=l%26,_=(l-m)/26,A=67108863>>>26-m<<26-m,E;if(m!==0){var g=0;for(E=0;E<this.length;E++){var C=this.words[E]&A,P=(this.words[E]|0)-C<<m;this.words[E]=P|g,g=C>>>26-m}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,m,_){r(typeof l=="number"&&l>=0);var A;m?A=(m-m%26)/26:A=0;var E=l%26,g=Math.min((l-E)/26,this.length),C=67108863^67108863>>>E<<E,P=_;if(A-=g,A=Math.max(0,A),P){for(var w=0;w<g;w++)P.words[w]=this.words[w];P.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 P&&k!==0&&(P.words[P.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(l,m,_){return r(this.negative===0),this.iushrn(l,m,_)},"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 m=l%26,_=(l-m)/26,A=1<<m;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 m=l%26,_=(l-m)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(m!==0&&_++,this.length=Math.min(_,this.length),m!==0){var A=67108863^67108863>>>m<<m;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 m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+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 m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+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,m,_){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 P=(l.words[E]|0)*m;g-=P&67108863,C=(g>>26)-(P/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,m){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 P=A.length-E.length,w;if(m!=="mod"){w=new i(null),w.length=P+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,P);he.negative===0&&(A=he,w&&(w.words[P]=1));for(var D=P-1;D>=0;D--){var Q=(A.words[E.length+D]|0)*67108864+(A.words[E.length+D-1]|0);for(Q=Math.min(Q/g|0,67108863),A._ishlnsubmul(E,Q,D);A.negative!==0;)Q--,A.negative=0,A._ishlnsubmul(E,1,D),A.isZero()||(A.negative^=1);w&&(w.words[D]=Q)}return w&&w._strip(),A._strip(),m!=="div"&&_!==0&&A.iushrn(_),{div:w||null,mod:A}},"_wordDiv"),i.prototype.divmod=o(function(l,m,_){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,m),m!=="mod"&&(A=g.div.neg()),m!=="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(),m),m!=="mod"&&(A=g.div.neg()),{div:A,mod:g.mod}):(this.negative&l.negative)!==0?(g=this.neg().divmod(l.neg(),m),m!=="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?m==="div"?{div:this.divn(l.words[0]),mod:null}:m==="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,m)},"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 m=this.divmod(l);if(m.mod.isZero())return m.div;var _=m.div.negative!==0?m.mod.isub(l):m.mod,A=l.ushrn(1),E=l.andln(1),g=_.cmp(A);return g<0||E===1&&g===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(l){var m=l<0;m&&(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 m?-A:A},"modrn"),i.prototype.modn=o(function(l){return this.modrn(l)},"modn"),i.prototype.idivn=o(function(l){var m=l<0;m&&(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(),m?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 m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var A=new i(1),E=new i(0),g=new i(0),C=new i(1),P=0;m.isEven()&&_.isEven();)m.iushrn(1),_.iushrn(1),++P;for(var w=_.clone(),k=m.clone();!m.isZero();){for(var he=0,D=1;(m.words[0]&D)===0&&he<26;++he,D<<=1);if(he>0)for(m.iushrn(he);he-- >0;)(A.isOdd()||E.isOdd())&&(A.iadd(w),E.isub(k)),A.iushrn(1),E.iushrn(1);for(var Q=0,se=1;(_.words[0]&se)===0&&Q<26;++Q,se<<=1);if(Q>0)for(_.iushrn(Q);Q-- >0;)(g.isOdd()||C.isOdd())&&(g.iadd(w),C.isub(k)),g.iushrn(1),C.iushrn(1);m.cmp(_)>=0?(m.isub(_),A.isub(g),E.isub(C)):(_.isub(m),g.isub(A),C.isub(E))}return{a:g,b:C,gcd:_.iushln(P)}},"egcd"),i.prototype._invmp=o(function(l){r(l.negative===0),r(!l.isZero());var m=this,_=l.clone();m.negative!==0?m=m.umod(l):m=m.clone();for(var A=new i(1),E=new i(0),g=_.clone();m.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,P=1;(m.words[0]&P)===0&&C<26;++C,P<<=1);if(C>0)for(m.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);m.cmp(_)>=0?(m.isub(_),A.isub(E)):(_.isub(m),E.isub(A))}var he;return m.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 m=this.clone(),_=l.clone();m.negative=0,_.negative=0;for(var A=0;m.isEven()&&_.isEven();A++)m.iushrn(1),_.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;_.isEven();)_.iushrn(1);var E=m.cmp(_);if(E<0){var g=m;m=_,_=g}else if(E===0||_.cmpn(1)===0)break;m.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 m=l%26,_=(l-m)/26,A=1<<m;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 m=l<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var _;if(this.length>1)_=1;else{m&&(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 m=this.ucmp(l);return this.negative!==0?-m|0:m},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var m=0,_=this.length-1;_>=0;_--){var A=this.words[_]|0,E=l.words[_]|0;if(A!==E){A<E?m=-1:A>E&&(m=1);break}}return m},"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 K(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(K,"MPrime"),K.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),K.prototype.ireduce=o(function(l){var m=l,_;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),_=m.bitLength();while(_>this.n);var A=_<this.n?-1:m.ucmp(this.p);return A===0?(m.words[0]=0,m.length=1):A>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),K.prototype.split=o(function(l,m){l.iushrn(this.n,0,m)},"split"),K.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function q(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(q,"K256"),n(q,K),q.prototype.split=o(function(l,m){for(var _=4194303,A=Math.min(l.length,9),E=0;E<A;E++)m.words[E]=l.words[E];if(m.length=A,l.length<=9){l.words[0]=0,l.length=1;return}var g=l.words[9];for(m.words[m.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"),q.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var m=0,_=0;_<l.length;_++){var A=l.words[_]|0;m+=A*977,l.words[_]=m&67108863,m=A*64+(m/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function j(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(j,"P224"),n(j,K);function le(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,"P192"),n(le,K);function T(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(T,"P25519"),n(T,K),T.prototype.imulK=o(function(l){for(var m=0,_=0;_<l.length;_++){var A=(l.words[_]|0)*19+m,E=A&67108863;A>>>=26,l.words[_]=E,m=A}return m!==0&&(l.words[l.length++]=m),l},"imulK"),i._prime=o(function(l){if(oe[l])return oe[l];var m;if(l==="k256")m=new q;else if(l==="p224")m=new j;else if(l==="p192")m=new le;else if(l==="p25519")m=new T;else throw new Error("Unknown prime "+l);return oe[l]=m,m},"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,m){r((l.negative|m.negative)===0,"red works only with positives"),r(l.red&&l.red===m.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,m){this._verify2(l,m);var _=l.add(m);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},"add"),h.prototype.iadd=o(function(l,m){this._verify2(l,m);var _=l.iadd(m);return _.cmp(this.m)>=0&&_.isub(this.m),_},"iadd"),h.prototype.sub=o(function(l,m){this._verify2(l,m);var _=l.sub(m);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},"sub"),h.prototype.isub=o(function(l,m){this._verify2(l,m);var _=l.isub(m);return _.cmpn(0)<0&&_.iadd(this.m),_},"isub"),h.prototype.shl=o(function(l,m){return this._verify1(l),this.imod(l.ushln(m))},"shl"),h.prototype.imul=o(function(l,m){return this._verify2(l,m),this.imod(l.imul(m))},"imul"),h.prototype.mul=o(function(l,m){return this._verify2(l,m),this.imod(l.mul(m))},"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 m=this.m.andln(3);if(r(m%2===1),m===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(),P=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new i(2*w*w).toRed(this);this.pow(w,P).cmp(C)!==0;)w.redIAdd(C);for(var k=this.pow(w,A),he=this.pow(l,A.addn(1).iushrn(1)),D=this.pow(l,A),Q=E;D.cmp(g)!==0;){for(var se=D,F=0;se.cmp(g)!==0;F++)se=se.redSqr();r(F<Q);var $=this.pow(k,new i(1).iushln(Q-F-1));he=he.redMul($),k=$.redSqr(),D=D.redMul(k),Q=F}return he},"sqrt"),h.prototype.invm=o(function(l){var m=l._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},"invm"),h.prototype.pow=o(function(l,m){if(m.isZero())return new i(1).toRed(this);if(m.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,P=0,w=m.bitLength()%26;for(w===0&&(w=26),E=m.length-1;E>=0;E--){for(var k=m.words[E],he=w-1;he>=0;he--){var D=k>>he&1;if(g!==A[0]&&(g=this.sqr(g)),D===0&&C===0){P=0;continue}C<<=1,C|=D,P++,!(P!==_&&(E!==0||he!==0))&&(g=this.mul(g,A[C]),P=0,C=0)}w=26}return g},"pow"),h.prototype.convertTo=o(function(l){var m=l.umod(this.m);return m===l?m.clone():m},"convertTo"),h.prototype.convertFrom=o(function(l){var m=l.clone();return m.red=null,m},"convertFrom"),i.mont=o(function(l){return new x(l)},"mont");function x(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(x,"Mont"),n(x,h),x.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),x.prototype.convertFrom=o(function(l){var m=this.imod(l.mul(this.rinv));return m.red=null,m},"convertFrom"),x.prototype.imul=o(function(l,m){if(l.isZero()||m.isZero())return l.words[0]=0,l.length=1,l;var _=l.imul(m),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"),x.prototype.mul=o(function(l,m){if(l.isZero()||m.isZero())return new i(0)._forceRed(this);var _=l.mul(m),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"),x.prototype.invm=o(function(l){var m=this.imod(l._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm")})(typeof vb>"u"||vb,v5)});var o8=De((cJ,i8)=>{i8.exports=Rb;var n8=128,pB=127,mB=~pB,bB=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>=bB;)e[r++]=t&255|n8,t/=128;for(;t&mB;)e[r++]=t&255|n8,t>>>=7;return e[r]=t|0,Rb.bytes=r-n+1,e}o(Rb,"encode")});var f8=De((uJ,a8)=>{a8.exports=Nb;var gB=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>=gB);return Nb.bytes=a-n,r}o(Nb,"read")});var u8=De((lJ,c8)=>{var vB=Math.pow(2,7),yB=Math.pow(2,14),xB=Math.pow(2,21),wB=Math.pow(2,28),_B=Math.pow(2,35),EB=Math.pow(2,42),AB=Math.pow(2,49),SB=Math.pow(2,56),MB=Math.pow(2,63);c8.exports=function(t){return t<vB?1:t<yB?2:t<xB?3:t<wB?4:t<_B?5:t<EB?6:t<AB?7:t<SB?8:t<MB?9:10}});var Zu=De((hJ,l8)=>{l8.exports={encode:o8(),decode:f8(),encodingLength:u8()}});var w8=De((gJ,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,p){var v={key:u,value:c[u]},y={key:p,value:c[p]};return a(v,y)}}}(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,p;if(Array.isArray(c)){for(p="[",u=0;u<c.length;u++)u&&(p+=","),p+=a(c[u])||"null";return p+"]"}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,y=Object.keys(c).sort(n&&n(c));for(p="",u=0;u<y.length;u++){var S=y[u],O=a(c[S]);!O||(p&&(p+=","),p+=JSON.stringify(S)+":"+O)}return i.splice(v,1),"{"+p+"}"}},"stringify")(t)}});var _c=De((nl,vc)=>{var aU=200,$8="__lodash_hash_undefined__",F8=9007199254740991,ng="[object Arguments]",fU="[object Array]",q8="[object Boolean]",H8="[object Date]",cU="[object Error]",ig="[object Function]",z8="[object GeneratorFunction]",n0="[object Map]",K8="[object Number]",og="[object Object]",C8="[object Promise]",j8="[object RegExp]",i0="[object Set]",G8="[object String]",V8="[object Symbol]",Xb="[object WeakMap]",W8="[object ArrayBuffer]",o0="[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]",uU=/[\\^$.*+?()[\]{}|]/g,lU=/\w*$/,hU=/^\[object .+?Constructor\]$/,dU=/^(?:0|[1-9]\d*)$/,nr={};nr[ng]=nr[fU]=nr[W8]=nr[o0]=nr[q8]=nr[H8]=nr[J8]=nr[Y8]=nr[X8]=nr[Z8]=nr[Q8]=nr[n0]=nr[K8]=nr[og]=nr[j8]=nr[i0]=nr[G8]=nr[V8]=nr[e_]=nr[t_]=nr[r_]=nr[n_]=!0;nr[cU]=nr[ig]=nr[Xb]=!1;var pU=typeof global=="object"&&global&&global.Object===Object&&global,mU=typeof self=="object"&&self&&self.Object===Object&&self,rs=pU||mU||Function("return this")(),i_=typeof nl=="object"&&nl&&!nl.nodeType&&nl,k8=i_&&typeof vc=="object"&&vc&&!vc.nodeType&&vc,bU=k8&&k8.exports===i_;function gU(t,e){return t.set(e[0],e[1]),t}o(gU,"addMapEntry");function vU(t,e){return t.add(e),t}o(vU,"addSetEntry");function yU(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}o(yU,"arrayEach");function xU(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}o(xU,"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 wU(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(wU,"baseTimes");function _U(t,e){return t?.[e]}o(_U,"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 EU=Array.prototype,AU=Function.prototype,s0=Object.prototype,Yb=rs["__core-js_shared__"],O8=function(){var t=/[^.]+$/.exec(Yb&&Yb.keys&&Yb.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),a_=AU.toString,Vs=s0.hasOwnProperty,a0=s0.toString,SU=RegExp("^"+a_.call(Vs).replace(uU,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R8=bU?rs.Buffer:void 0,N8=rs.Symbol,P8=rs.Uint8Array,MU=sg(Object.getPrototypeOf,Object),TU=Object.create,CU=s0.propertyIsEnumerable,kU=EU.splice,L8=Object.getOwnPropertySymbols,IU=R8?R8.isBuffer:void 0,DU=sg(Object.keys,Object),Zb=wc(rs,"DataView"),il=wc(rs,"Map"),Qb=wc(rs,"Promise"),eg=wc(rs,"Set"),tg=wc(rs,"WeakMap"),ol=wc(Object,"create"),OU=Xa(Zb),RU=Xa(il),NU=Xa(Qb),PU=Xa(eg),LU=Xa(tg),B8=N8?N8.prototype:void 0,U8=B8?B8.valueOf:void 0;function Ya(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(Ya,"Hash");function BU(){this.__data__=ol?ol(null):{}}o(BU,"hashClear");function UU(t){return this.has(t)&&delete this.__data__[t]}o(UU,"hashDelete");function $U(t){var e=this.__data__;if(ol){var r=e[t];return r===$8?void 0:r}return Vs.call(e,t)?e[t]:void 0}o($U,"hashGet");function FU(t){var e=this.__data__;return ol?e[t]!==void 0:Vs.call(e,t)}o(FU,"hashHas");function qU(t,e){var r=this.__data__;return r[t]=ol&&e===void 0?$8:e,this}o(qU,"hashSet");Ya.prototype.clear=BU;Ya.prototype.delete=UU;Ya.prototype.get=$U;Ya.prototype.has=FU;Ya.prototype.set=qU;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 HU(){this.__data__=[]}o(HU,"listCacheClear");function zU(t){var e=this.__data__,r=f0(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():kU.call(e,r,1),!0}o(zU,"listCacheDelete");function KU(t){var e=this.__data__,r=f0(e,t);return r<0?void 0:e[r][1]}o(KU,"listCacheGet");function jU(t){return f0(this.__data__,t)>-1}o(jU,"listCacheHas");function GU(t,e){var r=this.__data__,n=f0(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}o(GU,"listCacheSet");ns.prototype.clear=HU;ns.prototype.delete=zU;ns.prototype.get=KU;ns.prototype.has=jU;ns.prototype.set=GU;function yc(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(yc,"MapCache");function VU(){this.__data__={hash:new Ya,map:new(il||ns),string:new Ya}}o(VU,"mapCacheClear");function WU(t){return c0(this,t).delete(t)}o(WU,"mapCacheDelete");function JU(t){return c0(this,t).get(t)}o(JU,"mapCacheGet");function YU(t){return c0(this,t).has(t)}o(YU,"mapCacheHas");function XU(t,e){return c0(this,t).set(t,e),this}o(XU,"mapCacheSet");yc.prototype.clear=VU;yc.prototype.delete=WU;yc.prototype.get=JU;yc.prototype.has=YU;yc.prototype.set=XU;function xc(t){this.__data__=new ns(t)}o(xc,"Stack");function ZU(){this.__data__=new ns}o(ZU,"stackClear");function QU(t){return this.__data__.delete(t)}o(QU,"stackDelete");function e$(t){return this.__data__.get(t)}o(e$,"stackGet");function t$(t){return this.__data__.has(t)}o(t$,"stackHas");function r$(t,e){var r=this.__data__;if(r instanceof ns){var n=r.__data__;if(!il||n.length<aU-1)return n.push([t,e]),this;r=this.__data__=new yc(n)}return r.set(t,e),this}o(r$,"stackSet");xc.prototype.clear=ZU;xc.prototype.delete=QU;xc.prototype.get=e$;xc.prototype.has=t$;xc.prototype.set=r$;function n$(t,e){var r=fg(t)||T$(t)?wU(t.length,String):[],n=r.length,i=!!n;for(var a in t)(e||Vs.call(t,a))&&!(i&&(a=="length"||E$(a,n)))&&r.push(a);return r}o(n$,"arrayLikeKeys");function f_(t,e,r){var n=t[e];(!(Vs.call(t,e)&&h_(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}o(f_,"assignValue");function f0(t,e){for(var r=t.length;r--;)if(h_(t[r][0],e))return r;return-1}o(f0,"assocIndexOf");function i$(t,e){return t&&c_(e,cg(e),t)}o(i$,"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(!u0(t))return t;var p=fg(t);if(p){if(u=x$(t),!e)return g$(t,u)}else{var v=Ja(t),y=v==ig||v==z8;if(k$(t))return u$(t,e);if(v==og||v==ng||y&&!a){if(s_(t))return a?t:{};if(u=w$(y?{}:t),!e)return v$(t,i$(u,t))}else{if(!nr[v])return a?t:{};u=_$(t,v,rg,e)}}c||(c=new xc);var S=c.get(t);if(S)return S;if(c.set(t,u),!p)var O=r?y$(t):cg(t);return yU(O||t,function(R,I){O&&(I=R,R=t[I]),f_(u,I,rg(R,e,r,n,I,t,c))}),u}o(rg,"baseClone");function o$(t){return u0(t)?TU(t):{}}o(o$,"baseCreate");function s$(t,e,r){var n=e(t);return fg(t)?n:xU(n,r(t))}o(s$,"baseGetAllKeys");function a$(t){return a0.call(t)}o(a$,"baseGetTag");function f$(t){if(!u0(t)||S$(t))return!1;var e=p_(t)||s_(t)?SU:hU;return e.test(Xa(t))}o(f$,"baseIsNative");function c$(t){if(!l_(t))return DU(t);var e=[];for(var r in Object(t))Vs.call(t,r)&&r!="constructor"&&e.push(r);return e}o(c$,"baseKeys");function u$(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}o(u$,"cloneBuffer");function ag(t){var e=new t.constructor(t.byteLength);return new P8(e).set(new P8(t)),e}o(ag,"cloneArrayBuffer");function l$(t,e){var r=e?ag(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}o(l$,"cloneDataView");function h$(t,e,r){var n=e?r(I8(t),!0):I8(t);return o_(n,gU,new t.constructor)}o(h$,"cloneMap");function d$(t){var e=new t.constructor(t.source,lU.exec(t));return e.lastIndex=t.lastIndex,e}o(d$,"cloneRegExp");function p$(t,e,r){var n=e?r(D8(t),!0):D8(t);return o_(n,vU,new t.constructor)}o(p$,"cloneSet");function m$(t){return U8?Object(U8.call(t)):{}}o(m$,"cloneSymbol");function b$(t,e){var r=e?ag(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o(b$,"cloneTypedArray");function g$(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(g$,"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 v$(t,e){return c_(t,u_(t),e)}o(v$,"copySymbols");function y$(t){return s$(t,cg,u_)}o(y$,"getAllKeys");function c0(t,e){var r=t.__data__;return A$(e)?r[typeof e=="string"?"string":"hash"]:r.map}o(c0,"getMapData");function wc(t,e){var r=_U(t,e);return f$(r)?r:void 0}o(wc,"getNative");var u_=L8?sg(L8,Object):O$,Ja=a$;(Zb&&Ja(new Zb(new ArrayBuffer(1)))!=o0||il&&Ja(new il)!=n0||Qb&&Ja(Qb.resolve())!=C8||eg&&Ja(new eg)!=i0||tg&&Ja(new tg)!=Xb)&&(Ja=o(function(t){var e=a0.call(t),r=e==og?t.constructor:void 0,n=r?Xa(r):void 0;if(n)switch(n){case OU:return o0;case RU:return n0;case NU:return C8;case PU:return i0;case LU:return Xb}return e},"getTag"));function x$(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&Vs.call(t,"index")&&(r.index=t.index,r.input=t.input),r}o(x$,"initCloneArray");function w$(t){return typeof t.constructor=="function"&&!l_(t)?o$(MU(t)):{}}o(w$,"initCloneObject");function _$(t,e,r,n){var i=t.constructor;switch(e){case W8:return ag(t);case q8:case H8:return new i(+t);case o0:return l$(t,n);case J8:case Y8:case X8:case Z8:case Q8:case e_:case t_:case r_:case n_:return b$(t,n);case n0:return h$(t,n,r);case K8:case G8:return new i(t);case j8:return d$(t);case i0:return p$(t,n,r);case V8:return m$(t)}}o(_$,"initCloneByTag");function E$(t,e){return e=e??F8,!!e&&(typeof t=="number"||dU.test(t))&&t>-1&&t%1==0&&t<e}o(E$,"isIndex");function A$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}o(A$,"isKeyable");function S$(t){return!!O8&&O8 in t}o(S$,"isMasked");function l_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||s0;return t===r}o(l_,"isPrototype");function Xa(t){if(t!=null){try{return a_.call(t)}catch{}try{return t+""}catch{}}return""}o(Xa,"toSource");function M$(t){return rg(t,!0,!0)}o(M$,"cloneDeep");function h_(t,e){return t===e||t!==t&&e!==e}o(h_,"eq");function T$(t){return C$(t)&&Vs.call(t,"callee")&&(!CU.call(t,"callee")||a0.call(t)==ng)}o(T$,"isArguments");var fg=Array.isArray;function d_(t){return t!=null&&I$(t.length)&&!p_(t)}o(d_,"isArrayLike");function C$(t){return D$(t)&&d_(t)}o(C$,"isArrayLikeObject");var k$=IU||R$;function p_(t){var e=u0(t)?a0.call(t):"";return e==ig||e==z8}o(p_,"isFunction");function I$(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=F8}o(I$,"isLength");function u0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}o(u0,"isObject");function D$(t){return!!t&&typeof t=="object"}o(D$,"isObjectLike");function cg(t){return d_(t)?n$(t):c$(t)}o(cg,"keys");function O$(){return[]}o(O$,"stubArray");function R$(){return!1}o(R$,"stubFalse");vc.exports=M$});var J_=De((lY,g0)=>{var A_,S_,M_,T_,C_,k_,I_,D_,O_,R_,N_,P_,L_,m0,vg,B_,U_,$_,Tc,F_,q_,H_,z_,K_,j_,G_,V_,W_,b0;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof g0=="object"&&typeof g0.exports=="object"?t(r(e,r(g0.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,c){return n[a]=i?i(a,c):c}}o(r,"createExporter")})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])};A_=o(function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function a(){this.constructor=n}o(a,"__"),n.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)},"__extends"),S_=Object.assign||function(n){for(var i,a=1,c=arguments.length;a<c;a++){i=arguments[a];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(n[u]=i[u])}return n},M_=o(function(n,i){var a={};for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0&&(a[c]=n[c]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,c=Object.getOwnPropertySymbols(n);u<c.length;u++)i.indexOf(c[u])<0&&Object.prototype.propertyIsEnumerable.call(n,c[u])&&(a[c[u]]=n[c[u]]);return a},"__rest"),T_=o(function(n,i,a,c){var u=arguments.length,p=u<3?i:c===null?c=Object.getOwnPropertyDescriptor(i,a):c,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,i,a,c);else for(var y=n.length-1;y>=0;y--)(v=n[y])&&(p=(u<3?v(p):u>3?v(i,a,p):v(i,a))||p);return u>3&&p&&Object.defineProperty(i,a,p),p},"__decorate"),C_=o(function(n,i){return function(a,c){i(a,c,n)}},"__param"),k_=o(function(n,i,a,c,u,p){function v(Y){if(Y!==void 0&&typeof Y!="function")throw new TypeError("Function expected");return Y}o(v,"accept");for(var y=c.kind,S=y==="getter"?"get":y==="setter"?"set":"value",O=!i&&n?c.static?n:n.prototype:null,R=i||(O?Object.getOwnPropertyDescriptor(O,c.name):{}),I,N=!1,J=a.length-1;J>=0;J--){var L={};for(var V in c)L[V]=V==="access"?{}:c[V];for(var V in c.access)L.access[V]=c.access[V];L.addInitializer=function(Y){if(N)throw new TypeError("Cannot add initializers after decoration has completed");p.push(v(Y||null))};var Z=(0,a[J])(y==="accessor"?{get:R.get,set:R.set}:R[S],L);if(y==="accessor"){if(Z===void 0)continue;if(Z===null||typeof Z!="object")throw new TypeError("Object expected");(I=v(Z.get))&&(R.get=I),(I=v(Z.set))&&(R.set=I),(I=v(Z.init))&&u.push(I)}else(I=v(Z))&&(y==="field"?u.push(I):R[S]=I)}O&&Object.defineProperty(O,c.name,R),N=!0},"__esDecorate"),I_=o(function(n,i,a){for(var c=arguments.length>2,u=0;u<i.length;u++)a=c?i[u].call(n,a):i[u].call(n);return c?a:void 0},"__runInitializers"),D_=o(function(n){return typeof n=="symbol"?n:"".concat(n)},"__propKey"),O_=o(function(n,i,a){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:a?"".concat(a," ",i):i})},"__setFunctionName"),R_=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),N_=o(function(n,i,a,c){function u(p){return p instanceof a?p:new a(function(v){v(p)})}return o(u,"adopt"),new(a||(a=Promise))(function(p,v){function y(R){try{O(c.next(R))}catch(I){v(I)}}o(y,"fulfilled");function S(R){try{O(c.throw(R))}catch(I){v(I)}}o(S,"rejected");function O(R){R.done?p(R.value):u(R.value).then(y,S)}o(O,"step"),O((c=c.apply(n,i||[])).next())})},"__awaiter"),P_=o(function(n,i){var a={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},c,u,p,v;return v={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function y(O){return function(R){return S([O,R])}}function S(O){if(c)throw new TypeError("Generator is already executing.");for(;v&&(v=0,O[0]&&(a=0)),a;)try{if(c=1,u&&(p=O[0]&2?u.return:O[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,O[1])).done)return p;switch(u=0,p&&(O=[O[0]&2,p.value]),O[0]){case 0:case 1:p=O;break;case 4:return a.label++,{value:O[1],done:!1};case 5:a.label++,u=O[1],O=[0];continue;case 7:O=a.ops.pop(),a.trys.pop();continue;default:if(p=a.trys,!(p=p.length>0&&p[p.length-1])&&(O[0]===6||O[0]===2)){a=0;continue}if(O[0]===3&&(!p||O[1]>p[0]&&O[1]<p[3])){a.label=O[1];break}if(O[0]===6&&a.label<p[1]){a.label=p[1],p=O;break}if(p&&a.label<p[2]){a.label=p[2],a.ops.push(O);break}p[2]&&a.ops.pop(),a.trys.pop();continue}O=i.call(n,a)}catch(R){O=[6,R],u=0}finally{c=p=0}if(O[0]&5)throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}},"__generator"),L_=o(function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&b0(i,n,a)},"__exportStar"),b0=Object.create?function(n,i,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(i,a);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,c,u)}:function(n,i,a,c){c===void 0&&(c=a),n[c]=i[a]},m0=o(function(n){var i=typeof Symbol=="function"&&Symbol.iterator,a=i&&n[i],c=0;if(a)return a.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&c>=n.length&&(n=void 0),{value:n&&n[c++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),vg=o(function(n,i){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var c=a.call(n),u,p=[],v;try{for(;(i===void 0||i-- >0)&&!(u=c.next()).done;)p.push(u.value)}catch(y){v={error:y}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(v)throw v.error}}return p},"__read"),B_=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(vg(arguments[i]));return n},"__spread"),U_=o(function(){for(var n=0,i=0,a=arguments.length;i<a;i++)n+=arguments[i].length;for(var c=Array(n),u=0,i=0;i<a;i++)for(var p=arguments[i],v=0,y=p.length;v<y;v++,u++)c[u]=p[v];return c},"__spreadArrays"),$_=o(function(n,i,a){if(a||arguments.length===2)for(var c=0,u=i.length,p;c<u;c++)(p||!(c in i))&&(p||(p=Array.prototype.slice.call(i,0,c)),p[c]=i[c]);return n.concat(p||Array.prototype.slice.call(i))},"__spreadArray"),Tc=o(function(n){return this instanceof Tc?(this.v=n,this):new Tc(n)},"__await"),F_=o(function(n,i,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=a.apply(n,i||[]),u,p=[];return u={},v("next"),v("throw"),v("return"),u[Symbol.asyncIterator]=function(){return this},u;function v(N){c[N]&&(u[N]=function(J){return new Promise(function(L,V){p.push([N,J,L,V])>1||y(N,J)})})}function y(N,J){try{S(c[N](J))}catch(L){I(p[0][3],L)}}function S(N){N.value instanceof Tc?Promise.resolve(N.value.v).then(O,R):I(p[0][2],N)}function O(N){y("next",N)}function R(N){y("throw",N)}function I(N,J){N(J),p.shift(),p.length&&y(p[0][0],p[0][1])}},"__asyncGenerator"),q_=o(function(n){var i,a;return i={},c("next"),c("throw",function(u){throw u}),c("return"),i[Symbol.iterator]=function(){return this},i;function c(u,p){i[u]=n[u]?function(v){return(a=!a)?{value:Tc(n[u](v)),done:!1}:p?p(v):v}:p}},"__asyncDelegator"),H_=o(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],a;return i?i.call(n):(n=typeof m0=="function"?m0(n):n[Symbol.iterator](),a={},c("next"),c("throw"),c("return"),a[Symbol.asyncIterator]=function(){return this},a);function c(p){a[p]=n[p]&&function(v){return new Promise(function(y,S){v=n[p](v),u(y,S,v.done,v.value)})}}function u(p,v,y,S){Promise.resolve(S).then(function(O){p({value:O,done:y})},v)}},"__asyncValues"),z_=o(function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},"__makeTemplateObject");var r=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};K_=o(function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&b0(i,n,a);return r(i,n),i},"__importStar"),j_=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),G_=o(function(n,i,a,c){if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?c:a==="a"?c.call(n):c?c.value:i.get(n)},"__classPrivateFieldGet"),V_=o(function(n,i,a,c,u){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!u:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?u.call(n,a):u?u.value=a:i.set(n,a),a},"__classPrivateFieldSet"),W_=o(function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},"__classPrivateFieldIn"),t("__extends",A_),t("__assign",S_),t("__rest",M_),t("__decorate",T_),t("__param",C_),t("__esDecorate",k_),t("__runInitializers",I_),t("__propKey",D_),t("__setFunctionName",O_),t("__metadata",R_),t("__awaiter",N_),t("__generator",P_),t("__exportStar",L_),t("__createBinding",b0),t("__values",m0),t("__read",vg),t("__spread",B_),t("__spreadArrays",U_),t("__spreadArray",$_),t("__await",Tc),t("__asyncGenerator",F_),t("__asyncDelegator",q_),t("__asyncValues",H_),t("__makeTemplateObject",z_),t("__importStar",K_),t("__importDefault",j_),t("__classPrivateFieldGet",G_),t("__classPrivateFieldSet",V_),t("__classPrivateFieldIn",W_)})});var LE=De((ss,PE)=>{var NE=typeof self<"u"?self:ss,F0=function(){function t(){this.fetch=!1,this.DOMException=NE.DOMException}return o(t,"F"),t.prototype=NE,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 p(T){return typeof T!="string"&&(T=String(T)),T}o(p,"normalizeValue");function v(T){var h={next:function(){var x=T.shift();return{done:x===void 0,value:x}}};return n.iterable&&(h[Symbol.iterator]=function(){return h}),h}o(v,"iteratorFor");function y(T){this.map={},T instanceof y?T.forEach(function(h,x){this.append(x,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(y,"Headers"),y.prototype.append=function(T,h){T=u(T),h=p(h);var x=this.map[T];this.map[T]=x?x+", "+h:h},y.prototype.delete=function(T){delete this.map[u(T)]},y.prototype.get=function(T){return T=u(T),this.has(T)?this.map[T]:null},y.prototype.has=function(T){return this.map.hasOwnProperty(u(T))},y.prototype.set=function(T,h){this.map[u(T)]=p(h)},y.prototype.forEach=function(T,h){for(var x in this.map)this.map.hasOwnProperty(x)&&T.call(h,this.map[x],x,this)},y.prototype.keys=function(){var T=[];return this.forEach(function(h,x){T.push(x)}),v(T)},y.prototype.values=function(){var T=[];return this.forEach(function(h){T.push(h)}),v(T)},y.prototype.entries=function(){var T=[];return this.forEach(function(h,x){T.push([x,h])}),v(T)},n.iterable&&(y.prototype[Symbol.iterator]=y.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,x){T.onload=function(){h(T.result)},T.onerror=function(){x(T.error)}})}o(O,"fileReaderReady");function R(T){var h=new FileReader,x=O(h);return h.readAsArrayBuffer(T),x}o(R,"readBlobAsArrayBuffer");function I(T){var h=new FileReader,x=O(h);return h.readAsText(T),x}o(I,"readBlobAsText");function N(T){for(var h=new Uint8Array(T),x=new Array(h.length),b=0;b<h.length;b++)x[b]=String.fromCharCode(h[b]);return x.join("")}o(N,"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 I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(N(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 V=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Z(T){var h=T.toUpperCase();return V.indexOf(h)>-1?h:T}o(Z,"normalizeMethod");function Y(T,h){h=h||{};var x=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 y(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!x&&T._bodyInit!=null&&(x=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 y(h.headers)),this.method=Z(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")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}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(x){if(x){var b=x.split("="),l=b.shift().replace(/\+/g," "),m=b.join("=").replace(/\+/g," ");h.append(decodeURIComponent(l),decodeURIComponent(m))}}),h}o(oe,"decode");function K(T){var h=new y,x=T.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(b){var l=b.split(":"),m=l.shift().trim();if(m){var _=l.join(":").trim();h.append(m,_)}}),h}o(K,"parseHeaders"),L.call(Y.prototype);function q(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 y(h.headers),this.url=h.url||"",this._initBody(T)}o(q,"Response"),L.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},q.error=function(){var T=new q(null,{status:0,statusText:""});return T.type="error",T};var j=[301,302,303,307,308];q.redirect=function(T,h){if(j.indexOf(h)===-1)throw new RangeError("Invalid status code");return new q(null,{status:h,headers:{location:T}})},r.DOMException=t.DOMException;try{new r.DOMException}catch{r.DOMException=function(h,x){this.message=h,this.name=x;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(x,b){var l=new Y(T,h);if(l.signal&&l.signal.aborted)return b(new r.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function _(){m.abort()}o(_,"abortXhr"),m.onload=function(){var A={status:m.status,statusText:m.statusText,headers:K(m.getAllResponseHeaders()||"")};A.url="responseURL"in m?m.responseURL:A.headers.get("X-Request-URL");var E="response"in m?m.response:m.responseText;x(new q(E,A))},m.onerror=function(){b(new TypeError("Network request failed"))},m.ontimeout=function(){b(new TypeError("Network request failed"))},m.onabort=function(){b(new r.DOMException("Aborted","AbortError"))},m.open(l.method,l.url,!0),l.credentials==="include"?m.withCredentials=!0:l.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&n.blob&&(m.responseType="blob"),l.headers.forEach(function(A,E){m.setRequestHeader(E,A)}),l.signal&&(l.signal.addEventListener("abort",_),m.onreadystatechange=function(){m.readyState===4&&l.signal.removeEventListener("abort",_)}),m.send(typeof l._bodyInit>"u"?null:l._bodyInit)})}return o(le,"fetch"),le.polyfill=!0,t.fetch||(t.fetch=le,t.Headers=y,t.Request=Y,t.Response=q),r.Headers=y,r.Request=Y,r.Response=q,r.fetch=le,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})(F0);F0.fetch.ponyfill=!0;delete F0.fetch.polyfill;var Pc=F0;ss=Pc.fetch;ss.default=Pc.fetch;ss.fetch=Pc.fetch;ss.Headers=Pc.Headers;ss.Request=Pc.Request;ss.Response=Pc.Response;PE.exports=ss});var VE=De((wte,GE)=>{"use strict";var vF=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=_F(n),this._batchScheduleFn=EF(n),this._cacheKeyFn=AF(n),this._cacheMap=SF(n),this._batch=null,this.name=MF(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=xF(this),a=this._cacheMap,c=this._cacheKeyFn(n);if(a){var u=a.get(c);if(u){var p=i.cacheHits||(i.cacheHits=[]);return new Promise(function(y){p.push(function(){y(u)})})}}i.keys.push(n);var v=new Promise(function(y,S){i.callbacks.push({resolve:y,reject:S})});return a&&a.set(c,v),v},"load"),e.loadMany=o(function(n){if(!jE(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}(),yF=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 xF(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(){wF(t,r)}),r}o(xF,"getCurrentBatch");function wF(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(!jE(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,K=!1,q=0,j;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,j=T.lineMap,oe=!0)},"translate"),this.attributes=o(function(){if(!oe)throw new Error(`${r}grammar not scanned, parsed and translated`);return q=m(this.rules,this.udts,j,this.errors),K=!0,q},"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,j=h.lineMap,q=m(this.rules,this.udts,j,this.errors),K=!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(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return S(T)},"displayRuleDependencies"),this.displayAttributes=o(function(T="index"){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return q&&x(T),v(T)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!K)throw new Error(`${r}no attributes - must be preceeded by call to attributes()`);return x()},"displayAttributeErrors"),this.toSource=o(function(T){if(!K)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(q)throw new Error(`${r}can't generate parser source - attributes have ${q} errors`);return u.generateSource(this.chars,this.lines,this.rules,this.udts,T)},"toSource"),this.toObject=o(function(){if(!K)throw new Error(`${r}can't generate parser source - must be preceeded by call to attributes()`);if(q)throw new Error(`${r}can't generate parser source - attributes have ${q} 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 mb=De((p5,pb)=>{(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=$m().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,F=se&8191,$=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,G=A[5]|0,pe=G&8191,Ce=G>>>13,He=A[6]|0,Re=He&8191,Ve=He>>>13,pr=A[7]|0,ue=pr&8191,ie=pr>>>13,U=A[8]|0,X=U&8191,me=U>>>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(F,Ue),w=Math.imul(F,Oe),w=w+Math.imul($,Ue)|0,k=Math.imul($,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(F,je)|0,w=w+Math.imul(F,Je)|0,w=w+Math.imul($,je)|0,k=k+Math.imul($,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(F,nt)|0,w=w+Math.imul(F,it)|0,w=w+Math.imul($,nt)|0,k=k+Math.imul($,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(F,ot)|0,w=w+Math.imul(F,et)|0,w=w+Math.imul($,ot)|0,k=k+Math.imul($,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(F,st)|0,w=w+Math.imul(F,at)|0,w=w+Math.imul($,st)|0,k=k+Math.imul($,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(F,ft)|0,w=w+Math.imul(F,Xe)|0,w=w+Math.imul($,ft)|0,k=k+Math.imul($,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(F,ct)|0,w=w+Math.imul(F,ut)|0,w=w+Math.imul($,ct)|0,k=k+Math.imul($,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(F,lt)|0,w=w+Math.imul(F,ht)|0,w=w+Math.imul($,lt)|0,k=k+Math.imul($,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(F,dt)|0,w=w+Math.imul(F,tt)|0,w=w+Math.imul($,dt)|0,k=k+Math.imul($,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(F,Ft)|0,w=w+Math.imul(F,qt)|0,w=w+Math.imul($,Ft)|0,k=k+Math.imul($,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 gf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(gf>>>26)|0,gf&=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 vf=(C+N|0)+((w&8191)<<13)|0;C=(k+(w>>>13)|0)+(vf>>>26)|0,vf&=67108863,N=Math.imul(we,Ft),w=Math.imul(we,qt),w=w+Math.imul(ke,Ft)|0,k=Math.imul(ke,qt);var yf=(C+N|0)+((w&8191)<<13)|0;return C=(k+(w>>>13)|0)+(yf>>>26)|0,yf&=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]=gf,g[17]=vf,g[18]=yf,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 F=_[he+se],$=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]=F+ee,A[he+se]=$+ne,_[he+se+C]=F-ee,A[he+se+C]=$-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 F=N[se]*he[se]-w[se]*I[se];w[se]=N[se]*I[se]+w[se]*he[se],N[se]=F}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 K(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(K,"MPrime"),K.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),K.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"),K.prototype.split=o(function(l,p){l.iushrn(this.n,0,p)},"split"),K.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function q(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(q,"K256"),n(q,K),q.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"),q.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 j(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(j,"P224"),n(j,K);function le(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,"P192"),n(le,K);function T(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(T,"P25519"),n(T,K),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 q;else if(l==="p224")p=new j;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,F=0;se.cmp(g)!==0;F++)se=se.redSqr();r(F<Z);var $=this.pow(k,new i(1).iushln(Z-F-1));he=he.redMul($),k=$.redSqr(),I=I.redMul(k),Z=F}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 pb>"u"||pb,p5)});var t8=De((OW,e8)=>{e8.exports=kb;var Q5=128,BL=127,UL=~BL,$L=Math.pow(2,31);function kb(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw kb.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=$L;)e[r++]=t&255|Q5,t/=128;for(;t&UL;)e[r++]=t&255|Q5,t>>>=7;return e[r]=t|0,kb.bytes=r-n+1,e}o(kb,"encode")});var i8=De((RW,n8)=>{n8.exports=Ib;var FL=128,r8=127;function Ib(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u||i>49)throw Ib.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&r8)<<i:(c&r8)*Math.pow(2,i),i+=7}while(c>=FL);return Ib.bytes=a-n,r}o(Ib,"read")});var s8=De((NW,o8)=>{var qL=Math.pow(2,7),HL=Math.pow(2,14),zL=Math.pow(2,21),KL=Math.pow(2,28),jL=Math.pow(2,35),GL=Math.pow(2,42),VL=Math.pow(2,49),WL=Math.pow(2,56),JL=Math.pow(2,63);o8.exports=function(t){return t<qL?1:t<HL?2:t<zL?3:t<KL?4:t<jL?5:t<GL?6:t<VL?7:t<WL?8:t<JL?9:10}});var Zu=De((PW,a8)=>{a8.exports={encode:t8(),decode:i8(),encodingLength:s8()}});var g8=De((FW,b8)=>{"use strict";b8.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 Ec=De((nl,yc)=>{var IB=200,P8="__lodash_hash_undefined__",L8=9007199254740991,Qb="[object Arguments]",DB="[object Array]",B8="[object Boolean]",U8="[object Date]",OB="[object Error]",eg="[object Function]",$8="[object GeneratorFunction]",n0="[object Map]",F8="[object Number]",tg="[object Object]",A8="[object Promise]",q8="[object RegExp]",i0="[object Set]",H8="[object String]",z8="[object Symbol]",Vb="[object WeakMap]",K8="[object ArrayBuffer]",o0="[object DataView]",j8="[object Float32Array]",G8="[object Float64Array]",V8="[object Int8Array]",W8="[object Int16Array]",J8="[object Int32Array]",Y8="[object Uint8Array]",X8="[object Uint8ClampedArray]",Z8="[object Uint16Array]",Q8="[object Uint32Array]",RB=/[\\^$.*+?()[\]{}|]/g,NB=/\w*$/,PB=/^\[object .+?Constructor\]$/,LB=/^(?:0|[1-9]\d*)$/,nr={};nr[Qb]=nr[DB]=nr[K8]=nr[o0]=nr[B8]=nr[U8]=nr[j8]=nr[G8]=nr[V8]=nr[W8]=nr[J8]=nr[n0]=nr[F8]=nr[tg]=nr[q8]=nr[i0]=nr[H8]=nr[z8]=nr[Y8]=nr[X8]=nr[Z8]=nr[Q8]=!0;nr[OB]=nr[eg]=nr[Vb]=!1;var BB=typeof global=="object"&&global&&global.Object===Object&&global,UB=typeof self=="object"&&self&&self.Object===Object&&self,rs=BB||UB||Function("return this")(),e_=typeof nl=="object"&&nl&&!nl.nodeType&&nl,S8=e_&&typeof yc=="object"&&yc&&!yc.nodeType&&yc,$B=S8&&S8.exports===e_;function FB(t,e){return t.set(e[0],e[1]),t}o(FB,"addMapEntry");function qB(t,e){return t.add(e),t}o(qB,"addSetEntry");function HB(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}o(HB,"arrayEach");function zB(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}o(zB,"arrayPush");function t_(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(t_,"arrayReduce");function KB(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(KB,"baseTimes");function jB(t,e){return t?.[e]}o(jB,"getValue");function r_(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}o(r_,"isHostObject");function M8(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}o(M8,"mapToArray");function rg(t,e){return function(r){return t(e(r))}}o(rg,"overArg");function T8(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}o(T8,"setToArray");var GB=Array.prototype,VB=Function.prototype,s0=Object.prototype,Gb=rs["__core-js_shared__"],C8=function(){var t=/[^.]+$/.exec(Gb&&Gb.keys&&Gb.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),n_=VB.toString,Ws=s0.hasOwnProperty,a0=s0.toString,WB=RegExp("^"+n_.call(Ws).replace(RB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k8=$B?rs.Buffer:void 0,I8=rs.Symbol,D8=rs.Uint8Array,JB=rg(Object.getPrototypeOf,Object),YB=Object.create,XB=s0.propertyIsEnumerable,ZB=GB.splice,O8=Object.getOwnPropertySymbols,QB=k8?k8.isBuffer:void 0,eU=rg(Object.keys,Object),Wb=_c(rs,"DataView"),il=_c(rs,"Map"),Jb=_c(rs,"Promise"),Yb=_c(rs,"Set"),Xb=_c(rs,"WeakMap"),ol=_c(Object,"create"),tU=Za(Wb),rU=Za(il),nU=Za(Jb),iU=Za(Yb),oU=Za(Xb),R8=I8?I8.prototype:void 0,N8=R8?R8.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 sU(){this.__data__=ol?ol(null):{}}o(sU,"hashClear");function aU(t){return this.has(t)&&delete this.__data__[t]}o(aU,"hashDelete");function fU(t){var e=this.__data__;if(ol){var r=e[t];return r===P8?void 0:r}return Ws.call(e,t)?e[t]:void 0}o(fU,"hashGet");function cU(t){var e=this.__data__;return ol?e[t]!==void 0:Ws.call(e,t)}o(cU,"hashHas");function uU(t,e){var r=this.__data__;return r[t]=ol&&e===void 0?P8:e,this}o(uU,"hashSet");Xa.prototype.clear=sU;Xa.prototype.delete=aU;Xa.prototype.get=fU;Xa.prototype.has=cU;Xa.prototype.set=uU;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 lU(){this.__data__=[]}o(lU,"listCacheClear");function hU(t){var e=this.__data__,r=f0(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ZB.call(e,r,1),!0}o(hU,"listCacheDelete");function dU(t){var e=this.__data__,r=f0(e,t);return r<0?void 0:e[r][1]}o(dU,"listCacheGet");function pU(t){return f0(this.__data__,t)>-1}o(pU,"listCacheHas");function mU(t,e){var r=this.__data__,n=f0(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}o(mU,"listCacheSet");ns.prototype.clear=lU;ns.prototype.delete=hU;ns.prototype.get=dU;ns.prototype.has=pU;ns.prototype.set=mU;function xc(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(xc,"MapCache");function bU(){this.__data__={hash:new Xa,map:new(il||ns),string:new Xa}}o(bU,"mapCacheClear");function gU(t){return c0(this,t).delete(t)}o(gU,"mapCacheDelete");function vU(t){return c0(this,t).get(t)}o(vU,"mapCacheGet");function yU(t){return c0(this,t).has(t)}o(yU,"mapCacheHas");function xU(t,e){return c0(this,t).set(t,e),this}o(xU,"mapCacheSet");xc.prototype.clear=bU;xc.prototype.delete=gU;xc.prototype.get=vU;xc.prototype.has=yU;xc.prototype.set=xU;function wc(t){this.__data__=new ns(t)}o(wc,"Stack");function wU(){this.__data__=new ns}o(wU,"stackClear");function _U(t){return this.__data__.delete(t)}o(_U,"stackDelete");function EU(t){return this.__data__.get(t)}o(EU,"stackGet");function AU(t){return this.__data__.has(t)}o(AU,"stackHas");function SU(t,e){var r=this.__data__;if(r instanceof ns){var n=r.__data__;if(!il||n.length<IB-1)return n.push([t,e]),this;r=this.__data__=new xc(n)}return r.set(t,e),this}o(SU,"stackSet");wc.prototype.clear=wU;wc.prototype.delete=_U;wc.prototype.get=EU;wc.prototype.has=AU;wc.prototype.set=SU;function MU(t,e){var r=ig(t)||YU(t)?KB(t.length,String):[],n=r.length,i=!!n;for(var a in t)(e||Ws.call(t,a))&&!(i&&(a=="length"||GU(a,n)))&&r.push(a);return r}o(MU,"arrayLikeKeys");function i_(t,e,r){var n=t[e];(!(Ws.call(t,e)&&f_(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}o(i_,"assignValue");function f0(t,e){for(var r=t.length;r--;)if(f_(t[r][0],e))return r;return-1}o(f0,"assocIndexOf");function TU(t,e){return t&&o_(e,og(e),t)}o(TU,"baseAssign");function Zb(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(!u0(t))return t;var m=ig(t);if(m){if(u=zU(t),!e)return FU(t,u)}else{var v=Ya(t),x=v==eg||v==$8;if(ZU(t))return RU(t,e);if(v==tg||v==Qb||x&&!a){if(r_(t))return a?t:{};if(u=KU(x?{}:t),!e)return qU(t,TU(u,t))}else{if(!nr[v])return a?t:{};u=jU(t,v,Zb,e)}}c||(c=new wc);var S=c.get(t);if(S)return S;if(c.set(t,u),!m)var O=r?HU(t):og(t);return HB(O||t,function(R,D){O&&(D=R,R=t[D]),i_(u,D,Zb(R,e,r,n,D,t,c))}),u}o(Zb,"baseClone");function CU(t){return u0(t)?YB(t):{}}o(CU,"baseCreate");function kU(t,e,r){var n=e(t);return ig(t)?n:zB(n,r(t))}o(kU,"baseGetAllKeys");function IU(t){return a0.call(t)}o(IU,"baseGetTag");function DU(t){if(!u0(t)||WU(t))return!1;var e=u_(t)||r_(t)?WB:PB;return e.test(Za(t))}o(DU,"baseIsNative");function OU(t){if(!a_(t))return eU(t);var e=[];for(var r in Object(t))Ws.call(t,r)&&r!="constructor"&&e.push(r);return e}o(OU,"baseKeys");function RU(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}o(RU,"cloneBuffer");function ng(t){var e=new t.constructor(t.byteLength);return new D8(e).set(new D8(t)),e}o(ng,"cloneArrayBuffer");function NU(t,e){var r=e?ng(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}o(NU,"cloneDataView");function PU(t,e,r){var n=e?r(M8(t),!0):M8(t);return t_(n,FB,new t.constructor)}o(PU,"cloneMap");function LU(t){var e=new t.constructor(t.source,NB.exec(t));return e.lastIndex=t.lastIndex,e}o(LU,"cloneRegExp");function BU(t,e,r){var n=e?r(T8(t),!0):T8(t);return t_(n,qB,new t.constructor)}o(BU,"cloneSet");function UU(t){return N8?Object(N8.call(t)):{}}o(UU,"cloneSymbol");function $U(t,e){var r=e?ng(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o($U,"cloneTypedArray");function FU(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(FU,"copyArray");function o_(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;i_(r,c,u===void 0?t[c]:u)}return r}o(o_,"copyObject");function qU(t,e){return o_(t,s_(t),e)}o(qU,"copySymbols");function HU(t){return kU(t,og,s_)}o(HU,"getAllKeys");function c0(t,e){var r=t.__data__;return VU(e)?r[typeof e=="string"?"string":"hash"]:r.map}o(c0,"getMapData");function _c(t,e){var r=jB(t,e);return DU(r)?r:void 0}o(_c,"getNative");var s_=O8?rg(O8,Object):t$,Ya=IU;(Wb&&Ya(new Wb(new ArrayBuffer(1)))!=o0||il&&Ya(new il)!=n0||Jb&&Ya(Jb.resolve())!=A8||Yb&&Ya(new Yb)!=i0||Xb&&Ya(new Xb)!=Vb)&&(Ya=o(function(t){var e=a0.call(t),r=e==tg?t.constructor:void 0,n=r?Za(r):void 0;if(n)switch(n){case tU:return o0;case rU:return n0;case nU:return A8;case iU:return i0;case oU:return Vb}return e},"getTag"));function zU(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(zU,"initCloneArray");function KU(t){return typeof t.constructor=="function"&&!a_(t)?CU(JB(t)):{}}o(KU,"initCloneObject");function jU(t,e,r,n){var i=t.constructor;switch(e){case K8:return ng(t);case B8:case U8:return new i(+t);case o0:return NU(t,n);case j8:case G8:case V8:case W8:case J8:case Y8:case X8:case Z8:case Q8:return $U(t,n);case n0:return PU(t,n,r);case F8:case H8:return new i(t);case q8:return LU(t);case i0:return BU(t,n,r);case z8:return UU(t)}}o(jU,"initCloneByTag");function GU(t,e){return e=e??L8,!!e&&(typeof t=="number"||LB.test(t))&&t>-1&&t%1==0&&t<e}o(GU,"isIndex");function VU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}o(VU,"isKeyable");function WU(t){return!!C8&&C8 in t}o(WU,"isMasked");function a_(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||s0;return t===r}o(a_,"isPrototype");function Za(t){if(t!=null){try{return n_.call(t)}catch{}try{return t+""}catch{}}return""}o(Za,"toSource");function JU(t){return Zb(t,!0,!0)}o(JU,"cloneDeep");function f_(t,e){return t===e||t!==t&&e!==e}o(f_,"eq");function YU(t){return XU(t)&&Ws.call(t,"callee")&&(!XB.call(t,"callee")||a0.call(t)==Qb)}o(YU,"isArguments");var ig=Array.isArray;function c_(t){return t!=null&&QU(t.length)&&!u_(t)}o(c_,"isArrayLike");function XU(t){return e$(t)&&c_(t)}o(XU,"isArrayLikeObject");var ZU=QB||r$;function u_(t){var e=u0(t)?a0.call(t):"";return e==eg||e==$8}o(u_,"isFunction");function QU(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=L8}o(QU,"isLength");function u0(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}o(u0,"isObject");function e$(t){return!!t&&typeof t=="object"}o(e$,"isObjectLike");function og(t){return c_(t)?MU(t):OU(t)}o(og,"keys");function t$(){return[]}o(t$,"stubArray");function r$(){return!1}o(r$,"stubFalse");yc.exports=JU});var oE=De((as,iE)=>{var nE=typeof self<"u"?self:as,L0=function(){function t(){this.fetch=!1,this.DOMException=nE.DOMException}return o(t,"F"),t.prototype=nE,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 K(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(K,"parseHeaders"),L.call(Y.prototype);function q(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(q,"Response"),L.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},q.error=function(){var T=new q(null,{status:0,statusText:""});return T.type="error",T};var j=[301,302,303,307,308];q.redirect=function(T,h){if(j.indexOf(h)===-1)throw new RangeError("Invalid status code");return new q(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:K(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 q(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=q),r.Headers=x,r.Request=Y,r.Response=q,r.fetch=le,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})(L0);L0.fetch.ponyfill=!0;delete L0.fetch.polyfill;var Pc=L0;as=Pc.fetch;as.default=Pc.fetch;as.fetch=Pc.fetch;as.Headers=Pc.Headers;as.Request=Pc.Request;as.Response=Pc.Response;iE.exports=as});var bE=De((Eee,mE)=>{"use strict";var q$=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=j$(n),this._batchScheduleFn=G$(n),this._cacheKeyFn=V$(n),this._cacheMap=W$(n),this._batch=null,this.name=J$(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=z$(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(!pE(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}(),H$=typeof process=="object"&&typeof process.nextTick=="function"?function(t){Og||(Og=Promise.resolve()),Og.then(function(){process.nextTick(t)})}:typeof setImmediate=="function"?function(t){setImmediate(t)}:function(t){setTimeout(t)},Og;function z$(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(){K$(t,r)}),r}o(z$,"getCurrentBatch");function K$(t,e){if(e.hasDispatched=!0,e.keys.length===0){Ng(e);return}var r;try{r=t._batchLoadFn(e.keys)}catch(n){return Rg(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 Rg(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(!pE(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)));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(wF,"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 _F(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(_F,"getValidMaxBatchSize");function EF(t){var e=t&&t.batchScheduleFn;if(e===void 0)return yF;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(EF,"getValidBatchScheduleFn");function AF(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(AF,"getValidCacheKeyFn");function SF(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(SF,"getValidCacheMap");function MF(t){return t&&t.name?t.name:null}o(MF,"getValidName");function jE(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(jE,"isArrayLike");GE.exports=vF});var f9=De((Wte,a9)=>{"use strict";function KF(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),p=Math.log(c)/Math.log(256),v=Math.log(256)/Math.log(c);function y(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var I=0,N=0,J=0,L=R.length;J!==L&&R[J]===0;)J++,I++;for(var V=(L-J)*v+1>>>0,Z=new Uint8Array(V);J!==L;){for(var Y=R[J],oe=0,K=V-1;(Y!==0||oe<N)&&K!==-1;K--,oe++)Y+=256*Z[K]>>>0,Z[K]=Y%c>>>0,Y=Y/c>>>0;if(Y!==0)throw new Error("Non-zero carry");N=oe,J++}for(var q=V-N;q!==V&&Z[q]===0;)q++;for(var j=u.repeat(I);q<V;++q)j+=t.charAt(Z[q]);return j}o(y,"encode");function S(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var I=0;if(R[I]!==" "){for(var N=0,J=0;R[I]===u;)N++,I++;for(var L=(R.length-I)*p+1>>>0,V=new Uint8Array(L);R[I];){var Z=e[R.charCodeAt(I)];if(Z===255)return;for(var Y=0,oe=L-1;(Z!==0||Y<J)&&oe!==-1;oe--,Y++)Z+=c*V[oe]>>>0,V[oe]=Z%256>>>0,Z=Z/256>>>0;if(Z!==0)throw new Error("Non-zero carry");J=Y,I++}if(R[I]!==" "){for(var K=L-J;K!==L&&V[K]===0;)K++;for(var q=new Uint8Array(N+(L-K)),j=N;K!==L;)q[j++]=V[K++];return q}}}o(S,"decodeUnsafe");function O(R){var I=S(R);if(I)return I;throw new Error("Non-base"+c+" character")}return o(O,"decode"),{encode:y,decodeUnsafe:S,decode:O}}o(KF,"base");a9.exports=KF});var H0=De((Jte,c9)=>{"use strict";var jF=new TextDecoder,GF=o(t=>jF.decode(t),"decodeText"),VF=new TextEncoder,WF=o(t=>VF.encode(t),"encodeText");function JF(t,e){let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(JF,"concat");c9.exports={decodeText:GF,encodeText:WF,concat:JF}});var l9=De((Yte,u9)=>{"use strict";var{encodeText:YF}=H0(),z0=class{constructor(e,r,n,i){this.name=e,this.code=r,this.codeBuf=YF(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(z0,"Base");u9.exports=z0});var d9=De((Xte,h9)=>{"use strict";var XF=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,p=0;for(let v=0;v<i;++v){let y=n[t[v]];if(y===void 0)throw new SyntaxError("Invalid character "+t[v]);u=u<<r|y,c+=r,c>=8&&(c-=8,a[p++]=255&u>>c)}if(c>=r||255&u<<8-c)throw new SyntaxError("Unexpected end of data");return a},"decode"),ZF=o((t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,a="",c=0,u=0;for(let p=0;p<t.length;++p)for(u=u<<8|t[p],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"),QF=o(t=>e=>({encode(r){return ZF(r,e,t)},decode(r){return XF(r,e,t)}}),"rfc4648");h9.exports={rfc4648:QF}});var g9=De((Zte,b9)=>{"use strict";var yl=f9(),eq=l9(),{rfc4648:zr}=d9(),{decodeText:tq,encodeText:rq}=H0(),nq=o(()=>({encode:tq,decode:rq}),"identity"),p9=[["identity","\0",nq,""],["base2","0",zr(1),"01"],["base8","7",zr(3),"01234567"],["base10","9",yl,"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",yl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",yl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",yl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",yl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],m9=p9.reduce((t,e)=>(t[e[0]]=new eq(e[0],e[1],e[2],e[3]),t),{}),iq=p9.reduce((t,e)=>(t[e[1]]=m9[e[0]],t),{});b9.exports={names:m9,codes:iq}});var x9=De((fs,y9)=>{"use strict";var Lc=g9(),{encodeText:oq,decodeText:K0,concat:v9}=H0();function sq(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=ff(t);return uq(r,e),v9([n,e],n.length+e.length)}o(sq,"multibase");function aq(t,e){let r=ff(t),n=oq(r.encode(e));return v9([r.codeBuf,n],r.codeBuf.length+n.length)}o(aq,"encode");function fq(t){t instanceof Uint8Array&&(t=K0(t));let e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),ff(t[0]).decode(t.substring(1))}o(fq,"decode");function cq(t){if(t instanceof Uint8Array&&(t=K0(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return ff(t[0]).name}catch{return!1}}o(cq,"isEncoded");function uq(t,e){ff(t).decode(K0(e))}o(uq,"validEncode");function ff(t){if(Object.prototype.hasOwnProperty.call(Lc.names,t))return Lc.names[t];if(Object.prototype.hasOwnProperty.call(Lc.codes,t))return Lc.codes[t];throw new Error(`Unsupported encoding: ${t}`)}o(ff,"encoding");function lq(t){return t instanceof Uint8Array&&(t=K0(t)),ff(t[0])}o(lq,"encodingFromData");fs=y9.exports=sq;fs.encode=aq;fs.decode=fq;fs.isEncoded=cq;fs.encoding=ff;fs.encodingFromData=lq;var hq=Object.freeze(Lc.names),dq=Object.freeze(Lc.codes);fs.names=hq;fs.codes=dq});var A9=De((Qte,E9)=>{E9.exports=_9;var w9=128,pq=127,mq=~pq,bq=Math.pow(2,31);function _9(t,e,r){e=e||[],r=r||0;for(var n=r;t>=bq;)e[r++]=t&255|w9,t/=128;for(;t&mq;)e[r++]=t&255|w9,t>>>=7;return e[r]=t|0,_9.bytes=r-n+1,e}o(_9,"encode")});var T9=De((ere,M9)=>{M9.exports=Wg;var gq=128,S9=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&S9)<<i:(c&S9)*Math.pow(2,i),i+=7}while(c>=gq);return Wg.bytes=a-n,r}o(Wg,"read")});var k9=De((tre,C9)=>{var vq=Math.pow(2,7),yq=Math.pow(2,14),xq=Math.pow(2,21),wq=Math.pow(2,28),_q=Math.pow(2,35),Eq=Math.pow(2,42),Aq=Math.pow(2,49),Sq=Math.pow(2,56),Mq=Math.pow(2,63);C9.exports=function(t){return t<vq?1:t<yq?2:t<xq?3:t<wq?4:t<_q?5:t<Eq?6:t<Aq?7:t<Sq?8:t<Mq?9:10}});var D9=De((rre,I9)=>{I9.exports={encode:A9(),decode:T9(),encodingLength:k9()}});var R9=De((nre,O9)=>{"use strict";var Tq=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:Tq}});var F9=De((ire,$9)=>{"use strict";var N9=x9(),Bc=D9(),{names:xl}=R9(),{toString:j0}=(Uf(),mh(n3)),{fromString:Cq}=(hu(),mh(r3)),{concat:kq}=(dm(),mh(Ty)),Uc={};for(let t in xl){let e=t;Uc[xl[e]]=e}Object.freeze(Uc);function Iq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return j0(t,"base16")}o(Iq,"toHexString");function Dq(t){return Cq(t,"base16")}o(Dq,"fromHexString");function Oq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return j0(N9.encode("base58btc",t)).slice(1)}o(Oq,"toB58String");function Rq(t){let e=t instanceof Uint8Array?j0(t):t;return N9.decode("z"+e)}o(Rq,"fromB58String");function P9(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=Bc.decode(t);if(!B9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);t=t.slice(Bc.decode.bytes);let r=Bc.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(Bc.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${j0(t,"base16")}`);return{code:e,name:Uc[e],length:r,digest:t}}o(P9,"decode");function Nq(t,e,r){if(!t||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=L9(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=Bc.encode(n),a=Bc.encode(r);return kq([i,a,t],i.length+a.length+t.length)}o(Nq,"encode");function L9(t){let e=t;if(typeof t=="string"){if(xl[t]===void 0)throw new Error(`Unrecognized hash function named: ${t}`);e=xl[t]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Uc[e]===void 0&&!Jg(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(L9,"coerceCode");function Jg(t){return t>0&&t<16}o(Jg,"isAppCode");function B9(t){return!!(Jg(t)||Uc[t])}o(B9,"isValidCode");function U9(t){P9(t)}o(U9,"validate");function Pq(t){return U9(t),t.subarray(0,2)}o(Pq,"prefix");$9.exports={names:xl,codes:Uc,toHexString:Iq,fromHexString:Dq,toB58String:Oq,fromB58String:Rq,decode:P9,encode:Nq,coerceCode:L9,isAppCode:Jg,validate:U9,prefix:Pq,isValidCode:B9}});var xz={};Jt(xz,{CeramicURIValidator:()=>n2,default:()=>yz,getCeramicPlugin:()=>rp,streamIdToCeramicURI:()=>tp});module.exports=mh(xz);var c7=Pt(Ay());function mI(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}o(mI,"_catch");function bI(){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(p){var v;return((v=p.didResolutionMetadata)==null?void 0:v.error)!=="notFound"&&t.set(e.didUrl,p),p})};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(bI,"inMemoryCache");function gI(t,e){return e()}o(gI,"noCache");var vI="(?:%[0-9a-fA-F]{2})",Sy=`(?:[a-zA-Z0-9._-]|${vI})`,yI="([a-z0-9]+)",xI=`((?:${Sy}*:)*(${Sy}+))`,My="[a-zA-Z0-9_.:%-]",wI=`;${My}+=${My}*`,_I=`((${wI})*)`,EI="(/[^#?]*)?",AI="([?][^#]*)?",SI="(#.*)?",MI=new RegExp(`^did:${yI}:${xI}${_I}${EI}${AI}${SI}$`);function TI(t){if(t===""||!t)return null;let e=t.match(MI);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(TI,"parse");var bh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function CI(t){return function(e,r,n){try{return Promise.resolve(mI(function(){return Promise.resolve(t(e,r,n)).then(function(i){return{...bh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...bh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(CI,"wrapLegacyResolver");var nu=class{constructor(e={},r={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=r.cache===!0?bI():r.cache||gI,r.legacyResolvers&&Object.keys(r.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=CI(r.legacyResolvers[n]))})}resolve(e,r={}){try{let n=this,i=TI(e);if(i===null)return Promise.resolve({...bh,didResolutionMetadata:{error:"invalidDid"}});let a=n.registry[i.method];return a?Promise.resolve(n.cache(i,()=>a(i.did,i,n,r))):Promise.resolve({...bh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(nu,"Resolver");dm();hu();Uf();gh();iu();Rm();var N1=Pt(l3()),Px=Pt(Hm()),P1=Pt(U6()),ud=Pt(_u()),Lx=Pt(cx()),Cu=Pt(dx()),L1=Pt(Tx()),B1=Pt(Da());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 Pa(t){return kt(t,"base16")}o(Pa,"bytesToHex");function Ux(t){return Ot(t)}o(Ux,"stringToBytes");function QN({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(QN,"toJose");function eP(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=Pa(e.slice(0,32)),n=Pa(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r,s:n,recoveryParam:i}}o(eP,"fromJose");function $x(t,e){return Oi([xn(t),xn(e)])}o($x,"toSealed");var tP=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,rP=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,nP=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function iP(t){if(typeof t=="string"){if(tP.test(t))return D1(t);if(rP.test(t))return U1(t);if(nP.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(iP,"parseKey");function Fx(t){let e=typeof t=="string"?Ot(t):t;return(0,N1.hash)(e)}o(Fx,"sha256");function oP(t){return new Uint8Array(Px.keccak_256.arrayBuffer(t))}o(oP,"keccak");function sP(t){let e=Ot(t.slice(2),"base16");return`0x${kt(oP(e).slice(-20),"base16")}`}o(sP,"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 Cj=new P1.ec("secp256k1");function Hx(t){let e=iP(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,ud.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 QN(i,t);if(t&&typeof eP(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 aP={ES256K:Cx(),"ES256K-R":Cx(!0),Ed25519:kx(),EdDSA:kx()};function fP(t){let e=aP[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(fP,"SignerAlg");var $1=new P1.ec("secp256k1");function cd(t,e=!1){let r=xn(t);if(r.length!==(e?65:64))throw new Error("wrong signature length");let n=Pa(r.slice(0,32)),i=Pa(r.slice(32,64)),a={r:n,s:i};return e&&(a.recoveryParam=r[64]),a}o(cd,"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:Pa(xn(t.publicKeyJwk.x)),y:Pa(xn(t.publicKeyJwk.y))}).getPublic("hex"));if(t.publicKeyMultibase){let{base16:e,base58btc:r,base64:n,base64url:i}=lu;return e.decoder.or(r.decoder.or(n.decoder.or(i.decoder))).decode(t.publicKeyMultibase)}return new Uint8Array}o(F1,"extractPublicKeyBytes");function cP(t,e,r){let n=Fx(t),i=cd(e),a=r.filter(({ethereumAddress:p,blockchainAccountId:v})=>typeof p>"u"&&typeof v>"u"),c=r.filter(({ethereumAddress:p,blockchainAccountId:v})=>typeof p<"u"||typeof v!==void 0),u=a.find(p=>{try{let v=F1(p);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(cP,"verifyES256K");function Kx(t,e,r){let n;if(e.length>86)n=[cd(e,!0)];else{let c=cd(e,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let i=o(c=>{let u=Fx(t),p=$1.recoverPubKey(u,c,c.recoveryParam),v=p.encode("hex"),y=p.encode("hex",!0),S=sP(v);return r.find(R=>{var I,N,J;let L=Pa(F1(R));return L===v||L===y||((I=R.ethereumAddress)==null?void 0:I.toLowerCase())===S||((N=R.blockchainAccountId)==null||(J=N.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,ud.verify)(F1(c),n,i));if(!a)throw new Error("invalid_signature: Signature invalid for JWT");return a}o(Ix,"verifyEd25519");var uP={ES256K:cP,"ES256K-R":Kx,Ed25519:Ix,EdDSA:Ix};function jx(t){let e=uP[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(jx,"VerifierAlgorithm");jx.toSignatureObject=cd;var Gx=o(function(t,e,r={},n={}){try{r.alg||(r.alg=lP);let i=typeof t=="string"?t:Dx(t,n.canonicalize),a=[Dx(r,n.canonicalize),i].join("."),c=fP(r.alg);return Promise.resolve(c(a,e)).then(function(u){return[a,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var lP="ES256K";function Dx(t,e=!1){return O1(e?(0,Lx.default)(t):JSON.stringify(t))}o(Dx,"encodeSection");function hP(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(hP,"decodeJWS");function dP({header:t,data:e,signature:r},n){return Array.isArray(n)||(n=[n]),jx(t.alg)(e,r,n)}o(dP,"verifyJWSDecoded");function Vx(t,e){let r=hP(t);return dP(r,e)}o(Vx,"verifyJWS");function pP(t,e,r){for(var n;;){var i=t();if(Ps(i)&&(i=i.v),!i)return a;if(i.then){n=0;break}var a=r();if(a&&a.then)if(Ps(a))a=a.s;else{n=1;break}if(e){var c=e();if(c&&c.then&&!Ps(c)){n=2;break}}}var u=new La,p=_r.bind(null,u,2);return(n===0?i.then(y):n===1?a.then(v):c.then(S)).then(void 0,p),u;function v(O){a=O;do{if(e&&(c=e(),c&&c.then&&!Ps(c))){c.then(S).then(void 0,p);return}if(i=t(),!i||Ps(i)&&!i.v){_r(u,1,a);return}if(i.then){i.then(y).then(void 0,p);return}a=r(),Ps(a)&&(a=a.v)}while(!a||!a.then);a.then(v).then(void 0,p)}o(v,"_resumeAfterBody");function y(O){O?(a=r(),a&&a.then?a.then(v).then(void 0,p):v(a)):_r(u,1,a)}o(y,"_resumeAfterTest");function S(){(i=t())?i.then?i.then(y).then(void 0,p):y(i):_r(u,1,a)}o(S,"_resumeAfterUpdate")}o(pP,"_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;gP(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,p=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 pP(function(){return!u&&v<t.recipients.length},function(){return v++},function(){let y=t.recipients[v];Object.assign(y.header,i);let S=function(){if(y.header.alg===e.alg)return Promise.resolve(e.decrypt(a,xn(t.iv),c,y)).then(function(O){u=O})}();if(S&&S.then)return S.then(function(){})})}}()}();return Promise.resolve(p&&p.then?p.then(n):n(p))}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 La)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 La=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 Ps(t){return t instanceof La&&t.s&1}o(Ps,"_isSettledPact");function mP(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(Ps(u))u=u.v;else{u.then(c,a||(a=_r.bind(null,i=new La,2)));return}i?_r(i,1,u):i=u}catch(p){_r(i||(i=new La),2,p)}}return o(c,"_cycle"),c(),i}o(mP,"_forTo");function bP(t,e,r){if(typeof t[Ox]=="function"){let y=function(S){try{for(;!(i=n.next()).done&&(!r||!r());)if(S=e(i.value),S&&S.then)if(Ps(S))S=S.v;else{S.then(y,c||(c=_r.bind(null,a=new La,2)));return}a?_r(a,1,S):a=S}catch(O){_r(a||(a=new La),2,O)}};o(y,"_cycle");var n=t[Ox](),i,a,c;if(y(),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 p=[],v=0;v<t.length;v++)p.push(t[v]);return mP(p,function(y){return e(p[y])},r)}o(bP,"_forOf");function gP(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(gP,"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((p,v)=>p&&v.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let a,c,u=bP(e,function(p){let v=function(){return a?Promise.resolve(p.encryptCek==null?void 0:p.encryptCek(a)).then(function(y){if(y){var S,O;(S=c)==null||(O=S.recipients)==null||O.push(y)}}):Promise.resolve(p.encrypt(t,r,n)).then(function(y){a=y.cek,c=Rx(y,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(y=>typeof y=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(S=>S.id===y):y).filter(y=>typeof y<"u")).filter(y=>y.type==="X25519KeyAgreementKey2019"&&Boolean(y.publicKeyBase58));if(!v.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return v.map(y=>yP(U1(y.publicKeyBase58),y.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 vP(t){let e=o(function(a,c={},u){try{let p=O1(JSON.stringify(Object.assign({alg:i},c,{enc:n}))),v=new Uint8Array(Buffer.from(u?`${p}.${bi(u)}`:p));return Promise.resolve({...r(a,v),protectedHeader:p})}catch(p){return Promise.reject(p)}},"encrypt"),r=Xx(t),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(vP,"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 yP(t,e){let r=o(function(u,p={},v){try{Object.assign(p,{alg:void 0});let y=(0,B1.randomBytes)(32);return Promise.resolve(vP(y).encrypt(u,p,v)).then(function(S){return Promise.resolve(n(y)).then(function(O){return{...S,recipient:O,cek:y}})})}catch(y){return Promise.reject(y)}},"encrypt"),n=o(function(u){try{let p=(0,Cu.generateKeyPair)(),v=(0,Cu.sharedKey)(p.secretKey,t),y=qx(v,a,i),S=Xx(y)(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(p.publicKey)}}};return e&&(O.header.kid=e),Promise.resolve(O)}catch(p){return Promise.reject(p)}},"encryptCek"),i="ECDH-ES+XC20PKW",a=256,c="X25519";return{alg:i,enc:"XC20P",encrypt:r,encryptCek:n}}o(yP,"x25519Encrypter");function xP(t){if(!(t&&t.epk&&t.iv&&t.tag))throw new Error("bad_jwe: malformed header")}o(xP,"validateHeader");function Zx(t){let e=o(function(a,c,u,p){try{let S=function(){let N=qx(R,n,r),J=$x(p.encrypted_key,p.header.tag);return Promise.resolve(Nx(N).decrypt(J,xn(p.header.iv))).then(function(L){return L===null?null:Nx(L).decrypt(a,c,u)})};o(S,"_temp4");var v,y;if(xP((v=p)==null?void 0:v.header),p=p,((y=p.header.epk)==null?void 0:y.crv)!==i||typeof p.header.epk.x>"u")return Promise.resolve(null);let O=xn(p.header.epk.x),R,I=function(){if(t instanceof Uint8Array)R=(0,Cu.sharedKey)(t,O);else return Promise.resolve(t(O)).then(function(N){R=N})}();return Promise.resolve(I&&I.then?I.then(S):S(I))}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 ld=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],p=We.asCID(c);p?yield[u.join("/"),p]: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"),wP=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"),ku=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:ld(),bytes:ld(),value:ld(),asBlock:ld()})}links(){return q1(this.value,[])}tree(){return H1(this.value,[])}get(e="/"){return wP(this.value,e.split("/").filter(Boolean))}};o(ku,"Block");var Ba=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 ku({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 ku({value:n,bytes:t,cid:a})},"decode");Pi();cu();Dm();Eh();var Hi={};Jt(Hi,{code:()=>sc,decode:()=>Q1,encode:()=>Fa,name:()=>nL});var _P=["string","number","bigint","symbol"],EP=["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(_P.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(AP(t))return"Buffer";let r=SP(t);return r||"Object"}o(ew,"is");function AP(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}o(AP,"isBuffer");function SP(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(EP.includes(e))return e}o(SP,"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 ec=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",MP=new TextDecoder,TP=new TextEncoder;function hd(t){return ec&&globalThis.Buffer.isBuffer(t)}o(hd,"isBuffer");function K1(t){return t instanceof Uint8Array?hd(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}o(K1,"asU8A");var iw=ec?(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?MP.decode(t.subarray(e,r)):rw(t,e,r),ow=ec?t=>t.length>64?globalThis.Buffer.from(t):tw(t):t=>t.length>64?TP.encode(t):tw(t),ho=o(t=>Uint8Array.from(t),"fromArray"),tc=ec?(t,e,r)=>hd(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),sw=ec?(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=ec?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function fw(t,e){if(hd(t)&&hd(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,p,v,y;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[e+1],(u&192)===128&&(y=(i&31)<<6|u&63,y>127&&(a=y));break;case 3:u=t[e+1],p=t[e+2],(u&192)===128&&(p&192)===128&&(y=(i&15)<<12|(u&63)<<6|p&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:u=t[e+1],p=t[e+2],v=t[e+3],(u&192)===128&&(p&192)===128&&(v&192)===128&&(y=(i&15)<<18|(u&63)<<12|(p&63)<<6|v&63,y>65535&&y<1114112&&(a=y))}}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 CP(n)}o(rw,"utf8Slice");var nw=4096;function CP(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(CP,"decodeCodePointsArray");var kP=256,rc=class{constructor(e=kP){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=tc(n,0,this.cursor)}else r=sw(this.chunks,this.cursor);return e&&this.reset(),r}};o(rc,"Bl");var mt="CBOR decode error:",j1="CBOR encode error:",Iu=[];Iu[23]=1;Iu[24]=2;Iu[25]=3;Iu[26]=5;Iu[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 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 dd(t,e){let r=e.value,n=typeof r=="bigint"?r*G1-bw:r*-1-1;Ur(t,e.type.majorEncoded,n)}o(dd,"encodeNegint");dd.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");dd.compareTokens=o(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Du(t,e,r,n){Xo(t,e,r+n);let i=tc(t,e+r,e+r+n);return new $e(_e.bytes,i,r+n)}o(Du,"toToken");function vw(t,e,r,n){return Du(t,e,1,r)}o(vw,"decodeBytesCompact");function yw(t,e,r,n){return Du(t,e,2,Bn(t,e+1,n))}o(yw,"decodeBytes8");function xw(t,e,r,n){return Du(t,e,3,Un(t,e+1,n))}o(xw,"decodeBytes16");function ww(t,e,r,n){return Du(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 Du(t,e,9,i)}o(_w,"decodeBytes64");function pd(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===_e.string?ow(t.value):t.value),t.encodedBytes}o(pd,"tokenBytes");function nc(t,e){let r=pd(e);Ur(t,e.type.majorEncoded,r.length),t.push(r)}o(nc,"encodeBytes");nc.encodedSize=o(function(e){let r=pd(e);return Ur.encodedSize(r.length)+r.length},"encodedSize");nc.compareTokens=o(function(e,r){return DP(pd(e),pd(r))},"compareTokens");function DP(t,e){return t.length<e.length?-1:t.length>e.length?1:fw(t,e)}o(DP,"compareBytes");function Ou(t,e,r,n,i){let a=r+n;Xo(t,e,a);let c=new $e(_e.string,iw(t,e+r,e+a),a);return i.retainStringBytes===!0&&(c.byteValue=tc(t,e+r,e+a)),c}o(Ou,"toToken");function Ew(t,e,r,n){return Ou(t,e,1,r,n)}o(Ew,"decodeStringCompact");function Aw(t,e,r,n){return Ou(t,e,2,Bn(t,e+1,n),n)}o(Aw,"decodeString8");function Sw(t,e,r,n){return Ou(t,e,3,Un(t,e+1,n),n)}o(Sw,"decodeString16");function Mw(t,e,r,n){return Ou(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 Ou(t,e,9,i,n)}o(Tw,"decodeString64");var Cw=nc;function ic(t,e,r,n){return new $e(_e.array,n,r)}o(ic,"toToken");function kw(t,e,r,n){return ic(t,e,1,r)}o(kw,"decodeArrayCompact");function Iw(t,e,r,n){return ic(t,e,2,Bn(t,e+1,n))}o(Iw,"decodeArray8");function Dw(t,e,r,n){return ic(t,e,3,Un(t,e+1,n))}o(Dw,"decodeArray16");function Ow(t,e,r,n){return ic(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 ic(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 ic(t,e,1,1/0)}o(Nw,"decodeArrayIndefinite");function md(t,e){Ur(t,_e.array.majorEncoded,e.value)}o(md,"encodeArray");md.compareTokens=gi.compareTokens;md.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function oc(t,e,r,n){return new $e(_e.map,n,r)}o(oc,"toToken");function Pw(t,e,r,n){return oc(t,e,1,r)}o(Pw,"decodeMapCompact");function Lw(t,e,r,n){return oc(t,e,2,Bn(t,e+1,n))}o(Lw,"decodeMap8");function Bw(t,e,r,n){return oc(t,e,3,Un(t,e+1,n))}o(Bw,"decodeMap16");function Uw(t,e,r,n){return oc(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 oc(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 oc(t,e,1,1/0)}o(Fw,"decodeMapIndefinite");function bd(t,e){Ur(t,_e.map.majorEncoded,e.value)}o(bd,"encodeMap");bd.compareTokens=gi.compareTokens;bd.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 gd(t,e){Ur(t,_e.tag.majorEncoded,e.value)}o(gd,"encodeTag");gd.compareTokens=gi.compareTokens;gd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");var BP=20,UP=21,$P=22,FP=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 vd(t,e,r){let n=e.value;if(n===!1)t.push([_e.float.majorEncoded|BP]);else if(n===!0)t.push([_e.float.majorEncoded|UP]);else if(n===null)t.push([_e.float.majorEncoded|$P]);else if(n===void 0)t.push([_e.float.majorEncoded|FP]);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||(qP(n),i=e4(Fi,1),Fi[0]=251,t.push(Fi.slice(0,9)))}}o(vd,"encodeFloat");vd.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 qP(t){vi.setFloat64(0,t,!1)}o(qP,"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");vd.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 yd(t){return()=>{throw new Error(`${mt} ${t}`)}}o(yd,"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]=yd("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]=yd("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]=yd("simple values are not supported");Pe[244]=$t;Pe[245]=$t;Pe[246]=$t;Pe[247]=Gw;Pe[248]=yd("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 zP={float64:!1,mapSorter:GP,quickEncodeToken:t4};function KP(){let t=[];return t[_e.uint.major]=gi,t[_e.negint.major]=dd,t[_e.bytes.major]=nc,t[_e.string.major]=Cw,t[_e.array.major]=md,t[_e.map.major]=bd,t[_e.tag.major]=gd,t[_e.float.major]=vd,t}o(KP,"makeCborEncoders");var r4=KP(),Y1=new rc,$a=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 $a(r,e)}};o($a,"Ref");var Ls={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)},Bs={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?Ls.true:Ls.false},null(t,e,r,n){return Ls.null},undefined(t,e,r,n){return Ls.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?[Ls.emptyArray,new $e(_e.break)]:Ls.emptyArray;n=$a.createCheck(n,t);let i=[],a=0;for(let c of t)i[a++]=xd(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?[Ls.emptyMap,new $e(_e.break)]:Ls.emptyMap;n=$a.createCheck(n,t);let u=[],p=0;for(let v of a)u[p++]=[xd(v,r,n),xd(i?t.get(v):t[v],r,n)];return jP(u,r),r.addBreakTokens?[new $e(_e.map,c),u,new $e(_e.break)]:[new $e(_e.map,c),u]}};Bs.Map=Bs.Object;Bs.Buffer=Bs.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Bs[`${t}Array`]=Bs.DataView;function xd(t,e={},r){let n=ew(t),i=e&&e.typeEncoders&&e.typeEncoders[n]||Bs[n];if(typeof i=="function"){let c=i(t,n,e,r);if(c!=null)return c}let a=Bs[n];if(!a)throw new Error(`${j1} unsupported type: ${n}`);return a(t,n,e,r)}o(xd,"objectToTokens");function jP(t,e){e.mapSorter&&t.sort(e.mapSorter)}o(jP,"sortMapEntries");function GP(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(GP,"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 VP(t,e,r){let n=xd(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 rc(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(VP,"encodeCustom");function X1(t,e){return e=Object.assign({},zP,e),VP(t,r4,e)}o(X1,"encode");var WP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},wd=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(wd,"Tokeniser");var Ru=Symbol.for("DONE"),_d=Symbol.for("BREAK");function JP(t,e,r){let n=[];for(let i=0;i<t.value;i++){let a=Nu(e,r);if(a===_d){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed array`)}if(a===Ru)throw new Error(`${mt} found array but not enough entries (got ${i}, expected ${t.value})`);n[i]=a}return n}o(JP,"tokenToArray");function YP(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=Nu(e,r);if(u===_d){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed map`)}if(u===Ru)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 p=Nu(e,r);if(p===Ru)throw new Error(`${mt} found map but not enough entries (got ${c} [no value], expected ${t.value})`);n?a.set(u,p):i[u]=p}return n?a:i}o(YP,"tokenToMap");function Nu(t,e){if(t.done())return Ru;let r=t.next();if(r.type===_e.break)return _d;if(r.type.terminal)return r.value;if(r.type===_e.array)return JP(r,t,e);if(r.type===_e.map)return YP(r,t,e);if(r.type===_e.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=Nu(t,e);return e.tags[r.value](n)}throw new Error(`${mt} tag not supported (${r.value})`)}throw new Error("unsupported")}o(Nu,"tokensToObject");function Z1(t,e){if(!(t instanceof Uint8Array))throw new Error(`${mt} data to decode must be a Uint8Array`);e=Object.assign({},WP,e);let r=e.tokenizer||new wd(t,e),n=Nu(r,e);if(n===Ru)throw new Error(`${mt} did not find any content to decode`);if(n===_d)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 ZP(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(ZP,"cidEncoder");function QP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(QP,"undefinedEncoder");function eL(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(eL,"numberEncoder");var tL={float64:!0,typeEncoders:{Object:ZP,undefined:QP,number:eL}};function rL(t){if(t[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return We.decode(t.subarray(1))}o(rL,"cidDecoder");var o4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};o4.tags[i4]=rL;var nL="dag-cbor",sc=113,Fa=o(t=>X1(t,tL),"encode"),Q1=o(t=>Z1(t,o4),"decode");var iL=24;async function s4(t){let e=await Ba({value:t,codec:Hi,hasher:As});return{cid:e.cid,linkedBlock:e.bytes}}o(s4,"encodePayload");function oL(t,e=iL){let r=(e-t.length%e)%e,n=new Uint8Array(t.length+r);return n.set(t,0),n}o(oL,"pad");async function sL(t){return(await Ba({value:t,codec:Hi,hasher:Ch})).cid}o(sL,"encodeIdentityCID");function aL(t){if(t=We.asCID(t),t.code!==sc)throw new Error("CID codec must be dag-cbor");if(t.multihash.code!==Ch.code)throw new Error("CID must use identity multihash");return Q1(t.multihash.digest)}o(aL,"decodeIdentityCID");async function a4(t,e){return oL((await sL(t)).bytes,e)}o(a4,"prepareCleartext");function f4(t){return aL(We.decodeFirst(t)[0])}o(f4,"decodeCleartext");var c4=Symbol("abortable"),Ed=Symbol("aborted");function u4(t,e){if(e.aborted)return Promise.reject(Ed);let r,n=new Promise((i,a)=>{r=a});return e.addEventListener("abort",()=>{r(Ed)}),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 Ad="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 fL(t){return-32e3>=t&&t>=-32099}o(fL,"isServerError");function Sd(t){return h4[t.toString()]??(fL(t)?"Server error":"Application error")}o(Sd,"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??Sd(e)}};o(wn,"RPCError");function Pu(t){let e=h4[t];return o(function(n){return new wn(t,e,n)},"createError")}o(Pu,"createErrorFactory");var cL=Pu(an.PARSE_ERROR),FG=Pu(an.INVALID_REQUEST),qG=Pu(an.METHOD_NOT_FOUND),HG=Pu(an.INVALID_PARAMS),zG=Pu(an.INTERNAL_ERROR);function uL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(uL,"_checkPrivateRedeclaration");function lL(t,e){return e.get?e.get.call(t):e.value}o(lL,"_classApplyDescriptorGet");function hL(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(hL,"_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 lL(t,r)}o(eb,"_classPrivateFieldGet");function dL(t,e,r){uL(t,e),e.set(t,r)}o(dL,"_classPrivateFieldInit");function pL(t,e,r){var n=d4(t,e,"set");return hL(t,n,r),r}o(pL,"_classPrivateFieldSet");var Lu=new WeakMap,ac=class{get connection(){return eb(this,Lu)}createID(){return l4()}request(e,r=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Ed);let a=this.createID(),c=eb(this,Lu).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(Ad,{id:a})}),u4(c,i))}async notify(e,r=void 0){await eb(this,Lu).send({jsonrpc:"2.0",method:e,params:r})}constructor(e){dL(this,Lu,{writable:!0,value:void 0}),pL(this,Lu,e)}};o(ac,"RPCClient");function p4(t,e){return{jsonrpc:"2.0",id:t,error:{code:e,message:Sd(e)}}}o(p4,"createErrorResponse");function mL(t,e,r){console.warn("Unhandled handler error",e,r)}o(mL,"fallbackOnHandlerError");function bL(t,e){console.warn("Unhandled invalid message",e)}o(bL,"fallbackOnInvalidMessage");function gL(t,e){console.warn("Unhandled notification",e)}o(gL,"fallbackOnNotification");function m4(t,e={}){let r=e.onHandlerError??mL,n=e.onInvalidMessage??bL,i=e.onNotification??gL,a={};function c(u,p){if(p.method===Ad){let v=p.params?.id;v!=null&&a[v]?.abort()}else i(u,p)}return o(c,"handleNotification"),o(async function(p,v){let y=v.id;if(v.jsonrpc!=="2.0"||v.method==null)return y==null?(n(p,v),null):p4(y,an.INVALID_REQUEST);let S=t[v.method];if(S==null)return y==null?(c(p,v),null):p4(y,an.METHOD_NOT_FOUND);try{let O;if(y!=null&&S[c4]){let I=new AbortController;a[y]=I,O=S(p,v.params,{signal:I.signal})}else O=S(p,v.params,{});let R=O==null?O:typeof O.then=="function"?await O:O;return y==null||a[y]?.signal.aborted?null:{jsonrpc:"2.0",id:y,result:R}}catch(O){if(y==null||a[y]?.signal.aborted)return r(p,v,O),null;let R;if(O instanceof wn)R=O.toObject();else{r(p,v,O);let I=O.code??-32e3;R={code:I,message:O.message||Sd(I)}}return{jsonrpc:"2.0",id:y,error:R}}finally{y!=null&&delete a[y]}},"handleRequest")}o(m4,"createHandler");Pi();var K5=Pt(s5(),1),Zr=Pt(za(),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}"}}}},LL={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}"}}}},BL={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:ub,1:lb}}},UL={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}"}}}},qu={"2":ub,"10":LL,"19":{assetName:lb,assetType:BL,assetId:UL}};function a5(t,e){return t.split(e.parameters.delimiter)}o(a5,"splitParams");function Hu(t,e){var r=a5(t,e),n={};return r.forEach(function(i,a){n[e.parameters.values[a].name]=i}),n}o(Hu,"getParams");function hc(t,e){return Object.values(e.parameters.values).map(function(r){var n=t[r.name];return typeof n=="string"?n:hc(n,r)}).join(e.parameters.delimiter)}o(hc,"joinParams");function zu(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(zu,"isValidId");var qs=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(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(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}();qs.spec=qu["2"];var Hs=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new qs(r.chainId),this.address=r.address}o(t,"AccountId"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=Hu(n,this.spec),a=i.namespace,c=i.reference,u=i.address,p=new qs({namespace:a,reference:c});return new t({chainId:p,address:u}).toJSON()},"parse"),t.format=o(function(n){var i=new qs(n.chainId),a=cb({},i.toJSON(),{address:n.address});return hc(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}();Hs.spec=qu["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(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(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=qu["19"].assetName;var $L=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new qs(r.chainId),this.assetName=new hb(r.assetName)}o(t,"AssetType"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(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}();$L.spec=qu["19"].assetType;var FL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new qs(r.chainId),this.assetName=new hb(r.assetName),this.tokenId=r.tokenId}o(t,"AssetId"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return hc(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}();FL.spec=qu["19"].assetId;var f5="logger/5.7.0";var c5=!1,u5=!1,Dd={debug:1,default:2,info:2,warning:3,error:4,off:5},l5=Dd.default,db=null;function qL(){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(qL,"_checkNormalize");var h5=qL(),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();Dd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(l5>Dd[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(p=>{let v=n[p];try{if(v instanceof Uint8Array){let y="";for(let S=0;S<v.length;S++)y+=d5[v[S]>>4],y+=d5[v[S]&15];i.push(p+"=Uint8Array(0x"+y+")")}else i.push(p+"="+JSON.stringify(v))}catch{i.push(p+"="+JSON.stringify(n[p].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let a=e,c="";switch(r){case Ki.NUMERIC_FAULT:{c="NUMERIC_FAULT";let p=e;switch(p){case"overflow":case"underflow":case"division-by-zero":c+="-"+p;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(p){u[p]=n[p]}),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=Dd[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 dc(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return dc(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}o(dc,"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),dc(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 dc(new Uint8Array(n))}return bb(t)?dc(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),dc(n)}o(gb,"concat");function HL(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),dc(r)}o(HL,"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 Od(t){if(typeof t!="string")t=Yr(t);else if(!ji(t)||t.length%2)return null;return(t.length-2)/2}o(Od,"hexDataLength");function Rd(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(Rd,"hexDataSlice");function zs(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(zs,"hexZeroPad");function Nd(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=HL(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=zs(e.r,32),e.s==null||!ji(e.s)?gr.throwArgumentError("signature missing or invalid s","signature",t):e.s=zs(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=zs(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(Nd,"splitSignature");var x5=Pt(yb());var y5="bignumber/5.7.0";var zL=x5.default.BN,PV=new Et(y5);function xb(t){return new zL(t,36).toString(16)}o(xb,"_base36To16");var w5=Pt(Hm());function pc(t){return"0x"+w5.default.keccak_256(or(t))}o(pc,"keccak256");var _5="address/5.7.0";var Ku=new Et(_5);function E5(t){ji(t,20)||Ku.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(pc(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 GL=9007199254740991;function VL(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}o(VL,"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(VL(GL));function WL(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(WL,"ibanChecksum");function S5(t){let e=null;if(typeof t!="string"&&Ku.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&&Ku.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)!==WL(t)&&Ku.throwArgumentError("bad icap checksum","address",t),e=xb(t.substring(4));e.length<40;)e="0"+e;e=E5("0x"+e)}else Ku.throwArgumentError("invalid address","address",t);return e}o(S5,"getAddress");var M5="properties/5.7.0";var ZV=new Et(M5);function mc(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}o(mc,"defineReadOnly");var T5="strings/5.7.0";var C5=new Et(T5),ju;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(ju||(ju={}));var Ka;(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"})(Ka||(Ka={}));function JL(t,e,r,n,i){return C5.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}o(JL,"errorFunc");function k5(t,e,r,n,i){if(t===Ka.BAD_PREFIX||t===Ka.UNEXPECTED_CONTINUE){let a=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)a++;return a}return t===Ka.OVERRUN?r.length-e-1:0}o(k5,"ignoreFunc");function YL(t,e,r,n,i){return t===Ka.OVERLONG?(n.push(i),0):(n.push(65533),k5(t,e,r,n,i))}o(YL,"replaceFunc");var XL=Object.freeze({error:JL,ignore:k5,replace:YL});function Gu(t,e=ju.current){e!=ju.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(Gu,"toUtf8Bytes");var I5=`Ethereum Signed Message:
|
|
652
|
-
`;function _b(t){return typeof t=="string"&&(t=Gu(t)),pc(gb([Gu(I5),Gu(String(t.length)),t]))}o(_b,"hashMessage");var yt=Pt(yb()),bo=Pt(vu());function bc(t,e,r){return r={path:e,exports:{},require:function(n,i){return ZL(n,i??r.path)}},t(r,r.exports),r.exports}o(bc,"createCommonjsModule");function ZL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(ZL,"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=bc(function(t,e){"use strict";var r=e;function n(c,u){if(Array.isArray(c))return c.slice();if(!c)return[];var p=[];if(typeof c!="string"){for(var v=0;v<c.length;v++)p[v]=c[v]|0;return p}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)p.push(parseInt(c[v]+c[v+1],16))}else for(var v=0;v<c.length;v++){var y=c.charCodeAt(v),S=y>>8,O=y&255;S?p.push(S,O):p.push(O)}return p}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="",p=0;p<c.length;p++)u+=i(c[p].toString(16));return u}o(a,"toHex"),r.toHex=a,r.encode=o(function(u,p){return p==="hex"?a(u):u},"encode")}),Hn=bc(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(p,v,y){var S=new Array(Math.max(p.bitLength(),y)+1);S.fill(0);for(var O=1<<v+1,R=p.clone(),I=0;I<S.length;I++){var N,J=R.andln(O-1);R.isOdd()?(J>(O>>1)-1?N=(O>>1)-J:N=J,R.isubn(N)):N=0,S[I]=N,R.iushrn(1)}return S}o(n,"getNAF"),r.getNAF=n;function i(p,v){var y=[[],[]];p=p.clone(),v=v.clone();for(var S=0,O=0,R;p.cmpn(-S)>0||v.cmpn(-O)>0;){var I=p.andln(3)+S&3,N=v.andln(3)+O&3;I===3&&(I=-1),N===3&&(N=-1);var J;(I&1)===0?J=0:(R=p.andln(7)+S&7,(R===3||R===5)&&N===2?J=-I:J=I),y[0].push(J);var L;(N&1)===0?L=0:(R=v.andln(7)+O&7,(R===3||R===5)&&I===2?L=-N:L=N),y[1].push(L),2*S===J+1&&(S=1-S),2*O===L+1&&(O=1-O),p.iushrn(1),v.iushrn(1)}return y}o(i,"getJSF"),r.getJSF=i;function a(p,v,y){var S="_"+v;p.prototype[v]=o(function(){return this[S]!==void 0?this[S]:this[S]=y.call(this)},"cachedProperty")}o(a,"cachedProperty"),r.cachedProperty=a;function c(p){return typeof p=="string"?r.toArray(p,"hex"):p}o(c,"parseBytes"),r.parseBytes=c;function u(p){return new yt.default(p,"hex","le")}o(u,"intFromLE"),r.intFromLE=u}),Bd=Hn.getNAF,QL=Hn.getJSF,Ud=Hn.assert;function js(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(js,"BaseCurve");var ja=js;js.prototype.point=o(function(){throw new Error("Not implemented")},"point");js.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");js.prototype._fixedNafMul=o(function(e,r){Ud(e.precomputed);var n=e._getDoubles(),i=Bd(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var c=[],u,p;for(u=0;u<i.length;u+=n.step){p=0;for(var v=u+n.step-1;v>=u;v--)p=(p<<1)+i[v];c.push(p)}for(var y=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=a;O>0;O--){for(u=0;u<c.length;u++)p=c[u],p===O?S=S.mixedAdd(n.points[u]):p===-O&&(S=S.mixedAdd(n.points[u].neg()));y=y.add(S)}return y.toP()},"_fixedNafMul");js.prototype._wnafMul=o(function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var a=i.points,c=Bd(r,n,this._bitLength),u=this.jpoint(null,null,null),p=c.length-1;p>=0;p--){for(var v=0;p>=0&&c[p]===0;p--)v++;if(p>=0&&v++,u=u.dblp(v),p<0)break;var y=c[p];Ud(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(a[y-1>>1]):u=u.mixedAdd(a[-y-1>>1].neg()):y>0?u=u.add(a[y-1>>1]):u=u.add(a[-y-1>>1].neg())}return e.type==="affine"?u.toP():u},"_wnafMul");js.prototype._wnafMulAdd=o(function(e,r,n,i,a){var c=this._wnafT1,u=this._wnafT2,p=this._wnafT3,v=0,y,S,O;for(y=0;y<i;y++){O=r[y];var R=O._getNAFPoints(e);c[y]=R.wnd,u[y]=R.points}for(y=i-1;y>=1;y-=2){var I=y-1,N=y;if(c[I]!==1||c[N]!==1){p[I]=Bd(n[I],c[I],this._bitLength),p[N]=Bd(n[N],c[N],this._bitLength),v=Math.max(p[I].length,v),v=Math.max(p[N].length,v);continue}var J=[r[I],null,null,r[N]];r[I].y.cmp(r[N].y)===0?(J[1]=r[I].add(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg())):r[I].y.cmp(r[N].y.redNeg())===0?(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].add(r[N].neg())):(J[1]=r[I].toJ().mixedAdd(r[N]),J[2]=r[I].toJ().mixedAdd(r[N].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],V=QL(n[I],n[N]);for(v=Math.max(V[0].length,v),p[I]=new Array(v),p[N]=new Array(v),S=0;S<v;S++){var Z=V[0][S]|0,Y=V[1][S]|0;p[I][S]=L[(Z+1)*3+(Y+1)],p[N][S]=0,u[I]=J}}var oe=this.jpoint(null,null,null),K=this._wnafT4;for(y=v;y>=0;y--){for(var q=0;y>=0;){var j=!0;for(S=0;S<i;S++)K[S]=p[S][y]|0,K[S]!==0&&(j=!1);if(!j)break;q++,y--}if(y>=0&&q++,oe=oe.dblp(q),y<0)break;for(S=0;S<i;S++){var le=K[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(y=0;y<i;y++)u[y]=null;return a?oe:oe.toP()},"_wnafMulAdd");function wi(t,e){this.curve=t,this.type=e,this.precomputed=null}o(wi,"BasePoint");js.BasePoint=wi;wi.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");wi.prototype.validate=o(function(){return this.curve.validate(this)},"validate");js.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?Ud(e[e.length-1]%2===0):e[0]===7&&Ud(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=bc(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")}),eB=Hn.assert;function _i(t){ja.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,ja);var tB=_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],eB(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),p=new yt.default(1),v,y,S,O,R,I,N,J=0,L,V;n.cmpn(0)!==0;){var Z=i.div(n);L=i.sub(Z.mul(n)),V=u.sub(Z.mul(a));var Y=p.sub(Z.mul(c));if(!S&&L.cmp(r)<0)v=N.neg(),y=a,S=L.neg(),O=V;else if(S&&++J===2)break;N=L,i=n,n=L,u=a,a=V,p=c,c=Y}R=L.neg(),I=V;var oe=S.sqr().add(O.sqr()),K=R.sqr().add(I.sqr());return K.cmp(oe)>=0&&(R=v,I=y),S.negative&&(S=S.neg(),O=O.neg()),R.negative&&(R=R.neg(),I=I.neg()),[{a:S,b:O},{a:R,b:I}]},"_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),p=c.mul(i.a),v=a.mul(n.b),y=c.mul(i.b),S=e.sub(u).sub(p),O=v.add(y).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]),p=e[c],v=p._getBeta();u.k1.negative&&(u.k1.ineg(),p=p.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),i[c*2]=p,i[c*2+1]=v,a[c*2]=u.k1,a[c*2+1]=u.k2}for(var y=this._wnafMulAdd(1,i,a,c*2,n),S=0;S<c*2;S++)i[S]=null,a[S]=null;return y},"_endoWnafMulAdd");function Ir(t,e,r,n){ja.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,ja.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){ja.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,ja.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)),p=i.redSub(a),v=c.redSub(u);if(p.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=p.redSqr(),S=y.redMul(p),O=i.redMul(y),R=v.redSqr().redIAdd(S).redISub(O).redISub(O),I=v.redMul(O.redISub(R)).redISub(c.redMul(S)),N=this.z.redMul(e.z).redMul(p);return this.curve.jpoint(R,I,N)},"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),p=a.redSub(c);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),y=v.redMul(u),S=n.redMul(v),O=p.redSqr().redIAdd(y).redISub(S).redISub(S),R=p.redMul(S.redISub(O)).redISub(a.redMul(y)),I=this.z.redMul(u);return this.curve.jpoint(O,R,I)},"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,p=this.z,v=p.redSqr().redSqr(),y=u.redAdd(u);for(r=0;r<e;r++){var S=c.redSqr(),O=y.redSqr(),R=O.redSqr(),I=S.redAdd(S).redIAdd(S).redIAdd(i.redMul(v)),N=c.redMul(O),J=I.redSqr().redISub(N.redAdd(N)),L=N.redISub(J),V=I.redMul(L);V=V.redIAdd(V).redISub(R);var Z=y.redMul(p);r+1<e&&(v=v.redMul(R)),c=J,p=Z,y=V}return this.curve.jpoint(c,y.redMul(a),p)},"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 p=i.redAdd(i).redIAdd(i),v=p.redSqr().redISub(u).redISub(u),y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),e=v,r=p.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),I=this.x.redAdd(O).redSqr().redISub(S).redISub(R);I=I.redIAdd(I);var N=S.redAdd(S).redIAdd(S),J=N.redSqr(),L=R.redIAdd(R);L=L.redIAdd(L),L=L.redIAdd(L),e=J.redISub(I).redISub(I),r=N.redMul(I.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 p=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),v=p.redSqr().redISub(u).redISub(u);e=v;var y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),r=p.redMul(u.redISub(v)).redISub(y),n=this.y.redAdd(this.y)}else{var S=this.z.redSqr(),O=this.y.redSqr(),R=this.x.redMul(O),I=this.x.redSub(S).redMul(this.x.redAdd(S));I=I.redAdd(I).redIAdd(I);var N=R.redIAdd(R);N=N.redIAdd(N);var J=N.redAdd(N);e=I.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=I.redMul(N.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(),p=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),v=r.redAdd(r);v=v.redIAdd(v);var y=v.redMul(u),S=p.redSqr().redISub(y.redAdd(y)),O=y.redISub(S),R=u.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=p.redMul(O).redISub(R),N=n.redAdd(n).redMul(i);return this.curve.jpoint(S,I,N)},"_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 p=u.redSqr(),v=i.redIAdd(i);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var y=a.redIAdd(u).redSqr().redISub(c).redISub(p).redISub(v),S=r.redMul(y);S=S.redIAdd(S),S=S.redIAdd(S);var O=this.x.redMul(p).redISub(S);O=O.redIAdd(O),O=O.redIAdd(O);var R=this.y.redMul(y.redMul(v.redISub(y)).redISub(u.redMul(p)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var I=this.z.redAdd(u).redSqr().redISub(n).redISub(p);return this.curve.jpoint(O,R,I)},"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 Pd=bc(function(t,e){"use strict";var r=e;r.base=ja,r.short=tB,r.mont=null,r.edwards=null}),Ld=bc(function(t,e){"use strict";var r=e,n=Hn.assert;function i(u){u.type==="short"?this.curve=new Pd.short(u):u.type==="edwards"?this.curve=new Pd.edwards(u):this.curve=new Pd.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,p){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var v=new i(p);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 Ks(t){if(!(this instanceof Ks))return new Ks(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(Ks,"HmacDRBG");var R5=Ks;Ks.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");Ks.prototype._hmac=o(function(){return new bo.default.hmac(this.hash,this.K)},"hmac");Ks.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");Ks.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");Ks.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 rB=Hn.assert;function $d(t,e){if(t instanceof $d)return t;this._importDER(t,e)||(rB(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($d,"Signature");var Fd=$d;function nB(){this.place=0}o(nB,"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");$d.prototype._importDER=o(function(e,r){e=Hn.toArray(e,r);var n=new nB;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 p=e.slice(n.place,u+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(p[0]===0)if(p[1]&128)p=p.slice(1);else return!1;return this.r=new yt.default(c),this.s=new yt.default(p),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");$d.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 iB=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(Ld,t),"Unknown curve "+t),t=Ld[t]),t instanceof Ld.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 oB=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||iB(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),p=new R5({hash:this.hash,entropy:c,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new yt.default(1)),y=0;;y++){var S=i.k?i.k(y):new yt.default(p.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(),I=R.umod(this.n);if(I.cmpn(0)!==0){var N=S.invm(this.n).mul(I.mul(r.getPrivate()).iadd(e));if(N=N.umod(this.n),N.cmpn(0)!==0){var J=(O.getY().isOdd()?1:0)|(R.cmp(I)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),J^=1),new Fd({r:I,s:N,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 Fd(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),p=u.mul(e).umod(this.n),v=u.mul(a).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(p,n.getPublic(),v),y.isInfinity()?!1:y.eqXToP(a)):(y=this.g.mulAdd(p,n.getPublic(),v),y.isInfinity()?!1:y.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 Fd(e,n);var i=this.n,a=new yt.default(t),c=e.r,u=e.s,p=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),p):c=this.curve.pointFromX(c,p);var y=e.r.invm(i),S=i.sub(a).mul(y).umod(i),O=u.mul(y).umod(i);return this.g.mulAdd(S,c,O)};xi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Fd(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 sB=bc(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=Pd,r.curves=Ld,r.ec=oB,r.eddsa=null}),P5=sB.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 qd=class{constructor(e){mc(this,"curve","secp256k1"),mc(this,"privateKey",Yr(e)),Od(this.privateKey)!==32&&Ib.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=go().keyFromPrivate(or(this.privateKey));mc(this,"publicKey","0x"+r.getPublic(!1,"hex")),mc(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),mc(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 Nd({recoveryParam:i.recoveryParam,r:zs("0x"+i.r.toString(16),32),s:zs("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=go().keyFromPrivate(or(this.privateKey)),n=go().keyFromPublic(or(Db(e)));return zs("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(qd,"SigningKey");function B5(t,e){let r=Nd(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 qd(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 OW=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(Rd(pc(Rd(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 qW=new Et(H5);function Ob(t,e){return q5(_b(t),e)}o(Ob,"verifyMessage");var j5=Pt(_u(),1);cu();hu();var aB=`
|
|
651
|
+
`+String(n)));Ng(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){Rg(t,e,n)})}o(K$,"dispatchBatch");function Rg(t,e,r){Ng(e);for(var n=0;n<e.keys.length;n++)t.clear(e.keys[n]),e.callbacks[n].reject(r)}o(Rg,"failedDispatch");function Ng(t){if(t.cacheHits)for(var e=0;e<t.cacheHits.length;e++)t.cacheHits[e]()}o(Ng,"resolveCacheHits");function j$(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(j$,"getValidMaxBatchSize");function G$(t){var e=t&&t.batchScheduleFn;if(e===void 0)return H$;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(G$,"getValidBatchScheduleFn");function V$(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(V$,"getValidCacheKeyFn");function W$(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(W$,"getValidCacheMap");function J$(t){return t&&t.name?t.name:null}o(J$,"getValidName");function pE(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(pE,"isArrayLike");mE.exports=q$});var DE=De((Yee,IE)=>{"use strict";function dF(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,K=W-1;(Y!==0||oe<P)&&K!==-1;K--,oe++)Y+=256*Q[K]>>>0,Q[K]=Y%c>>>0,Y=Y/c>>>0;if(Y!==0)throw new Error("Non-zero carry");P=oe,J++}for(var q=W-P;q!==W&&Q[q]===0;)q++;for(var j=u.repeat(D);q<W;++q)j+=t.charAt(Q[q]);return j}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 K=L-J;K!==L&&W[K]===0;)K++;for(var q=new Uint8Array(P+(L-K)),j=P;K!==L;)q[j++]=W[K++];return q}}}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(dF,"base");IE.exports=dF});var U0=De((Xee,OE)=>{"use strict";var pF=new TextDecoder,mF=o(t=>pF.decode(t),"decodeText"),bF=new TextEncoder,gF=o(t=>bF.encode(t),"encodeText");function vF(t,e){let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}o(vF,"concat");OE.exports={decodeText:mF,encodeText:gF,concat:vF}});var NE=De((Zee,RE)=>{"use strict";var{encodeText:yF}=U0(),$0=class{constructor(e,r,n,i){this.name=e,this.code=r,this.codeBuf=yF(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($0,"Base");RE.exports=$0});var LE=De((Qee,PE)=>{"use strict";var xF=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"),wF=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"),_F=o(t=>e=>({encode(r){return wF(r,e,t)},decode(r){return xF(r,e,t)}}),"rfc4648");PE.exports={rfc4648:_F}});var FE=De((ete,$E)=>{"use strict";var yl=DE(),EF=NE(),{rfc4648:zr}=LE(),{decodeText:AF,encodeText:SF}=U0(),MF=o(()=>({encode:AF,decode:SF}),"identity"),BE=[["identity","\0",MF,""],["base2","0",zr(1),"01"],["base8","7",zr(3),"01234567"],["base10","9",yl,"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",yl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",yl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",yl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",yl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",zr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],UE=BE.reduce((t,e)=>(t[e[0]]=new EF(e[0],e[1],e[2],e[3]),t),{}),TF=BE.reduce((t,e)=>(t[e[1]]=UE[e[0]],t),{});$E.exports={names:UE,codes:TF}});var zE=De((cs,HE)=>{"use strict";var Lc=FE(),{encodeText:CF,decodeText:F0,concat:qE}=U0();function kF(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=cf(t);return RF(r,e),qE([n,e],n.length+e.length)}o(kF,"multibase");function IF(t,e){let r=cf(t),n=CF(r.encode(e));return qE([r.codeBuf,n],r.codeBuf.length+n.length)}o(IF,"encode");function DF(t){t instanceof Uint8Array&&(t=F0(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(DF,"decode");function OF(t){if(t instanceof Uint8Array&&(t=F0(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return cf(t[0]).name}catch{return!1}}o(OF,"isEncoded");function RF(t,e){cf(t).decode(F0(e))}o(RF,"validEncode");function cf(t){if(Object.prototype.hasOwnProperty.call(Lc.names,t))return Lc.names[t];if(Object.prototype.hasOwnProperty.call(Lc.codes,t))return Lc.codes[t];throw new Error(`Unsupported encoding: ${t}`)}o(cf,"encoding");function NF(t){return t instanceof Uint8Array&&(t=F0(t)),cf(t[0])}o(NF,"encodingFromData");cs=HE.exports=kF;cs.encode=IF;cs.decode=DF;cs.isEncoded=OF;cs.encoding=cf;cs.encodingFromData=NF;var PF=Object.freeze(Lc.names),LF=Object.freeze(Lc.codes);cs.names=PF;cs.codes=LF});var VE=De((tte,GE)=>{GE.exports=jE;var KE=128,BF=127,UF=~BF,$F=Math.pow(2,31);function jE(t,e,r){e=e||[],r=r||0;for(var n=r;t>=$F;)e[r++]=t&255|KE,t/=128;for(;t&UF;)e[r++]=t&255|KE,t>>>=7;return e[r]=t|0,jE.bytes=r-n+1,e}o(jE,"encode")});var YE=De((rte,JE)=>{JE.exports=Kg;var FF=128,WE=127;function Kg(t,n){var r=0,n=n||0,i=0,a=n,c,u=t.length;do{if(a>=u)throw Kg.bytes=0,new RangeError("Could not decode varint");c=t[a++],r+=i<28?(c&WE)<<i:(c&WE)*Math.pow(2,i),i+=7}while(c>=FF);return Kg.bytes=a-n,r}o(Kg,"read")});var ZE=De((nte,XE)=>{var qF=Math.pow(2,7),HF=Math.pow(2,14),zF=Math.pow(2,21),KF=Math.pow(2,28),jF=Math.pow(2,35),GF=Math.pow(2,42),VF=Math.pow(2,49),WF=Math.pow(2,56),JF=Math.pow(2,63);XE.exports=function(t){return t<qF?1:t<HF?2:t<zF?3:t<KF?4:t<jF?5:t<GF?6:t<VF?7:t<WF?8:t<JF?9:10}});var e9=De((ite,QE)=>{QE.exports={encode:VE(),decode:YE(),encodingLength:ZE()}});var r9=De((ote,t9)=>{"use strict";var YF=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});t9.exports={names:YF}});var c9=De((ste,f9)=>{"use strict";var n9=zE(),Bc=e9(),{names:xl}=r9(),{toString:q0}=($f(),mh(Qy)),{fromString:XF}=(hu(),mh(Zy)),{concat:ZF}=(cm(),mh(Ey)),Uc={};for(let t in xl){let e=t;Uc[xl[e]]=e}Object.freeze(Uc);function QF(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return q0(t,"base16")}o(QF,"toHexString");function eq(t){return XF(t,"base16")}o(eq,"fromHexString");function tq(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return q0(n9.encode("base58btc",t)).slice(1)}o(tq,"toB58String");function rq(t){let e=t instanceof Uint8Array?q0(t):t;return n9.decode("z"+e)}o(rq,"fromB58String");function i9(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=Bc.decode(t);if(!s9(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);t=t.slice(Bc.decode.bytes);let r=Bc.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(Bc.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${q0(t,"base16")}`);return{code:e,name:Uc[e],length:r,digest:t}}o(i9,"decode");function nq(t,e,r){if(!t||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=o9(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=Bc.encode(n),a=Bc.encode(r);return ZF([i,a,t],i.length+a.length+t.length)}o(nq,"encode");function o9(t){let e=t;if(typeof t=="string"){if(xl[t]===void 0)throw new Error(`Unrecognized hash function named: ${t}`);e=xl[t]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Uc[e]===void 0&&!jg(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(o9,"coerceCode");function jg(t){return t>0&&t<16}o(jg,"isAppCode");function s9(t){return!!(jg(t)||Uc[t])}o(s9,"isValidCode");function a9(t){i9(t)}o(a9,"validate");function iq(t){return a9(t),t.subarray(0,2)}o(iq,"prefix");f9.exports={names:xl,codes:Uc,toHexString:QF,fromHexString:eq,toB58String:tq,fromB58String:rq,decode:i9,encode:nq,coerceCode:o9,isAppCode:jg,validate:a9,prefix:iq,isValidCode:s9}});var zH={};Jt(zH,{CeramicURIValidator:()=>Qg,default:()=>HH,getCeramicPlugin:()=>Z0,streamIdToCeramicURI:()=>X0});module.exports=mh(zH);var O9=Lt(xy());function Uk(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}o(Uk,"_catch");function $k(){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($k,"inMemoryCache");function Fk(t,e){return e()}o(Fk,"noCache");var qk="(?:%[0-9a-fA-F]{2})",wy=`(?:[a-zA-Z0-9._-]|${qk})`,Hk="([a-z0-9]+)",zk=`((?:${wy}*:)*(${wy}+))`,_y="[a-zA-Z0-9_.:%-]",Kk=`;${_y}+=${_y}*`,jk=`((${Kk})*)`,Gk="(/[^#?]*)?",Vk="([?][^#]*)?",Wk="(#.*)?",Jk=new RegExp(`^did:${Hk}:${zk}${jk}${Gk}${Vk}${Wk}$`);function Yk(t){if(t===""||!t)return null;let e=t.match(Jk);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(Yk,"parse");var bh={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function Xk(t){return function(e,r,n){try{return Promise.resolve(Uk(function(){return Promise.resolve(t(e,r,n)).then(function(i){return{...bh,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i}})},function(i){return{...bh,didResolutionMetadata:{error:"notFound",message:i.toString()}}}))}catch(i){return Promise.reject(i)}}}o(Xk,"wrapLegacyResolver");var nu=class{constructor(e={},r={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=r.cache===!0?$k():r.cache||Fk,r.legacyResolvers&&Object.keys(r.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=Xk(r.legacyResolvers[n]))})}resolve(e,r={}){try{let n=this,i=Yk(e);if(i===null)return Promise.resolve({...bh,didResolutionMetadata:{error:"invalidDid"}});let a=n.registry[i.method];return a?Promise.resolve(n.cache(i,()=>a(i.did,i,n,r))):Promise.resolve({...bh,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(n){return Promise.reject(n)}}};o(nu,"Resolver");cm();hu();$f();gh();iu();km();var I1=Lt(a3()),Dx=Lt(Um()),D1=Lt(N6()),ud=Lt(_u()),Ox=Lt(ox()),Cu=Lt(cx()),O1=Lt(Ex()),R1=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 N1(t){return Ot(t,"base58btc")}o(N1,"base58ToBytes");function T1(t){let e=t.startsWith("0x")?t.substring(2):t;return Ot(e.toLowerCase(),"base16")}o(T1,"hexToBytes");function C1(t){return bi(Ot(t))}o(C1,"encodeBase64url");function Rx(t){return kt(xn(t))}o(Rx,"decodeBase64url");function La(t){return kt(t,"base16")}o(La,"bytesToHex");function Nx(t){return Ot(t)}o(Nx,"stringToBytes");function _N({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(_N,"toJose");function EN(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(EN,"fromJose");function Px(t,e){return Oi([xn(t),xn(e)])}o(Px,"toSealed");var AN=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,SN=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,MN=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function TN(t){if(typeof t=="string"){if(AN.test(t))return T1(t);if(SN.test(t))return N1(t);if(MN.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(TN,"parseKey");function Lx(t){let e=typeof t=="string"?Ot(t):t;return(0,I1.hash)(e)}o(Lx,"sha256");function CN(t){return new Uint8Array(Dx.keccak_256.arrayBuffer(t))}o(CN,"keccak");function kN(t){let e=Ot(t.slice(2),"base16");return`0x${kt(CN(e).slice(-20),"base16")}`}o(kN,"toEthereumAddress");function k1(t,e=new Uint8Array(4)){let r=Ot(t.toString(),"base10");return e.set(r,4-r.length),e}o(k1,"writeUint32BE");var M1=o(t=>Oi([k1(t.length),t]),"lengthAndInput");function Bx(t,e,r,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let a=Oi([M1(Ot(r)),M1(typeof n>"u"?new Uint8Array(0):n),M1(typeof i>"u"?new Uint8Array(0):i),k1(e)]);return(0,I1.hash)(Oi([k1(1),t,a]))}o(Bx,"concatKDF");var XK=new D1.ec("secp256k1");function Ux(t){let e=TN(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"?Nx(r):r,i=(0,ud.sign)(e,n);return Promise.resolve(bi(i))}catch(n){return Promise.reject(n)}}}o(Ux,"EdDSASigner");function $x(t){return typeof t=="object"&&"r"in t&&"s"in t}o($x,"instanceOfEcdsaSignature");function Ax(t){return o(function(r,n){try{return Promise.resolve(n(r)).then(function(i){if($x(i))return _N(i,t);if(t&&typeof EN(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(Ax,"ES256KSignerAlg");function Sx(){return o(function(e,r){try{return Promise.resolve(r(e)).then(function(n){if($x(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(Sx,"Ed25519SignerAlg");var IN={ES256K:Ax(),"ES256K-R":Ax(!0),Ed25519:Sx(),EdDSA:Sx()};function DN(t){let e=IN[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(DN,"SignerAlg");var P1=new D1.ec("secp256k1");function cd(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(cd,"toSignatureObject");function L1(t){if(t.publicKeyBase58)return N1(t.publicKeyBase58);if(t.publicKeyBase64)return xn(t.publicKeyBase64);if(t.publicKeyHex)return T1(t.publicKeyHex);if(t.publicKeyJwk&&t.publicKeyJwk.crv==="secp256k1"&&t.publicKeyJwk.x&&t.publicKeyJwk.y)return T1(P1.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}=lu;return e.decoder.or(r.decoder.or(n.decoder.or(i.decoder))).decode(t.publicKeyMultibase)}return new Uint8Array}o(L1,"extractPublicKeyBytes");function ON(t,e,r){let n=Lx(t),i=cd(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=L1(m);return P1.keyFromPublic(v).verify(n,i)}catch{return!1}});if(!u&&c.length>0&&(u=Fx(t,e,c)),!u)throw new Error("invalid_signature: Signature invalid for JWT");return u}o(ON,"verifyES256K");function Fx(t,e,r){let n;if(e.length>86)n=[cd(e,!0)];else{let c=cd(e,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let i=o(c=>{let u=Lx(t),m=P1.recoverPubKey(u,c,c.recoveryParam),v=m.encode("hex"),x=m.encode("hex",!0),S=kN(v);return r.find(R=>{var D,P,J;let L=La(L1(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(Fx,"verifyRecoverableES256K");function Mx(t,e,r){let n=Nx(t),i=xn(e),a=r.find(c=>(0,ud.verify)(L1(c),n,i));if(!a)throw new Error("invalid_signature: Signature invalid for JWT");return a}o(Mx,"verifyEd25519");var RN={ES256K:ON,"ES256K-R":Fx,Ed25519:Mx,EdDSA:Mx};function qx(t){let e=RN[t];if(!e)throw new Error(`not_supported: Unsupported algorithm ${t}`);return e}o(qx,"VerifierAlgorithm");qx.toSignatureObject=cd;var Hx=o(function(t,e,r={},n={}){try{r.alg||(r.alg=NN);let i=typeof t=="string"?t:Tx(t,n.canonicalize),a=[Tx(r,n.canonicalize),i].join("."),c=DN(r.alg);return Promise.resolve(c(a,e)).then(function(u){return[a,u].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var NN="ES256K";function Tx(t,e=!1){return C1(e?(0,Ox.default)(t):JSON.stringify(t))}o(Tx,"encodeSection");function PN(t){let e=t.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Rx(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(PN,"decodeJWS");function LN({header:t,data:e,signature:r},n){return Array.isArray(n)||(n=[n]),qx(t.alg)(e,r,n)}o(LN,"verifyJWSDecoded");function zx(t,e){let r=PN(t);return LN(r,e)}o(zx,"verifyJWS");function BN(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(BN,"_for");var Kx=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;FN(t);let i=JSON.parse(Rx(t.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let a=Px(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 BN(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"),Cx=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 UN(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(UN,"_forTo");function $N(t,e,r){if(typeof t[Cx]=="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[Cx](),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 UN(m,function(x){return e(m[x])},r)}o($N,"_forOf");function FN(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(FN,"validateJWE");function kx({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(kx,"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 kx(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=$N(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=kx(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 Gx=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=>HN(N1(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 Vx(t){let e=new O1.XChaCha20Poly1305(t);return(r,n)=>{let i=(0,R1.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(Vx,"xc20pEncrypter");function qN(t){let e=o(function(a,c={},u){try{let m=C1(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=Vx(t),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(qN,"xc20pDirEncrypter");function Ix(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 O1.XChaCha20Poly1305(t);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Ix,"xc20pDirDecrypter");function HN(t,e){let r=o(function(u,m={},v){try{Object.assign(m,{alg:void 0});let x=(0,R1.randomBytes)(32);return Promise.resolve(qN(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,Cu.generateKeyPair)(),v=(0,Cu.sharedKey)(m.secretKey,t),x=Bx(v,a,i),S=Vx(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(HN,"x25519Encrypter");function zN(t){if(!(t&&t.epk&&t.iv&&t.tag))throw new Error("bad_jwe: malformed header")}o(zN,"validateHeader");function Wx(t){let e=o(function(a,c,u,m){try{let S=function(){let P=Bx(R,n,r),J=Px(m.encrypted_key,m.header.tag);return Promise.resolve(Ix(P).decrypt(J,xn(m.header.iv))).then(function(L){return L===null?null:Ix(L).decrypt(a,c,u)})};o(S,"_temp4");var v,x;if(zN((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,Cu.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(Wx,"x25519Decrypter");Cm();var ld=o(({enumerable:t=!0,configurable:e=!1}={})=>({enumerable:t,configurable:e,writable:!1}),"readonly"),B1=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*B1(c,u))}else{let a=We.asCID(n);a?yield[i.join("/"),a]:yield*B1(n,i)}}},"links"),U1=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*U1(c,u))}else yield*U1(n,i)}},"tree"),KN=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"),ku=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:ld(),bytes:ld(),value:ld(),asBlock:ld()})}links(){return B1(this.value,[])}tree(){return U1(this.value,[])}get(e="/"){return KN(this.value,e.split("/").filter(Boolean))}};o(ku,"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 ku({value:t,bytes:n,cid:a})},"encode"),Jx=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 ku({value:n,bytes:t,cid:a})},"decode");Pi();cu();Tm();Eh();var Hi={};Jt(Hi,{code:()=>ac,decode:()=>J1,encode:()=>qa,name:()=>MP});var jN=["string","number","bigint","symbol"],GN=["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 Yx(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(jN.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(VN(t))return"Buffer";let r=WN(t);return r||"Object"}o(Yx,"is");function VN(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}o(VN,"isBuffer");function WN(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(GN.includes(e))return e}o(WN,"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 tc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",JN=new TextDecoder,YN=new TextEncoder;function hd(t){return tc&&globalThis.Buffer.isBuffer(t)}o(hd,"isBuffer");function F1(t){return t instanceof Uint8Array?hd(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}o(F1,"asU8A");var ew=tc?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):Zx(t,e,r):(t,e,r)=>r-e>64?JN.decode(t.subarray(e,r)):Zx(t,e,r),tw=tc?t=>t.length>64?globalThis.Buffer.from(t):Xx(t):t=>t.length>64?YN.encode(t):Xx(t),ho=o(t=>Uint8Array.from(t),"fromArray"),rc=tc?(t,e,r)=>hd(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),rw=tc?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),F1(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},nw=tc?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function iw(t,e){if(hd(t)&&hd(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(iw,"compare");function Xx(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(Xx,"utf8ToBytes");function Zx(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 XN(n)}o(Zx,"utf8Slice");var Qx=4096;function XN(t){let e=t.length;if(e<=Qx)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Qx));return r}o(XN,"decodeCodePointsArray");var ZN=256,nc=class{constructor(e=ZN){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=nw(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=rc(n,0,this.cursor)}else r=rw(this.chunks,this.cursor);return e&&this.reset(),r}};o(nc,"Bl");var mt="CBOR decode error:",q1="CBOR encode error:",Iu=[];Iu[23]=1;Iu[24]=2;Iu[25]=3;Iu[26]=5;Iu[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 ow(t,e,r,n){return new $e(_e.uint,Bn(t,e+1,n),2)}o(ow,"decodeUint8");function sw(t,e,r,n){return new $e(_e.uint,Un(t,e+1,n),3)}o(sw,"decodeUint16");function aw(t,e,r,n){return new $e(_e.uint,$n(t,e+1,n),5)}o(aw,"decodeUint32");function fw(t,e,r,n){return new $e(_e.uint,Fn(t,e+1,n),9)}o(fw,"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 cw(t,e,r,n){return new $e(_e.negint,-1-Bn(t,e+1,n),2)}o(cw,"decodeNegint8");function uw(t,e,r,n){return new $e(_e.negint,-1-Un(t,e+1,n),3)}o(uw,"decodeNegint16");function lw(t,e,r,n){return new $e(_e.negint,-1-$n(t,e+1,n),5)}o(lw,"decodeNegint32");var H1=BigInt(-1),hw=BigInt(1);function dw(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,H1-BigInt(i),9)}o(dw,"decodeNegint64");function dd(t,e){let r=e.value,n=typeof r=="bigint"?r*H1-hw:r*-1-1;Ur(t,e.type.majorEncoded,n)}o(dd,"encodeNegint");dd.encodedSize=o(function(e){let r=e.value,n=typeof r=="bigint"?r*H1-hw:r*-1-1;return n<Cr[0]?1:n<Cr[1]?2:n<Cr[2]?3:n<Cr[3]?5:9},"encodedSize");dd.compareTokens=o(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Du(t,e,r,n){Xo(t,e,r+n);let i=rc(t,e+r,e+r+n);return new $e(_e.bytes,i,r+n)}o(Du,"toToken");function pw(t,e,r,n){return Du(t,e,1,r)}o(pw,"decodeBytesCompact");function mw(t,e,r,n){return Du(t,e,2,Bn(t,e+1,n))}o(mw,"decodeBytes8");function bw(t,e,r,n){return Du(t,e,3,Un(t,e+1,n))}o(bw,"decodeBytes16");function gw(t,e,r,n){return Du(t,e,5,$n(t,e+1,n))}o(gw,"decodeBytes32");function vw(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 Du(t,e,9,i)}o(vw,"decodeBytes64");function pd(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===_e.string?tw(t.value):t.value),t.encodedBytes}o(pd,"tokenBytes");function ic(t,e){let r=pd(e);Ur(t,e.type.majorEncoded,r.length),t.push(r)}o(ic,"encodeBytes");ic.encodedSize=o(function(e){let r=pd(e);return Ur.encodedSize(r.length)+r.length},"encodedSize");ic.compareTokens=o(function(e,r){return eP(pd(e),pd(r))},"compareTokens");function eP(t,e){return t.length<e.length?-1:t.length>e.length?1:iw(t,e)}o(eP,"compareBytes");function Ou(t,e,r,n,i){let a=r+n;Xo(t,e,a);let c=new $e(_e.string,ew(t,e+r,e+a),a);return i.retainStringBytes===!0&&(c.byteValue=rc(t,e+r,e+a)),c}o(Ou,"toToken");function yw(t,e,r,n){return Ou(t,e,1,r,n)}o(yw,"decodeStringCompact");function xw(t,e,r,n){return Ou(t,e,2,Bn(t,e+1,n),n)}o(xw,"decodeString8");function ww(t,e,r,n){return Ou(t,e,3,Un(t,e+1,n),n)}o(ww,"decodeString16");function _w(t,e,r,n){return Ou(t,e,5,$n(t,e+1,n),n)}o(_w,"decodeString32");function Ew(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 Ou(t,e,9,i,n)}o(Ew,"decodeString64");var Aw=ic;function oc(t,e,r,n){return new $e(_e.array,n,r)}o(oc,"toToken");function Sw(t,e,r,n){return oc(t,e,1,r)}o(Sw,"decodeArrayCompact");function Mw(t,e,r,n){return oc(t,e,2,Bn(t,e+1,n))}o(Mw,"decodeArray8");function Tw(t,e,r,n){return oc(t,e,3,Un(t,e+1,n))}o(Tw,"decodeArray16");function Cw(t,e,r,n){return oc(t,e,5,$n(t,e+1,n))}o(Cw,"decodeArray32");function kw(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 oc(t,e,9,i)}o(kw,"decodeArray64");function Iw(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${mt} indefinite length items not allowed`);return oc(t,e,1,1/0)}o(Iw,"decodeArrayIndefinite");function md(t,e){Ur(t,_e.array.majorEncoded,e.value)}o(md,"encodeArray");md.compareTokens=gi.compareTokens;md.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function sc(t,e,r,n){return new $e(_e.map,n,r)}o(sc,"toToken");function Dw(t,e,r,n){return sc(t,e,1,r)}o(Dw,"decodeMapCompact");function Ow(t,e,r,n){return sc(t,e,2,Bn(t,e+1,n))}o(Ow,"decodeMap8");function Rw(t,e,r,n){return sc(t,e,3,Un(t,e+1,n))}o(Rw,"decodeMap16");function Nw(t,e,r,n){return sc(t,e,5,$n(t,e+1,n))}o(Nw,"decodeMap32");function Pw(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 sc(t,e,9,i)}o(Pw,"decodeMap64");function Lw(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(Lw,"decodeMapIndefinite");function bd(t,e){Ur(t,_e.map.majorEncoded,e.value)}o(bd,"encodeMap");bd.compareTokens=gi.compareTokens;bd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");function Bw(t,e,r,n){return new $e(_e.tag,r,1)}o(Bw,"decodeTagCompact");function Uw(t,e,r,n){return new $e(_e.tag,Bn(t,e+1,n),2)}o(Uw,"decodeTag8");function $w(t,e,r,n){return new $e(_e.tag,Un(t,e+1,n),3)}o($w,"decodeTag16");function Fw(t,e,r,n){return new $e(_e.tag,$n(t,e+1,n),5)}o(Fw,"decodeTag32");function qw(t,e,r,n){return new $e(_e.tag,Fn(t,e+1,n),9)}o(qw,"decodeTag64");function gd(t,e){Ur(t,_e.tag.majorEncoded,e.value)}o(gd,"encodeTag");gd.compareTokens=gi.compareTokens;gd.encodedSize=o(function(e){return Ur.encodedSize(e.value)},"encodedSize");var sP=20,aP=21,fP=22,cP=23;function Hw(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(Hw,"decodeUndefined");function zw(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(zw,"decodeBreak");function z1(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(z1,"createToken");function Kw(t,e,r,n){return z1(K1(t,e+1),3,n)}o(Kw,"decodeFloat16");function jw(t,e,r,n){return z1(j1(t,e+1),5,n)}o(jw,"decodeFloat32");function Gw(t,e,r,n){return z1(Yw(t,e+1),9,n)}o(Gw,"decodeFloat64");function vd(t,e,r){let n=e.value;if(n===!1)t.push([_e.float.majorEncoded|sP]);else if(n===!0)t.push([_e.float.majorEncoded|aP]);else if(n===null)t.push([_e.float.majorEncoded|fP]);else if(n===void 0)t.push([_e.float.majorEncoded|cP]);else{let i,a=!1;(!r||r.float64!==!0)&&(Ww(n),i=K1(Fi,1),n===i||Number.isNaN(n)?(Fi[0]=249,t.push(Fi.slice(0,3)),a=!0):(Jw(n),i=j1(Fi,1),n===i&&(Fi[0]=250,t.push(Fi.slice(0,5)),a=!0))),a||(uP(n),i=Yw(Fi,1),Fi[0]=251,t.push(Fi.slice(0,9)))}}o(vd,"encodeFloat");vd.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){Ww(n);let i=K1(Fi,1);if(n===i||Number.isNaN(n))return 3;if(Jw(n),i=j1(Fi,1),n===i)return 5}return 9},"encodedSize");var Vw=new ArrayBuffer(9),vi=new DataView(Vw,1),Fi=new Uint8Array(Vw,0);function Ww(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(Ww,"encodeFloat16");function K1(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(K1,"readFloat16");function Jw(t){vi.setFloat32(0,t,!1)}o(Jw,"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 uP(t){vi.setFloat64(0,t,!1)}o(uP,"encodeFloat64");function Yw(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(Yw,"readFloat64");vd.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 yd(t){return()=>{throw new Error(`${mt} ${t}`)}}o(yd,"errorer");var Pe=[];for(let t=0;t<=23;t++)Pe[t]=$t;Pe[24]=ow;Pe[25]=sw;Pe[26]=aw;Pe[27]=fw;Pe[28]=$t;Pe[29]=$t;Pe[30]=$t;Pe[31]=$t;for(let t=32;t<=55;t++)Pe[t]=$t;Pe[56]=cw;Pe[57]=uw;Pe[58]=lw;Pe[59]=dw;Pe[60]=$t;Pe[61]=$t;Pe[62]=$t;Pe[63]=$t;for(let t=64;t<=87;t++)Pe[t]=pw;Pe[88]=mw;Pe[89]=bw;Pe[90]=gw;Pe[91]=vw;Pe[92]=$t;Pe[93]=$t;Pe[94]=$t;Pe[95]=yd("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Pe[t]=yw;Pe[120]=xw;Pe[121]=ww;Pe[122]=_w;Pe[123]=Ew;Pe[124]=$t;Pe[125]=$t;Pe[126]=$t;Pe[127]=yd("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Pe[t]=Sw;Pe[152]=Mw;Pe[153]=Tw;Pe[154]=Cw;Pe[155]=kw;Pe[156]=$t;Pe[157]=$t;Pe[158]=$t;Pe[159]=Iw;for(let t=160;t<=183;t++)Pe[t]=Dw;Pe[184]=Ow;Pe[185]=Rw;Pe[186]=Nw;Pe[187]=Pw;Pe[188]=$t;Pe[189]=$t;Pe[190]=$t;Pe[191]=Lw;for(let t=192;t<=215;t++)Pe[t]=Bw;Pe[216]=Uw;Pe[217]=$w;Pe[218]=Fw;Pe[219]=qw;Pe[220]=$t;Pe[221]=$t;Pe[222]=$t;Pe[223]=$t;for(let t=224;t<=243;t++)Pe[t]=yd("simple values are not supported");Pe[244]=$t;Pe[245]=$t;Pe[246]=$t;Pe[247]=Hw;Pe[248]=yd("simple values are not supported");Pe[249]=Kw;Pe[250]=jw;Pe[251]=Gw;Pe[252]=$t;Pe[253]=$t;Pe[254]=$t;Pe[255]=zw;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 Xw(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(Xw,"quickEncodeToken");var hP={float64:!1,mapSorter:mP,quickEncodeToken:Xw};function dP(){let t=[];return t[_e.uint.major]=gi,t[_e.negint.major]=dd,t[_e.bytes.major]=ic,t[_e.string.major]=Aw,t[_e.array.major]=md,t[_e.map.major]=bd,t[_e.tag.major]=gd,t[_e.float.major]=vd,t}o(dP,"makeCborEncoders");var Zw=dP(),G1=new nc,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(`${q1} 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++]=xd(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++]=[xd(v,r,n),xd(i?t.get(v):t[v],r,n)];return pP(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 xd(t,e={},r){let n=Yx(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(`${q1} unsupported type: ${n}`);return a(t,n,e,r)}o(xd,"objectToTokens");function pP(t,e){e.mapSorter&&t.sort(e.mapSorter)}o(pP,"sortMapEntries");function mP(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=Zw[i].compareTokens(r,n);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}o(mP,"mapSorter");function Qw(t,e,r,n){if(Array.isArray(e))for(let i of e)Qw(t,i,r,n);else r[e.type.major](t,e,n)}o(Qw,"tokensToEncoded");function bP(t,e,r){let n=xd(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 nc(c);if(a(u,n,r),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return F1(u.chunks[0])}}return G1.reset(),Qw(G1,n,e,r),G1.toBytes(!0)}o(bP,"encodeCustom");function V1(t,e){return e=Object.assign({},hP,e),bP(t,Zw,e)}o(V1,"encode");var gP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},wd=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(wd,"Tokeniser");var Ru=Symbol.for("DONE"),_d=Symbol.for("BREAK");function vP(t,e,r){let n=[];for(let i=0;i<t.value;i++){let a=Nu(e,r);if(a===_d){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed array`)}if(a===Ru)throw new Error(`${mt} found array but not enough entries (got ${i}, expected ${t.value})`);n[i]=a}return n}o(vP,"tokenToArray");function yP(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=Nu(e,r);if(u===_d){if(t.value===1/0)break;throw new Error(`${mt} got unexpected break to lengthed map`)}if(u===Ru)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=Nu(e,r);if(m===Ru)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(yP,"tokenToMap");function Nu(t,e){if(t.done())return Ru;let r=t.next();if(r.type===_e.break)return _d;if(r.type.terminal)return r.value;if(r.type===_e.array)return vP(r,t,e);if(r.type===_e.map)return yP(r,t,e);if(r.type===_e.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=Nu(t,e);return e.tags[r.value](n)}throw new Error(`${mt} tag not supported (${r.value})`)}throw new Error("unsupported")}o(Nu,"tokensToObject");function W1(t,e){if(!(t instanceof Uint8Array))throw new Error(`${mt} data to decode must be a Uint8Array`);e=Object.assign({},gP,e);let r=e.tokenizer||new wd(t,e),n=Nu(r,e);if(n===Ru)throw new Error(`${mt} did not find any content to decode`);if(n===_d)throw new Error(`${mt} got unexpected break`);if(!r.done())throw new Error(`${mt} too many terminals, data makes no sense`);return n}o(W1,"decode");Pi();var e4=42;function wP(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,e4),new $e(_e.bytes,r)]}o(wP,"cidEncoder");function _P(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(_P,"undefinedEncoder");function EP(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(EP,"numberEncoder");var AP={float64:!0,typeEncoders:{Object:wP,undefined:_P,number:EP}};function SP(t){if(t[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return We.decode(t.subarray(1))}o(SP,"cidDecoder");var t4={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};t4.tags[e4]=SP;var MP="dag-cbor",ac=113,qa=o(t=>V1(t,AP),"encode"),J1=o(t=>W1(t,t4),"decode");var TP=24;async function r4(t){let e=await Ua({value:t,codec:Hi,hasher:Ss});return{cid:e.cid,linkedBlock:e.bytes}}o(r4,"encodePayload");function CP(t,e=TP){let r=(e-t.length%e)%e,n=new Uint8Array(t.length+r);return n.set(t,0),n}o(CP,"pad");async function kP(t){return(await Ua({value:t,codec:Hi,hasher:Ch})).cid}o(kP,"encodeIdentityCID");function IP(t){if(t=We.asCID(t),t.code!==ac)throw new Error("CID codec must be dag-cbor");if(t.multihash.code!==Ch.code)throw new Error("CID must use identity multihash");return J1(t.multihash.digest)}o(IP,"decodeIdentityCID");async function n4(t,e){return CP((await kP(t)).bytes,e)}o(n4,"prepareCleartext");function i4(t){return IP(We.decodeFirst(t)[0])}o(i4,"decodeCleartext");var o4=Symbol("abortable"),Ed=Symbol("aborted");function s4(t,e){if(e.aborted)return Promise.reject(Ed);let r,n=new Promise((i,a)=>{r=a});return e.addEventListener("abort",()=>{r(Ed)}),Promise.race([t,n])}o(s4,"abortable");var a4=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 Ad="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 f4={[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 DP(t){return-32e3>=t&&t>=-32099}o(DP,"isServerError");function Sd(t){return f4[t.toString()]??(DP(t)?"Server error":"Application error")}o(Sd,"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??Sd(e)}};o(wn,"RPCError");function Pu(t){let e=f4[t];return o(function(n){return new wn(t,e,n)},"createError")}o(Pu,"createErrorFactory");var OP=Pu(an.PARSE_ERROR),cG=Pu(an.INVALID_REQUEST),uG=Pu(an.METHOD_NOT_FOUND),lG=Pu(an.INVALID_PARAMS),hG=Pu(an.INTERNAL_ERROR);function RP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(RP,"_checkPrivateRedeclaration");function NP(t,e){return e.get?e.get.call(t):e.value}o(NP,"_classApplyDescriptorGet");function PP(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(PP,"_classApplyDescriptorSet");function c4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(c4,"_classExtractFieldDescriptor");function Y1(t,e){var r=c4(t,e,"get");return NP(t,r)}o(Y1,"_classPrivateFieldGet");function LP(t,e,r){RP(t,e),e.set(t,r)}o(LP,"_classPrivateFieldInit");function BP(t,e,r){var n=c4(t,e,"set");return PP(t,n,r),r}o(BP,"_classPrivateFieldSet");var Lu=new WeakMap,fc=class{get connection(){return Y1(this,Lu)}createID(){return a4()}request(e,r=void 0,n={}){let{signal:i}=n;if(i?.aborted)return Promise.reject(Ed);let a=this.createID(),c=Y1(this,Lu).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(Ad,{id:a})}),s4(c,i))}async notify(e,r=void 0){await Y1(this,Lu).send({jsonrpc:"2.0",method:e,params:r})}constructor(e){LP(this,Lu,{writable:!0,value:void 0}),BP(this,Lu,e)}};o(fc,"RPCClient");function u4(t,e){return{jsonrpc:"2.0",id:t,error:{code:e,message:Sd(e)}}}o(u4,"createErrorResponse");function UP(t,e,r){console.warn("Unhandled handler error",e,r)}o(UP,"fallbackOnHandlerError");function $P(t,e){console.warn("Unhandled invalid message",e)}o($P,"fallbackOnInvalidMessage");function FP(t,e){console.warn("Unhandled notification",e)}o(FP,"fallbackOnNotification");function l4(t,e={}){let r=e.onHandlerError??UP,n=e.onInvalidMessage??$P,i=e.onNotification??FP,a={};function c(u,m){if(m.method===Ad){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):u4(x,an.INVALID_REQUEST);let S=t[v.method];if(S==null)return x==null?(c(m,v),null):u4(x,an.METHOD_NOT_FOUND);try{let O;if(x!=null&&S[o4]){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||Sd(D)}}return{jsonrpc:"2.0",id:x,error:R}}finally{x!=null&&delete a[x]}},"handleRequest")}o(l4,"createHandler");Pi();var F5=Lt(r5(),1),Zr=Lt(Ka(),1);function ob(){return ob=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},ob.apply(this,arguments)}o(ob,"_extends");var sb={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}"}}}},oL={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}"}}}},ab={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}"}}}},sL={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:sb,1:ab}}},aL={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:sb,1:ab,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},qu={"2":sb,"10":oL,"19":{assetName:ab,assetType:sL,assetId:aL}};function n5(t,e){return t.split(e.parameters.delimiter)}o(n5,"splitParams");function Hu(t,e){var r=n5(t,e),n={};return r.forEach(function(i,a){n[e.parameters.values[a].name]=i}),n}o(Hu,"getParams");function dc(t,e){return Object.values(e.parameters.values).map(function(r){var n=t[r.name];return typeof n=="string"?n:dc(n,r)}).join(e.parameters.delimiter)}o(dc,"joinParams");function zu(t,e){if(!new RegExp(e.regex).test(t))return!1;var r=n5(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(zu,"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(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return dc(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=qu["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(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=Hu(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=ob({},i.toJSON(),{address:n.address});return dc(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=qu["10"];var fb=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(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return dc(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}();fb.spec=qu["19"].assetName;var fL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.assetName=new fb(r.assetName)}o(t,"AssetType"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return dc(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}();fL.spec=qu["19"].assetType;var cL=function(){function t(r){typeof r=="string"&&(r=t.parse(r)),this.chainId=new Hs(r.chainId),this.assetName=new fb(r.assetName),this.tokenId=r.tokenId}o(t,"AssetId"),t.parse=o(function(n){if(!zu(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new t(Hu(n,this.spec)).toJSON()},"parse"),t.format=o(function(n){return dc(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}();cL.spec=qu["19"].assetId;var i5="logger/5.7.0";var o5=!1,s5=!1,Dd={debug:1,default:2,info:2,warning:3,error:4,off:5},a5=Dd.default,cb=null;function uL(){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(uL,"_checkNormalize");var f5=uL(),ub;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(ub||(ub={}));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 c5="0123456789abcdef",Et=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let n=e.toLowerCase();Dd[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(a5>Dd[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(s5)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+=c5[v[S]>>4],x+=c5[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"),f5&&this.throwError("platform missing String.prototype.normalize",Et.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f5})}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 cb||(cb=new Et(i5)),cb}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o5){if(!e)return;this.globalLogger().throwError("error censorship permanent",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}s5=!!e,o5=!!r}static setLogLevel(e){let r=Dd[e.toLowerCase()];if(r==null){Et.globalLogger().warn("invalid log level - "+e);return}a5=r}static from(e){return new Et(e)}};o(Et,"Logger");Et.errors=Ki;Et.levels=ub;var u5="bytes/5.7.0";var gr=new Et(u5);function h5(t){return!!t.toHexString}o(h5,"isHexable");function pc(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return pc(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}o(pc,"addSlice");function d5(t){return ji(t)&&!(t.length%2)||hb(t)}o(d5,"isBytesLike");function l5(t){return typeof t=="number"&&t==t&&t%1===0}o(l5,"isInteger");function hb(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!l5(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!l5(r)||r<0||r>=256)return!1}return!0}o(hb,"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),pc(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),h5(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 pc(new Uint8Array(n))}return hb(t)?pc(new Uint8Array(t)):gr.throwArgumentError("invalid arrayify value","value",t)}o(or,"arrayify");function db(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),pc(n)}o(db,"concat");function lL(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),pc(r)}o(lL,"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 lb="0123456789abcdef";function Yr(t,e){if(e||(e={}),typeof t=="number"){gr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=lb[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),h5(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(hb(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=lb[(i&240)>>4]+lb[i&15]}return r}return gr.throwArgumentError("invalid hexlify value","value",t)}o(Yr,"hexlify");function Od(t){if(typeof t!="string")t=Yr(t);else if(!ji(t)||t.length%2)return null;return(t.length-2)/2}o(Od,"hexDataLength");function Rd(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(Rd,"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 Nd(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(d5(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=lL(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(Nd,"splitSignature");var b5=Lt(mb());var m5="bignumber/5.7.0";var hL=b5.default.BN,iV=new Et(m5);function bb(t){return new hL(t,36).toString(16)}o(bb,"_base36To16");var g5=Lt(Um());function mc(t){return"0x"+g5.default.keccak_256(or(t))}o(mc,"keccak256");var v5="address/5.7.0";var Ku=new Et(v5);function y5(t){ji(t,20)||Ku.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(mc(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(y5,"getChecksumAddress");var mL=9007199254740991;function bL(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}o(bL,"log10");var gb={};for(let t=0;t<10;t++)gb[String(t)]=String(t);for(let t=0;t<26;t++)gb[String.fromCharCode(65+t)]=String(10+t);var x5=Math.floor(bL(mL));function gL(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>gb[n]).join("");for(;e.length>=x5;){let n=e.substring(0,x5);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(gL,"ibanChecksum");function w5(t){let e=null;if(typeof t!="string"&&Ku.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=y5(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ku.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)!==gL(t)&&Ku.throwArgumentError("bad icap checksum","address",t),e=bb(t.substring(4));e.length<40;)e="0"+e;e=y5("0x"+e)}else Ku.throwArgumentError("invalid address","address",t);return e}o(w5,"getAddress");var _5="properties/5.7.0";var wV=new Et(_5);function bc(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}o(bc,"defineReadOnly");var E5="strings/5.7.0";var A5=new Et(E5),ju;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(ju||(ju={}));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 vL(t,e,r,n,i){return A5.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}o(vL,"errorFunc");function S5(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(S5,"ignoreFunc");function yL(t,e,r,n,i){return t===ja.OVERLONG?(n.push(i),0):(n.push(65533),S5(t,e,r,n,i))}o(yL,"replaceFunc");var xL=Object.freeze({error:vL,ignore:S5,replace:yL});function Gu(t,e=ju.current){e!=ju.current&&(A5.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(Gu,"toUtf8Bytes");var M5=`Ethereum Signed Message:
|
|
652
|
+
`;function vb(t){return typeof t=="string"&&(t=Gu(t)),mc(db([Gu(M5),Gu(String(t.length)),t]))}o(vb,"hashMessage");var yt=Lt(mb()),bo=Lt(vu());function gc(t,e,r){return r={path:e,exports:{},require:function(n,i){return wL(n,i??r.path)}},t(r,r.exports),r.exports}o(gc,"createCommonjsModule");function wL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(wL,"commonjsRequire");var _b=C5;function C5(t,e){if(!t)throw new Error(e||"Assertion failed")}o(C5,"assert");C5.equal=o(function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)},"assertEqual");var Gi=gc(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=gc(function(t,e){"use strict";var r=e;r.assert=_b,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}),Bd=Hn.getNAF,_L=Hn.getJSF,Ud=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){Ud(e.precomputed);var n=e._getDoubles(),i=Bd(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=Bd(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];Ud(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]=Bd(n[D],c[D],this._bitLength),m[P]=Bd(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=_L(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),K=this._wnafT4;for(x=v;x>=0;x--){for(var q=0;x>=0;){var j=!0;for(S=0;S<i;S++)K[S]=m[S][x]|0,K[S]!==0&&(j=!1);if(!j)break;q++,x--}if(x>=0&&q++,oe=oe.dblp(q),x<0)break;for(S=0;S<i;S++){var le=K[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?Ud(e[e.length-1]%2===0):e[0]===7&&Ud(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 Eb=gc(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")}),EL=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");Eb(_i,Ga);var AL=_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],EL(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()),K=R.sqr().add(D.sqr());return K.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");Eb(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");Eb(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 Pd=gc(function(t,e){"use strict";var r=e;r.base=Ga,r.short=AL,r.mont=null,r.edwards=null}),Ld=gc(function(t,e){"use strict";var r=e,n=Hn.assert;function i(u){u.type==="short"?this.curve=new Pd.short(u):u.type==="edwards"?this.curve=new Pd.edwards(u):this.curve=new Pd.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");_b(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}o(js,"HmacDRBG");var k5=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),_b(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 wb=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 Ab=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"?wb(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&wb(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()||wb(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 SL=Hn.assert;function $d(t,e){if(t instanceof $d)return t;this._importDER(t,e)||(SL(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($d,"Signature");var Fd=$d;function ML(){this.place=0}o(ML,"Position");function yb(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(yb,"getLength");function T5(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(T5,"rmPadding");$d.prototype._importDER=o(function(e,r){e=Hn.toArray(e,r);var n=new ML;if(e[n.place++]!==48)return!1;var i=yb(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var a=yb(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=yb(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 xb(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(xb,"constructLength");$d.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=T5(r),n=T5(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];xb(i,r.length),i=i.concat(r),i.push(2),xb(i,n.length);var a=i.concat(n),c=[48];return xb(c,a.length),c=c.concat(a),Hn.encode(c,e)},"toDER");var TL=o(function(){throw new Error("unsupported")},"rand"),I5=Hn.assert;function xi(t){if(!(this instanceof xi))return new xi(t);typeof t=="string"&&(I5(Object.prototype.hasOwnProperty.call(Ld,t),"Unknown curve "+t),t=Ld[t]),t instanceof Ld.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 CL=xi;xi.prototype.keyPair=o(function(e){return new Ab(this,e)},"keyPair");xi.prototype.keyFromPrivate=o(function(e,r){return Ab.fromPrivate(this,e,r)},"keyFromPrivate");xi.prototype.keyFromPublic=o(function(e,r){return Ab.fromPublic(this,e,r)},"keyFromPublic");xi.prototype.genKeyPair=o(function(e){e||(e={});for(var r=new k5({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||TL(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 k5({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 Fd({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 Fd(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){I5((3&r)===r,"The recovery param is more than two bits"),e=new Fd(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 Fd(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 kL=gc(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=Pd,r.curves=Ld,r.ec=CL,r.eddsa=null}),D5=kL.ec;var O5="signing-key/5.7.0";var Mb=new Et(O5),Sb=null;function go(){return Sb||(Sb=new D5("secp256k1")),Sb}o(go,"getCurve");var qd=class{constructor(e){bc(this,"curve","secp256k1"),bc(this,"privateKey",Yr(e)),Od(this.privateKey)!==32&&Mb.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=go().keyFromPrivate(or(this.privateKey));bc(this,"publicKey","0x"+r.getPublic(!1,"hex")),bc(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),bc(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&&Mb.throwArgumentError("bad digest length","digest",e);let i=r.sign(n,{canonical:!0});return Nd({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(Tb(e)));return Ks("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(qd,"SigningKey");function R5(t,e){let r=Nd(e),n={r:or(r.r),s:or(r.s)};return"0x"+go().recoverPubKey(or(t),n,r.recoveryParam).encode("hex",!1)}o(R5,"recoverPublicKey");function Tb(t,e){let r=or(t);if(r.length===32){let n=new qd(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 Mb.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(Tb,"computePublicKey");var N5="transactions/5.7.0";var tW=new Et(N5),P5;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(P5||(P5={}));function L5(t){let e=Tb(t);return w5(Rd(mc(Rd(e,1)),12))}o(L5,"computeAddress");function B5(t,e){return L5(R5(or(t),e))}o(B5,"recoverAddress");var U5="wallet/5.7.0";var uW=new Et(U5);function Cb(t,e){return B5(vb(t),e)}o(Cb,"verifyMessage");var q5=Lt(_u(),1);cu();hu();var IL=`
|
|
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
|
-
`,Hd=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
|
|
800
|
-
- `)),le},"resources");i.ast.callbacks.resources=L;let
|
|
799
|
+
`,Hd=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 F5.default(IL);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,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.domain=Zr.default.utils.charsToString(oe,K,q)),le},"domain");i.ast.callbacks.domain=c;let u=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.address=Zr.default.utils.charsToString(oe,K,q)),le},"address");i.ast.callbacks.address=u;let m=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.statement=Zr.default.utils.charsToString(oe,K,q)),le},"statement");i.ast.callbacks.statement=m;let v=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.uri||(j.uri=Zr.default.utils.charsToString(oe,K,q))),le},"uri");i.ast.callbacks.uri=v;let x=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.version=Zr.default.utils.charsToString(oe,K,q)),le},"version");i.ast.callbacks.version=x;let S=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.chainId=Zr.default.utils.charsToString(oe,K,q)),le},"chainId");i.ast.callbacks["chain-id"]=S;let O=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.nonce=Zr.default.utils.charsToString(oe,K,q)),le},"nonce");i.ast.callbacks.nonce=O;let R=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.issuedAt=Zr.default.utils.charsToString(oe,K,q)),le},"issuedAt");i.ast.callbacks["issued-at"]=R;let D=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.expirationTime=Zr.default.utils.charsToString(oe,K,q)),le},"expirationTime");i.ast.callbacks["expiration-time"]=D;let P=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.notBefore=Zr.default.utils.charsToString(oe,K,q)),le},"notBefore");i.ast.callbacks["not-before"]=P;let J=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.requestId=Zr.default.utils.charsToString(oe,K,q)),le},"requestId");i.ast.callbacks["request-id"]=J;let L=o(function(Y,oe,K,q,j){let le=a.SEM_OK;return Y===a.SEM_PRE&&(j.resources=Zr.default.utils.charsToString(oe,K,q).slice(3).split(`
|
|
800
|
+
- `)),le},"resources");i.ast.callbacks.resources=L;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(Hd,"ParsedMessage");var $5;(function(t){t.INVALID_SIGNATURE="Invalid signature.",t.EXPIRED_MESSAGE="Expired message.",t.MALFORMED_SESSION="Malformed session."})($5||($5={}));var Ju;(function(t){t.PERSONAL_SIGNATURE="Personal signature"})(Ju||(Ju={}));var Vu=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 Hd(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=zs.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 Hs(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=Ju.PERSONAL_SIGNATURE)),n}toMessage(e){return OL(this,e)}};o(Vu,"SiwxMessage");function DL(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
|
-
`));let
|
|
802
|
+
`));let m=u.join(`
|
|
803
803
|
`);return t.statement&&(i=[i,t.statement].join(`
|
|
804
804
|
|
|
805
|
-
`)),[i,
|
|
805
|
+
`)),[i,m].join(`
|
|
806
806
|
|
|
807
|
-
`)}o(
|
|
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}`,
|
|
809
|
-
`));let v=
|
|
807
|
+
`)}o(DL,"asLegacyChainIdString");function OL(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
|
+
`),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
|
+
`));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(cB,"asString");var Wu=class extends Vu{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case Ju.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Wu,"SiweMessage");var zd=class extends Vu{toMessage(){return super.toMessage("Solana")}signMessage(){let e;switch(this.type){case Ju.PERSONAL_SIGNATURE:{e=new TextEncoder().encode(this.toMessage());break}default:{e=new TextEncoder().encode(this.toMessage());break}}return e}};o(zd,"SiwsMessage");var uB=5*60,lB=new Date("2022-09-20").valueOf(),Yu;(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:As})).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 p,v;if(((p=c.s)==null?void 0:p.t)==="eip191")return a(c,u);if(((v=c.s)==null?void 0:v.t)==="solana:ed25519")return hB(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 p=u.atTime?u.atTime.getTime():Date.now(),v=(u.clockSkewSecs??uB)*1e3;if(Date.parse(c.p.iat)>p+v||Date.parse(c.p.nbf)>p+v)throw new Error("CACAO is not valid yet");let y=u.revocationPhaseOutSecs?u.revocationPhaseOutSecs*1e3:0;if(!u.disableExpirationCheck&&Date.parse(c.p.exp)+y+v<p)throw new Error("CACAO has expired");let O=[Ob(Wu.fromCacao(c).toMessage(),c.s.s).toLowerCase()];if(Date.parse(c.p.iat)<=lB){let I=Ob(fB(Wu.fromCacao(c),"Ethereum"),c.s.s).toLowerCase();O.push(I)}let R=Hs.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})(Yu||(Yu={}));function hB(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=zd.fromCacao(t),a=t.s.s,c=i.signMessage(),u=Ot(a,"base58btc"),p=Hs.parse(t.p.iss.replace("did:pkh:","")).address,v=Ot(p,"base58btc");if(!(0,j5.verify)(v,c,u))throw new Error("Signature does not belong to issuer")}o(hB,"verifySolanaSignature");var Xu;(function(t){function e(r){return Ba({value:r,codec:Hi,hasher:As})}o(e,"fromCacao"),t.fromCacao=e})(Xu||(Xu={}));Uf();hu();var G5=Pt(Da(),1);Uf();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 Kd(t){return JSON.parse(kt(Ot(t,J5)))}o(Kd,"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 dB(t){return"registry"in t&&"cache"in t}o(dB,"isResolver");var Ga=class{constructor({provider:e,resolver:r={},resolverOptions:n,capability:i,parent:a}={}){if(e!=null&&(this._client=new ac(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 Ga({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new ac(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=dB(e)?e:new nu(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=Kd(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 Xu.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 p=await Xu.fromCacao(this._capability);return{jws:c,linkedBlock:i,cacaoBlock:p.bytes}}return{jws:c,linkedBlock:i}}async verifyJWS(e,r={}){typeof e!="string"&&(e=Q5(e));let n=Kd(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 y=i.didDocumentMetadata?.updated;if(y&&r.atTime&&r.atTime.getTime()<new Date(y).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)Yu.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))Yu.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 p;try{p=Kd(e.split(".")[1])}catch{}return{kid:n,payload:p,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(Ga,"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=Pt(Zu(),1);_h();var Pb={};Jt(Pb,{keyToDidDoc:()=>TB});function TB(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(TB,"keyToDidDoc");var Lb={};Jt(Lb,{keyToDidDoc:()=>kB});Uf();var h8=Pt(_u(),1);function CB(t){let e=new Uint8Array(t.length+2);return e[0]=236,e[1]=1,e.set(t,2),`z${kt(e,"base58btc")}`}o(CB,"encodeKey");function kB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=(0,h8.convertPublicKeyToX25519)(t),a=`${r}#${CB(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(kB,"keyToDidDoc");var qb={};Jt(qb,{keyToDidDoc:()=>$B,pubKeyBytesToXY:()=>m8});var jd={};Jt(jd,{ECPointDecompress:()=>LB});function IB(t){return t>=0?t:-t}o(IB,"n");function DB(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,p=r-i*c,v=n-a*c;e=t,t=u,r=i,n=a,i=p,a=v}return{g:e,x:r,y:n}}o(DB,"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 OB(t,e){let r=DB(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(OB,"g");function Va(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 OB(Va(t,IB(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(Va,"b");var vr={};Jt(vr,{pubKeyBytesToHex:()=>RB,publicKeyHexToUint8ArrayPointPair:()=>d8,publicKeyIntToUint8ArrayPointPair:()=>p8,publicKeyIntToXY:()=>PB,publicKeyToXY:()=>NB,testHexString:()=>$b,testUint8Array:()=>Gs});Eh();function RB(t){if(!Gs(t))throw new TypeError("input must be a Uint8Array");return kt(t,"base16")}o(RB,"pubKeyBytesToHex");function NB(t){if(!$b(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=d8(t),r=wa.encode(e.xOctet).slice(1),n=wa.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(NB,"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 Gs(t){return t==null?!1:t.constructor===Uint8Array}o(Gs,"testUint8Array");function PB(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=wa.encode(e.xOctet).slice(1),n=wa.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(PB,"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 LB(t){if(!Gs(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")),p=u**3n-u*3n+n,v=Va(p,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(LB,"ECPointDecompress");var Gd={};Jt(Gd,{ECPointDecompress:()=>BB});function BB(t){if(!Gs(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")),p=u**3n-u*3n+n,v=Va(p,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(BB,"ECPointDecompress");var Vd={};Jt(Vd,{ECPointDecompress:()=>UB});function UB(t){if(!Gs(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")),p=u**3n-u*3n+n,v=Va(p,i,r);return v%2n!==a&&(v=r-v),{x:u,y:v}}o(UB,"ECPointDecompress");function $B(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($B,"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=jd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(m8,"pubKeyBytesToXY");var Hb={};Jt(Hb,{keyToDidDoc:()=>FB,pubKeyBytesToXY:()=>b8});function FB(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(FB,"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=Gd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(b8,"pubKeyBytesToXY");var zb={};Jt(zb,{keyToDidDoc:()=>qB,pubKeyBytesToXY:()=>g8});function qB(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(qB,"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=Vd.ECPointDecompress(r);return vr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(g8,"pubKeyBytesToXY");var HB="application/did+ld+json",v8="application/did+json",zB={231:Pb,237:Lb,4608:qb,4609:Hb,4610:zb};function KB(){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),p=c.slice(Kb.default.decode.bytes),v=await zB[u].keyToDidDoc(p,e.id);i===HB?(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(KB,"getResolver");var y8={getResolver:KB};var Wd=Pt(_u(),1);var S8=Pt(w8(),1);var jB="base64pad";function _8(t){return JSON.parse((0,S8.default)(t))}o(_8,"toStableObject");function GB(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(GB,"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"),VB={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,Wd.convertSecretKeyToX25519)(t));try{let n=await Wx(e.jwe,r);return{cleartext:kt(n,jB)}}catch(n){throw new wn(-32e3,n.message)}}},Qu=class{constructor(e){let{secretKey:r,publicKey:n}=(0,Wd.generateKeyPairFromSeed)(e),i=GB(n),a=m4(VB);this._handle=async c=>await a({did:i,secretKey:r},c)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(Qu,"Ed25519Provider");var jb={};Jt(jb,{JsonPatchError:()=>dr,_areEquals:()=>rl,applyOperation:()=>Wa,applyPatch:()=>t0,applyReducer:()=>ZB,deepClone:()=>YB,getValueByPointer:()=>Qd,validate:()=>T8,validator:()=>e0});var WB=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)}}(),JB=Object.prototype.hasOwnProperty;function Yd(t,e){return JB.call(t,e)}o(Yd,"hasOwnProperty");function Xd(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)Yd(t,i)&&n.push(i);return n}o(Xd,"_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 Zd(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(Zd,"isInteger");function vo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(vo,"escapePathComponent");function el(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(el,"unescapePathComponent");function Jd(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)if(Jd(t[e]))return!0}else if(typeof t=="object"){for(var n=Xd(t),i=n.length,a=0;a<i;a++)if(Jd(t[n[a]]))return!0}}return!1}o(Jd,"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 tl=function(t){WB(e,t);function e(r,n,i,a,c){var u=this.constructor,p=t.call(this,M8(r,{name:n,index:i,operation:a,tree:c}))||this;return p.name=n,p.index=i,p.operation=a,p.tree=c,Object.setPrototypeOf(p,u.prototype),p.message=M8(r,{name:n,index:i,operation:a,tree:c}),p}return o(e,"PatchError"),e}(Error);var dr=tl,YB=qr,gc={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=Qd(r,this.path);n&&(n=qr(n));var i=Wa(r,{op:"remove",path:this.from}).removed;return Wa(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(t,e,r){var n=Qd(r,this.from);return Wa(r,{op:"add",path:this.path,value:qr(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:rl(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},XB={add:function(t,e,r){return Zd(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:gc.move,copy:gc.copy,test:gc.test,_get:gc._get};function Qd(t,e){if(e=="")return t;var r={op:"_get",path:e};return Wa(t,r),r.value}o(Qd,"getValueByPointer");function Wa(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):e0(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=Qd(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=rl(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||"",p=u.split("/"),v=t,y=1,S=p.length,O=void 0,R=void 0,I=void 0;for(typeof r=="function"?I=r:I=e0;;){if(R=p[y],R&&R.indexOf("~")!=-1&&(R=el(R)),i&&(R=="__proto__"||R=="prototype"&&y>0&&p[y-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=p.slice(0,y).join("/"):y==S-1&&(O=e.path),O!==void 0&&I(e,0,t,O)),y++,Array.isArray(v)){if(R==="-")R=v.length;else{if(r&&!Zd(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);Zd(R)&&(R=~~R)}if(y>=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=XB[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(y>=S){var c=gc[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&&y<S&&(!v||typeof v!="object"))throw new dr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,e,t)}}}o(Wa,"applyOperation");function t0(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]=Wa(t,e[c],r,!0,i,c),t=a[c].newDocument;return a.newDocument=t,a}o(t0,"applyPatch");function ZB(t,e,r){var n=Wa(t,e);if(n.test===!1)throw new dr("Test operation failed","TEST_OPERATION_FAILED",r,e,t);return n.newDocument}o(ZB,"applyReducer");function e0(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(gc[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")&&Jd(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(e0,"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)t0(qr(e),qr(t),r||!0);else{r=r||e0;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 rl(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(!rl(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],!rl(t[c],e[c]))return!1;return!0}return t!==t&&e!==e}o(rl,"_areEquals");var Jb={};Jt(Jb,{compare:()=>sU,generate:()=>Gb,observe:()=>oU,unobserve:()=>iU});var Vb=new WeakMap,QB=function(){function t(e){this.observers=new Map,this.obj=e}return o(t,"Mirror"),t}(),eU=function(){function t(e,r){this.callback=e,this.observer=r}return o(t,"ObserverInfo"),t}();function tU(t){return Vb.get(t)}o(tU,"getMirror");function rU(t,e){return t.observers.get(e)}o(rU,"getObserverFromMirror");function nU(t,e){t.observers.delete(e.callback)}o(nU,"removeObserverFromMirror");function iU(t,e){e.unobserve()}o(iU,"unobserve");function oU(t,e){var r=[],n,i=tU(t);if(!i)i=new QB(t),Vb.set(t,i);else{var a=rU(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),nU(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 eU(e,n)),n}o(oU,"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&&t0(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=Xd(e),c=Xd(t),u=!1,p=!1,v=c.length-1;v>=0;v--){var y=c[v],S=t[y];if(Yd(e,y)&&!(e[y]===void 0&&S!==void 0&&Array.isArray(e)===!1)){var O=e[y];typeof S=="object"&&S!=null&&typeof O=="object"&&O!=null&&Array.isArray(S)===Array.isArray(O)?Wb(S,O,r,n+"/"+vo(y),i):S!==O&&(u=!0,i&&r.push({op:"test",path:n+"/"+vo(y),value:qr(S)}),r.push({op:"replace",path:n+"/"+vo(y),value:qr(O)}))}else Array.isArray(t)===Array.isArray(e)?(i&&r.push({op:"test",path:n+"/"+vo(y),value:qr(S)}),r.push({op:"remove",path:n+"/"+vo(y)}),p=!0):(i&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),u=!0)}if(!(!p&&a.length==c.length))for(var v=0;v<a.length;v++){var y=a[v];!Yd(t,y)&&e[y]!==void 0&&r.push({op:"add",path:n+"/"+vo(y),value:qr(e[y])})}}}o(Wb,"_generate");function sU(t,e,r){r===void 0&&(r=!1);var n=[];return Wb(t,e,n,"",r),n}o(sU,"compare");var r0=Object.assign({},jb,Jb,{JsonPatchError:tl,deepClone:qr,escapePathComponent:vo,unescapePathComponent:el});var zE=Pt(_c(),1);var KE=Pt(Da(),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=Pt(_c(),1);Pi();Pf();var m_={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function N$(t){let e=m_[t];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${t}`)}o(N$,"codeByName");function P$(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(P$,"nameByCode");var En=class{};o(En,"StreamType");En.nameByCode=P$;En.codeByName=N$;var gg=Pt(Zu(),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 p of n)ug.has(p)?ug.get(p).push(u):ug.set(p,[u]);if(e||a.length>0||r>0){let p;e===!0?p=a.map(S=>S.toString()).join("!"):e?p=e.apply(this,a):p=a[0];let v=`${p}__timestamp`,y=!1;if(r>0)if(!u.has(v))y=!0;else{let S=u.get(v);y=Date.now()-S>r}u.has(p)&&!y?c=u.get(p):(c=t.apply(this,a),u.set(p,c),r>0&&u.set(v,Date.now()))}else{let p=this;u.has(p)?c=u.get(p):(c=t.apply(this,a),u.set(p,c))}return c}}o(b_,"getNewFunction");Pi();Pf();cu();var mg=Pt(Zu(),1);function Ec(t){try{return t()}catch(e){return e}}o(Ec,"tryCatch");Pi();var lg=Pt(Zu(),1);Ea();function Za(t){let e=lg.default.decode(t),r=lg.default.decode.bytes,n=t.subarray(r);return[e,n,r]}o(Za,"readVarint");function L$(t){return t===0||t===1}o(L$,"isCidVersion");function hg(t){let[e,r]=Za(t);if(!L$(e))throw new Error(`Unknown CID version ${e}`);let[n,i]=Za(r),[,a,c]=Za(i),[u,,p]=Za(a),v=i.subarray(0,c+p+u),y=i.subarray(c+p+u);return[We.create(e,n,Mh(v)),y]}o(hg,"readCid");Pi();Pf();function Qa(t,e="StreamRef"){let[r,n]=Za(t);if(r!==206)throw new Error(`Invalid ${e}, does not include streamid codec`);let[i,a]=Za(n),c=hg(a),[u,p]=c;if(p.length===0)return{kind:"stream-id",type:i,genesis:u};if(p.length===1&&p[0]===0)return{kind:"commit-id",type:i,genesis:u,commit:null};{let[v]=hg(p);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(Qa,"fromBytes");var B$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Ac(t,e="StreamRef"){let r=B$.exec(t)||[],n=r[2];if(!n)throw new Error(`Malformed ${e} string: ${t}`);let i=Ni.decode(n),a=Qa(i),c=r[4];return c?{kind:"commit-id",type:a.type,genesis:a.genesis,commit:dg(a.genesis,c)}:a}o(Ac,"fromString");function U$(t){try{return typeof t=="string"?We.parse(t):We.asCID(t)}catch{return null}}o(U$,"parseCID");function dg(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(dg,"parseCommit");var sl=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)},l0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ni.encode(e)}: contains commit`)}};o(l0,"InvalidStreamIDBytesError");var h0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(h0,"InvalidStreamIDStringError");function y_(t){let e=Qa(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new l0(t)}o(y_,"fromBytes");function $$(t){return Ec(()=>y_(t))}o($$,"fromBytesNoThrow");function x_(t){let e=Ac(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new h0(t)}o(x_,"fromString");function F$(t){return Ec(()=>x_(t))}o(F$,"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 Ba({value:r,codec:Hi,hasher:As});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=$$;rt.fromString=x_;rt.fromStringNoThrow=F$;sl([zn(),Ei("design:type",String),Ei("design:paramtypes",[])],rt.prototype,"typeName",null);sl([zn(),Ei("design:type",Uint8Array),Ei("design:paramtypes",[])],rt.prototype,"bytes",null);sl([zn(),Ei("design:type",rt),Ei("design:paramtypes",[])],rt.prototype,"baseID",null);sl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toString",null);sl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toUrl",null);var Mc=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},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)},Sc,ef,al,d0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ni.encode(e)}: no commit information provided`)}};o(d0,"InvalidCommitIDBytesError");var p0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(p0,"InvalidCommitIDStringError");function __(t){let e=Qa(t,"CommitID");if(e.kind==="commit-id")return new Lt(e.type,e.genesis,e.commit);throw new d0(t)}o(__,"fromBytes");function q$(t){return Ec(()=>__(t))}o(q$,"fromBytesNoThrow");function E_(t){let e=Ac(t,"CommitID");if(e.kind==="commit-id")return new Lt(e.type,e.genesis,e.commit);throw new p0(t)}o(E_,"fromString");function H$(t){return Ec(()=>E_(t))}o(H$,"fromStringNoThrow");var w_=Symbol.for("@ceramicnetwork/streamid/CommitID");function z$(t,e){return new Lt(t.type,t.cid,e)}o(z$,"make");var Lt=class{constructor(e,r,n=null){if(this._tag=w_,Sc.set(this,void 0),ef.set(this,void 0),al.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");bg(this,Sc,typeof e=="string"?En.codeByName(e):e,"f"),bg(this,ef,typeof r=="string"?We.parse(r):r,"f"),bg(this,al,dg(is(this,ef,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===w_}get baseID(){return new rt(is(this,Sc,"f"),is(this,ef,"f"))}get type(){return is(this,Sc,"f")}get typeName(){return En.nameByCode(is(this,Sc,"f"))}get cid(){return is(this,ef,"f")}get commit(){return is(this,al,"f")||is(this,ef,"f")}get bytes(){let e=gg.default.encode(206),r=gg.default.encode(this.type),n=is(this,al,"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()}`}[(Sc=new WeakMap,ef=new WeakMap,al=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Lt,"CommitID");Lt.fromBytes=__;Lt.fromBytesNoThrow=q$;Lt.fromString=E_;Lt.fromStringNoThrow=H$;Lt.make=z$;Mc([zn(),An("design:type",rt),An("design:paramtypes",[])],Lt.prototype,"baseID",null);Mc([zn(),An("design:type",String),An("design:paramtypes",[])],Lt.prototype,"typeName",null);Mc([zn(),An("design:type",We),An("design:paramtypes",[])],Lt.prototype,"commit",null);Mc([zn(),An("design:type",Uint8Array),An("design:paramtypes",[])],Lt.prototype,"bytes",null);Mc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Lt.prototype,"toString",null);Mc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Lt.prototype,"toUrl",null);Pf();var fn;(function(t){function e(i){let a=Qa(i);switch(a.kind){case"commit-id":return new Lt(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=Ac(i);switch(a.kind){case"commit-id":return new Lt(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)||Lt.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 Y_=Pt(J_(),1),{__extends:Qr,__assign:hY,__rest:dY,__decorate:pY,__param:mY,__esDecorate:bY,__runInitializers:gY,__propKey:vY,__setFunctionName:yY,__metadata:xY,__awaiter:X_,__generator:v0,__exportStar:wY,__createBinding:_Y,__values:tf,__read:Kn,__spread:EY,__spreadArrays:AY,__spreadArray:Vi,__await:y0,__asyncGenerator:Z_,__asyncDelegator:SY,__asyncValues:Q_,__makeTemplateObject:MY,__importStar:TY,__importDefault:CY,__classPrivateFieldGet:kY,__classPrivateFieldSet:IY,__classPrivateFieldIn:DY}=Y_.default;function At(t){return typeof t=="function"}o(At,"isFunction");function Cc(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(Cc,"createErrorClass");var x0=Cc(function(t){return o(function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
814
|
+
`)}o(OL,"asString");var Wu=class extends Vu{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case Ju.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Wu,"SiweMessage");var zd=class extends Vu{toMessage(){return super.toMessage("Solana")}signMessage(){let e;switch(this.type){case Ju.PERSONAL_SIGNATURE:{e=new TextEncoder().encode(this.toMessage());break}default:{e=new TextEncoder().encode(this.toMessage());break}}return e}};o(zd,"SiwsMessage");var RL=5*60,NL=new Date("2022-09-20").valueOf(),Yu;(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(Jx({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 PL(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??RL)*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=[Cb(Wu.fromCacao(c).toMessage(),c.s.s).toLowerCase()];if(Date.parse(c.p.iat)<=NL){let D=Cb(DL(Wu.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})(Yu||(Yu={}));function PL(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=zd.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,q5.verify)(v,c,u))throw new Error("Signature does not belong to issuer")}o(PL,"verifySolanaSignature");var Xu;(function(t){function e(r){return Ua({value:r,codec:Hi,hasher:Ss})}o(e,"fromCacao"),t.fromCacao=e})(Xu||(Xu={}));$f();hu();var H5=Lt(Oa(),1);$f();function z5(){return kt((0,H5.randomBytes)(16),"base64")}o(z5,"randomString");var K5="base64pad",j5="base64url";function G5(t){return kt(t,K5)}o(G5,"encodeBase64");function V5(t){return kt(t,j5)}o(V5,"encodeBase64Url");function W5(t){return Ot(t,K5)}o(W5,"decodeBase64");function Kd(t){return JSON.parse(kt(Ot(t,j5)))}o(Kd,"base64urlToJSON");function J5(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(J5,"fromDagJWS");function Y5(t,e){if(e){let r=e.toISOString().split(".")[0]+"Z";return`${t}?versionTime=${r}`}else return t}o(Y5,"didWithTime");function X5(t){return t?Array.isArray(t)?t:[t]:[]}o(X5,"extractControllers");function LL(t){return"registry"in t&&"cache"in t}o(LL,"isResolver");var Va=class{constructor({provider:e,resolver:r={},resolverOptions:n,capability:i,parent:a}={}){if(e!=null&&(this._client=new fc(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 fc(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=LL(e)?e:new nu(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=z5(),a=await this._client.request("did_authenticate",{nonce:i,aud:n,paths:r}),{kid:c}=await this.verifyJWS(a),u=Kd(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 Xu.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 r4(e),a=V5(n.bytes);Object.assign(r,{linkedBlock:G5(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 Xu.fromCacao(this._capability);return{jws:c,linkedBlock:i,cacaoBlock:m.bytes}}return{jws:c,linkedBlock:i}}async verifyJWS(e,r={}){typeof e!="string"&&(e=J5(e));let n=Kd(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)Yu.verify(r.capability,{atTime:r.atTime?r.atTime:void 0,revocationPhaseOutSecs:r.revocationPhaseOutSecs});else if(r.issuer&&r.issuer!==c){let v=Y5(r.issuer,r.atTime),S=(await this.resolve(v)).didDocument?.controller,O=X5(S);if(r.capability?.s&&r.capability.p.aud===c&&O.includes(r.capability.p.iss))Yu.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||[];zx(e,u);let m;try{m=Kd(e.split(".")[1])}catch{}return{kid:n,payload:m,didResolutionResult:i}}async createJWE(e,r,n={}){let i=await Gx(r,this._resolver);return jx(e,i,n.protectedHeader,n.aad)}async createDagJWE(e,r,n={}){let i=await n4(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 W5(n)}async decryptDagJWE(e){let r=await this.decryptJWE(e);return i4(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 Z5(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(Z5,"toUint8Array");var Fb=Lt(Zu(),1);_h();var Db={};Jt(Db,{keyToDidDoc:()=>YL});function YL(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(YL,"keyToDidDoc");var Ob={};Jt(Ob,{keyToDidDoc:()=>ZL});$f();var f8=Lt(_u(),1);function XL(t){let e=new Uint8Array(t.length+2);return e[0]=236,e[1]=1,e.set(t,2),`z${kt(e,"base58btc")}`}o(XL,"encodeKey");function ZL(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=(0,f8.convertPublicKeyToX25519)(t),a=`${r}#${XL(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(ZL,"keyToDidDoc");var Bb={};Jt(Bb,{keyToDidDoc:()=>fB,pubKeyBytesToXY:()=>l8});var jd={};Jt(jd,{ECPointDecompress:()=>oB});function QL(t){return t>=0?t:-t}o(QL,"n");function eB(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(eB,"r");function Rb(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(Rb,"f");function tB(t,e){let r=eB(Rb(t,e),e);if(r.g!==1n)throw new RangeError(`${t.toString()} does not have inverse modulo ${e.toString()}`);return Rb(r.x,e)}o(tB,"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=Rb(t,r),e<0n)return tB(Wa(t,QL(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:()=>rB,publicKeyHexToUint8ArrayPointPair:()=>c8,publicKeyIntToUint8ArrayPointPair:()=>u8,publicKeyIntToXY:()=>iB,publicKeyToXY:()=>nB,testHexString:()=>Pb,testUint8Array:()=>Vs});Eh();function rB(t){if(!Vs(t))throw new TypeError("input must be a Uint8Array");return kt(t,"base16")}o(rB,"pubKeyBytesToHex");function nB(t){if(!Pb(t))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let e=c8(t),r=_a.encode(e.xOctet).slice(1),n=_a.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(nB,"publicKeyToXY");function c8(t){if(!Pb(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(c8,"publicKeyHexToUint8ArrayPointPair");function Pb(t){let e=/^[A-Fa-f0-9]+$/i;return!!(e.exec(t)!==null&&e.test(t)&&typeof t=="string")}o(Pb,"testHexString");function Vs(t){return t==null?!1:t.constructor===Uint8Array}o(Vs,"testUint8Array");function iB(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=u8(t),r=_a.encode(e.xOctet).slice(1),n=_a.encode(e.yOctet).slice(1);return{xm:r,ym:n}}o(iB,"publicKeyIntToXY");function u8(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(u8,"publicKeyIntToUint8ArrayPointPair");function oB(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(oB,"ECPointDecompress");var Gd={};Jt(Gd,{ECPointDecompress:()=>sB});function sB(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(sB,"ECPointDecompress");var Vd={};Jt(Vd,{ECPointDecompress:()=>aB});function aB(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(aB,"ECPointDecompress");function fB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=l8(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(fB,"keyToDidDoc");function l8(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=jd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(l8,"pubKeyBytesToXY");var Ub={};Jt(Ub,{keyToDidDoc:()=>cB,pubKeyBytesToXY:()=>h8});function cB(t,e){let r=`did:key:${e}`,n=`${r}#${e}`,i=h8(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(cB,"keyToDidDoc");function h8(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=Gd.ECPointDecompress(n);return vr.publicKeyIntToXY(i)}throw new Error("Unexpected pubKeyBytes")}o(h8,"pubKeyBytesToXY");var $b={};Jt($b,{keyToDidDoc:()=>uB,pubKeyBytesToXY:()=>d8});function uB(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-521",x:i.xm,y:i.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(uB,"keyToDidDoc");function d8(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=Vd.ECPointDecompress(r);return vr.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}o(d8,"pubKeyBytesToXY");var lB="application/did+ld+json",p8="application/did+json",hB={231:Db,237:Ob,4608:Bb,4609:Ub,4610:$b};function dB(){return{key:async(t,e,r,n)=>{let i=n.accept||p8,a={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let c=ui.decode(e.id),u=Fb.default.decode(c),m=c.slice(Fb.default.decode.bytes),v=await hB[u].keyToDidDoc(m,e.id);i===lB?(v["@context"]="https://w3id.org/did/v1",a.didDocument=v):i===p8?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(dB,"getResolver");var m8={getResolver:dB};var Wd=Lt(_u(),1);var w8=Lt(g8(),1);var pB="base64pad";function v8(t){return JSON.parse((0,w8.default)(t))}o(v8,"toStableObject");function mB(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(mB,"encodeDID");function y8(t){let[e,r,n]=t.split(".");return{payload:r,signatures:[{protected:e,signature:n}]}}o(y8,"toGeneralJWS");var x8=o(async(t,e,r,n={})=>{let i=`${e}#${e.split(":")[2]}`,a=Ux(r),c=v8(Object.assign(n,{kid:i,alg:"EdDSA"}));return Hx(typeof t=="string"?t:v8(t),a,c)},"sign"),bB={did_authenticate:async({did:t,secretKey:e},r)=>{let n=await x8({did:t,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},t,e);return y8(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 x8(r.payload,t,e,r.protected);return{jws:y8(i)}},did_decryptJWE:async({secretKey:t},e)=>{let r=Wx((0,Wd.convertSecretKeyToX25519)(t));try{let n=await Kx(e.jwe,r);return{cleartext:kt(n,pB)}}catch(n){throw new wn(-32e3,n.message)}}},Qu=class{constructor(e){let{secretKey:r,publicKey:n}=(0,Wd.generateKeyPairFromSeed)(e),i=mB(n),a=l4(bB);this._handle=async c=>await a({did:i,secretKey:r},c)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}};o(Qu,"Ed25519Provider");var qb={};Jt(qb,{JsonPatchError:()=>dr,_areEquals:()=>rl,applyOperation:()=>Ja,applyPatch:()=>t0,applyReducer:()=>wB,deepClone:()=>yB,getValueByPointer:()=>Qd,validate:()=>E8,validator:()=>e0});var gB=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)}}(),vB=Object.prototype.hasOwnProperty;function Yd(t,e){return vB.call(t,e)}o(Yd,"hasOwnProperty");function Xd(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)Yd(t,i)&&n.push(i);return n}o(Xd,"_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 Zd(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(Zd,"isInteger");function vo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(vo,"escapePathComponent");function el(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(el,"unescapePathComponent");function Jd(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)if(Jd(t[e]))return!0}else if(typeof t=="object"){for(var n=Xd(t),i=n.length,a=0;a<i;a++)if(Jd(t[n[a]]))return!0}}return!1}o(Jd,"hasUndefined");function _8(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(_8,"patchErrorMessageFormatter");var tl=function(t){gB(e,t);function e(r,n,i,a,c){var u=this.constructor,m=t.call(this,_8(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=_8(r,{name:n,index:i,operation:a,tree:c}),m}return o(e,"PatchError"),e}(Error);var dr=tl,yB=qr,vc={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=Qd(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=Qd(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:rl(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},xB={add:function(t,e,r){return Zd(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:vc.move,copy:vc.copy,test:vc.test,_get:vc._get};function Qd(t,e){if(e=="")return t;var r={op:"_get",path:e};return Ja(t,r),r.value}o(Qd,"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):e0(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=Qd(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=rl(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=e0;;){if(R=m[x],R&&R.indexOf("~")!=-1&&(R=el(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&&!Zd(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);Zd(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=xB[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=vc[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 t0(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(t0,"applyPatch");function wB(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(wB,"applyReducer");function e0(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(vc[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")&&Jd(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=E8([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(e0,"validator");function E8(t,e,r){try{if(!Array.isArray(t))throw new dr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)t0(qr(e),qr(t),r||!0);else{r=r||e0;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(E8,"validate");function rl(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(!rl(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],!rl(t[c],e[c]))return!1;return!0}return t!==t&&e!==e}o(rl,"_areEquals");var jb={};Jt(jb,{compare:()=>kB,generate:()=>Hb,observe:()=>CB,unobserve:()=>TB});var zb=new WeakMap,_B=function(){function t(e){this.observers=new Map,this.obj=e}return o(t,"Mirror"),t}(),EB=function(){function t(e,r){this.callback=e,this.observer=r}return o(t,"ObserverInfo"),t}();function AB(t){return zb.get(t)}o(AB,"getMirror");function SB(t,e){return t.observers.get(e)}o(SB,"getObserverFromMirror");function MB(t,e){t.observers.delete(e.callback)}o(MB,"removeObserverFromMirror");function TB(t,e){e.unobserve()}o(TB,"unobserve");function CB(t,e){var r=[],n,i=AB(t);if(!i)i=new _B(t),zb.set(t,i);else{var a=SB(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(){Hb(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(){Hb(n),clearTimeout(n.next),MB(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 EB(e,n)),n}o(CB,"observe");function Hb(t,e){e===void 0&&(e=!1);var r=zb.get(t.object);Kb(r.value,t.object,t.patches,"",e),t.patches.length&&t0(r.value,t.patches);var n=t.patches;return n.length>0&&(t.patches=[],t.callback&&t.callback(n)),n}o(Hb,"generate");function Kb(t,e,r,n,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var a=Xd(e),c=Xd(t),u=!1,m=!1,v=c.length-1;v>=0;v--){var x=c[v],S=t[x];if(Yd(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)?Kb(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];!Yd(t,x)&&e[x]!==void 0&&r.push({op:"add",path:n+"/"+vo(x),value:qr(e[x])})}}}o(Kb,"_generate");function kB(t,e,r){r===void 0&&(r=!1);var n=[];return Kb(t,e,n,"",r),n}o(kB,"compare");var r0=Object.assign({},qb,jb,{JsonPatchError:tl,deepClone:qr,escapePathComponent:vo,unescapePathComponent:el});var hE=Lt(Ec(),1);var dE=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 Tg=Lt(Ec(),1);Pi();Lf();var l_={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function n$(t){let e=l_[t];if(typeof e<"u")return e;throw new Error(`No stream type registered for name ${t}`)}o(n$,"codeByName");function i$(t){let e=Object.entries(l_).find(([,r])=>r===t);if(e)return e[0];throw new Error(`No stream type registered for index ${t}`)}o(i$,"nameByCode");var En=class{};o(En,"StreamType");En.nameByCode=i$;En.codeByName=n$;var dg=Lt(Zu(),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=h_(c.value,e,r,n);else if(c.get!=null)c.get=h_(c.get,e,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o(zn,"Memoize");var sg=new Map;function h_(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)sg.has(m)?sg.get(m).push(u):sg.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(h_,"getNewFunction");Pi();Lf();cu();var lg=Lt(Zu(),1);function Ac(t){try{return t()}catch(e){return e}}o(Ac,"tryCatch");Pi();var ag=Lt(Zu(),1);Aa();function Qa(t){let e=ag.default.decode(t),r=ag.default.decode.bytes,n=t.subarray(r);return[e,n,r]}o(Qa,"readVarint");function o$(t){return t===0||t===1}o(o$,"isCidVersion");function fg(t){let[e,r]=Qa(t);if(!o$(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,Mh(v)),x]}o(fg,"readCid");Pi();Lf();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=fg(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]=fg(m);return{kind:"commit-id",type:i,genesis:u,commit:v}}}o(ef,"fromBytes");var s$=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Sc(t,e="StreamRef"){let r=s$.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:cg(a.genesis,c)}:a}o(Sc,"fromString");function a$(t){try{return typeof t=="string"?We.parse(t):We.asCID(t)}catch{return null}}o(a$,"parseCID");function cg(t,e=null){if(!e||e==="0")return null;let r=a$(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(cg,"parseCommit");var sl=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)},l0=class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ni.encode(e)}: contains commit`)}};o(l0,"InvalidStreamIDBytesError");var h0=class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}};o(h0,"InvalidStreamIDStringError");function m_(t){let e=ef(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new l0(t)}o(m_,"fromBytes");function f$(t){return Ac(()=>m_(t))}o(f$,"fromBytesNoThrow");function b_(t){let e=Sc(t,"StreamID");if(e.kind==="stream-id")return new rt(e.type,e.genesis);throw new h0(t)}o(b_,"fromString");function c$(t){return Ac(()=>b_(t))}o(c$,"fromStringNoThrow");var p_=Symbol.for("@ceramicnetwork/streamid/StreamID"),rt=class{constructor(e,r){if(this._tag=p_,!(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===p_}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=lg.default.encode(206),r=lg.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=m_;rt.fromBytesNoThrow=f$;rt.fromString=b_;rt.fromStringNoThrow=c$;sl([zn(),Ei("design:type",String),Ei("design:paramtypes",[])],rt.prototype,"typeName",null);sl([zn(),Ei("design:type",Uint8Array),Ei("design:paramtypes",[])],rt.prototype,"bytes",null);sl([zn(),Ei("design:type",rt),Ei("design:paramtypes",[])],rt.prototype,"baseID",null);sl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toString",null);sl([zn(),Ei("design:type",Function),Ei("design:paramtypes",[]),Ei("design:returntype",String)],rt.prototype,"toUrl",null);var Tc=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)},hg=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)},Mc,tf,al,d0=class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ni.encode(e)}: no commit information provided`)}};o(d0,"InvalidCommitIDBytesError");var p0=class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}};o(p0,"InvalidCommitIDStringError");function v_(t){let e=ef(t,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new d0(t)}o(v_,"fromBytes");function u$(t){return Ac(()=>v_(t))}o(u$,"fromBytesNoThrow");function y_(t){let e=Sc(t,"CommitID");if(e.kind==="commit-id")return new Pt(e.type,e.genesis,e.commit);throw new p0(t)}o(y_,"fromString");function l$(t){return Ac(()=>y_(t))}o(l$,"fromStringNoThrow");var g_=Symbol.for("@ceramicnetwork/streamid/CommitID");function h$(t,e){return new Pt(t.type,t.cid,e)}o(h$,"make");var Pt=class{constructor(e,r,n=null){if(this._tag=g_,Mc.set(this,void 0),tf.set(this,void 0),al.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");hg(this,Mc,typeof e=="string"?En.codeByName(e):e,"f"),hg(this,tf,typeof r=="string"?We.parse(r):r,"f"),hg(this,al,cg(is(this,tf,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===g_}get baseID(){return new rt(is(this,Mc,"f"),is(this,tf,"f"))}get type(){return is(this,Mc,"f")}get typeName(){return En.nameByCode(is(this,Mc,"f"))}get cid(){return is(this,tf,"f")}get commit(){return is(this,al,"f")||is(this,tf,"f")}get bytes(){let e=dg.default.encode(206),r=dg.default.encode(this.type),n=is(this,al,"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()}`}[(Mc=new WeakMap,tf=new WeakMap,al=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Pt,"CommitID");Pt.fromBytes=v_;Pt.fromBytesNoThrow=u$;Pt.fromString=y_;Pt.fromStringNoThrow=l$;Pt.make=h$;Tc([zn(),An("design:type",rt),An("design:paramtypes",[])],Pt.prototype,"baseID",null);Tc([zn(),An("design:type",String),An("design:paramtypes",[])],Pt.prototype,"typeName",null);Tc([zn(),An("design:type",We),An("design:paramtypes",[])],Pt.prototype,"commit",null);Tc([zn(),An("design:type",Uint8Array),An("design:paramtypes",[])],Pt.prototype,"bytes",null);Tc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Pt.prototype,"toString",null);Tc([zn(),An("design:type",Function),An("design:paramtypes",[]),An("design:returntype",String)],Pt.prototype,"toUrl",null);Lf();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=Sc(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 pg=o(function(t,e){return pg=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])},pg(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");pg(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 x_(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(x_,"__awaiter");function m0(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(m0,"__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 w_(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(w_,"__asyncGenerator");function __(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(__,"__asyncValues");function At(t){return typeof t=="function"}o(At,"isFunction");function Cc(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(Cc,"createErrorClass");var b0=Cc(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 rf(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}o(rf,"arrRemove");var Ws=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=tf(c),p=u.next();!p.done;p=u.next()){var v=p.value;v.remove(this)}}catch(N){e={error:N}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}else c.remove(this);var y=this.initialTeardown;if(At(y))try{y()}catch(N){a=N instanceof x0?N.errors:[N]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var O=tf(S),R=O.next();!R.done;R=O.next()){var I=R.value;try{eE(I)}catch(N){a=a??[],N instanceof x0?a=Vi(Vi([],Kn(a)),Kn(N.errors)):a.push(N)}}}catch(N){n={error:N}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(n)throw n.error}}}if(a)throw new x0(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)eE(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)&&rf(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&rf(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();var yg=Ws.EMPTY;function w0(t){return t instanceof Ws||t&&"closed"in t&&At(t.remove)&&At(t.add)&&At(t.unsubscribe)}o(w0,"isSubscription");function eE(t){At(t)?t():t.unsubscribe()}o(eE,"execFinalizer");var Wi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var kc={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=kc.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=kc.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function _0(t){kc.setTimeout(function(){var e=Wi.onUnhandledError;if(e)e(t);else throw t})}o(_0,"reportUnhandledError");function xg(){}o(xg,"noop");var tE=function(){return wg("C",void 0,void 0)}();function rE(t){return wg("E",void 0,t)}o(rE,"errorNotification");function nE(t){return wg("N",t,void 0)}o(nE,"nextNotification");function wg(t,e,r){return{kind:t,value:e,error:r}}o(wg,"createNotification");var nf=null;function Ic(t){if(Wi.useDeprecatedSynchronousErrorHandling){var e=!nf;if(e&&(nf={errorThrown:!1,error:null}),t(),e){var r=nf,n=r.errorThrown,i=r.error;if(nf=null,n)throw i}}else t()}o(Ic,"errorContext");function iE(t){Wi.useDeprecatedSynchronousErrorHandling&&nf&&(nf.errorThrown=!0,nf.error=t)}o(iE,"captureError");var fl=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,w0(r)&&r.add(n)):n.destination=V$,n}return o(e,"Subscriber"),e.create=function(r,n,i){return new A0(r,n,i)},e.prototype.next=function(r){this.isStopped?Eg(nE(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?Eg(rE(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?Eg(tE,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}(Ws);var K$=Function.prototype.bind;function _g(t,e){return K$.call(t,e)}o(_g,"bind");var j$=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){E0(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){E0(n)}else E0(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){E0(r)}},t}(),A0=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 j$(c),a}return o(e,"SafeSubscriber"),e}(fl);function E0(t){Wi.useDeprecatedSynchronousErrorHandling?iE(t):_0(t)}o(E0,"handleUnhandledError");function G$(t){throw t}o(G$,"defaultErrorHandler");function Eg(t,e){var r=Wi.onStoppedNotification;r&&kc.setTimeout(function(){return r(t,e)})}o(Eg,"handleStoppedNotification");var V$={closed:!0,next:xg,error:G$,complete:xg};var Dc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Oc(t){return t}o(Oc,"identity");function oE(t){return t.length===0?Oc:t.length===1?t[0]:o(function(r){return t.reduce(function(n,i){return i(n)},r)},"piped")}o(oE,"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=J$(e)?e:new A0(e,r,n);return Ic(function(){var c=i,u=c.operator,p=c.source;a.add(u?u.call(a,p):p?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=sE(r),new r(function(i,a){var c=new A0({next:function(u){try{e(u)}catch(p){a(p),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[Dc]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return oE(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=sE(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 sE(t){var e;return(e=t??Wi.Promise)!==null&&e!==void 0?e:Promise}o(sE,"getPromiseCtor");function W$(t){return t&&At(t.next)&&At(t.error)&&At(t.complete)}o(W$,"isObserver");function J$(t){return t&&t instanceof fl||W$(t)&&w0(t)}o(J$,"isSubscriber");function Y$(t){return At(t?.lift)}o(Y$,"hasLift");function Dr(t){return function(e){if(Y$(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 X$(t,e,r,n,i)}o(Or,"createOperatorSubscriber");var X$=function(t){Qr(e,t);function e(r,n,i,a,c,u){var p=t.call(this,r)||this;return p.onFinalize=c,p.shouldUnsubscribe=u,p._next=n?function(v){try{n(v)}catch(y){r.error(y)}}:t.prototype._next,p._error=a?function(v){try{a(v)}catch(y){r.error(y)}finally{this.unsubscribe()}}:t.prototype._error,p._complete=i?function(){try{i()}catch(v){r.error(v)}finally{this.unsubscribe()}}:t.prototype._complete,p}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}(fl);var aE=Cc(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 fE(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new aE},e.prototype.next=function(r){var n=this;Ic(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=tf(n.currentObservers),u=c.next();!u.done;u=c.next()){var p=u.value;p.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;Ic(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;Ic(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 Ws(function(){n.currentObservers=null,rf(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 fE(r,n)},e}(Wt);var fE=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 cE=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}(Ws);var cl={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=cl.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=cl.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var uE=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),cl.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&&cl.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,rf(a,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(cE);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 lE=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 Z$=new lE(uE),hE=Z$;var S0=new Wt(function(t){return t.complete()});function M0(t){return t&&At(t.schedule)}o(M0,"isScheduler");function dE(t){return t[t.length-1]}o(dE,"last");function pE(t){return M0(dE(t))?t.pop():void 0}o(pE,"popScheduler");function mE(t,e){return typeof dE(t)=="number"?t.pop():e}o(mE,"popNumber");var Rc=o(function(t){return t&&typeof t.length=="number"&&typeof t!="function"},"isArrayLike");function T0(t){return At(t?.then)}o(T0,"isPromise");function C0(t){return At(t[Dc])}o(C0,"isInteropObservable");function k0(t){return Symbol.asyncIterator&&At(t?.[Symbol.asyncIterator])}o(k0,"isAsyncIterable");function I0(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(I0,"createInvalidObservableTypeError");function Q$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Q$,"getSymbolIterator");var D0=Q$();function O0(t){return At(t?.[D0])}o(O0,"isIterable");function R0(t){return Z_(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,y0(r.read())];case 3:return n=c.sent(),i=n.value,a=n.done,a?[4,y0(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,y0(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(R0,"readableStreamLikeToAsyncGenerator");function N0(t){return At(t?.getReader)}o(N0,"isReadableStreamLike");function en(t){if(t instanceof Wt)return t;if(t!=null){if(C0(t))return eF(t);if(Rc(t))return tF(t);if(T0(t))return rF(t);if(k0(t))return bE(t);if(O0(t))return nF(t);if(N0(t))return iF(t)}throw I0(t)}o(en,"innerFrom");function eF(t){return new Wt(function(e){var r=t[Dc]();if(At(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(eF,"fromInteropObservable");function tF(t){return new Wt(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}o(tF,"fromArrayLike");function rF(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,_0)})}o(rF,"fromPromise");function nF(t){return new Wt(function(e){var r,n;try{for(var i=tf(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(nF,"fromIterable");function bE(t){return new Wt(function(e){oF(t,e).catch(function(r){return e.error(r)})})}o(bE,"fromAsyncIterable");function iF(t){return bE(R0(t))}o(iF,"fromReadableStreamLike");function oF(t,e){var r,n,i,a;return X_(this,void 0,void 0,function(){var c,u;return v0(this,function(p){switch(p.label){case 0:p.trys.push([0,5,6,11]),r=Q_(t),p.label=1;case 1:return[4,r.next()];case 2:if(n=p.sent(),!!n.done)return[3,4];if(c=n.value,e.next(c),e.closed)return[2];p.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=p.sent(),i={error:u},[3,11];case 6:return p.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:p.sent(),p.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(oF,"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 P0(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(P0,"observeOn");function L0(t,e){return e===void 0&&(e=0),Dr(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}o(L0,"subscribeOn");function gE(t,e){return en(t).pipe(L0(e),P0(e))}o(gE,"scheduleObservable");function vE(t,e){return en(t).pipe(L0(e),P0(e))}o(vE,"schedulePromise");function yE(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(yE,"scheduleArray");function xE(t,e){return new Wt(function(r){var n;return Ai(r,e,function(){n=t[D0](),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(xE,"scheduleIterable");function B0(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(B0,"scheduleAsyncIterable");function wE(t,e){return B0(R0(t),e)}o(wE,"scheduleReadableStreamLike");function _E(t,e){if(t!=null){if(C0(t))return gE(t,e);if(Rc(t))return yE(t,e);if(T0(t))return vE(t,e);if(k0(t))return B0(t,e);if(O0(t))return xE(t,e);if(N0(t))return wE(t,e)}throw I0(t)}o(_E,"scheduled");function EE(t,e){return e?_E(t,e):en(t)}o(EE,"from");var U0=Cc(function(t){return o(function(){t(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function AE(t){return t instanceof Date&&!isNaN(t)}o(AE,"isValidDate");function $0(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){n.next(t.call(e,a,i++))}))})}o($0,"map");var sF=Array.isArray;function aF(t,e){return sF(e)?t.apply(void 0,Vi([],Kn(e))):t(e)}o(aF,"callOrApply");function SE(t){return $0(function(e){return aF(t,e)})}o(SE,"mapOneOrManyArgs");function ME(t,e,r,n,i,a,c,u){var p=[],v=0,y=0,S=!1,O=o(function(){S&&!p.length&&!v&&e.complete()},"checkComplete"),R=o(function(N){return v<n?I(N):p.push(N)},"outerNext"),I=o(function(N){a&&e.next(N),v++;var J=!1;en(r(N,y++)).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 V=p.shift();c?Ai(e,c,function(){return I(V)}):I(V)},"_loop_1");p.length&&v<n;)L();O()}catch(V){e.error(V)}}))},"doInnerSub");return t.subscribe(Or(e,R,function(){S=!0,O()})),function(){u?.()}}o(ME,"mergeInternals");function ul(t,e,r){return r===void 0&&(r=1/0),At(e)?ul(function(n,i){return $0(function(a,c){return e(n,a,i,c)})(en(t(n,i)))},r):(typeof e=="number"&&(r=e),Dr(function(n,i){return ME(n,i,t,r)}))}o(ul,"mergeMap");function TE(t){return t===void 0&&(t=1/0),ul(Oc,t)}o(TE,"mergeAll");var fF=["addListener","removeListener"],cF=["addEventListener","removeEventListener"],uF=["on","off"];function ll(t,e,r,n){if(At(r)&&(n=r,r=void 0),n)return ll(t,e,r).pipe(SE(n));var i=Kn(dF(t)?cF.map(function(u){return function(p){return t[u](e,p,r)}}):lF(t)?fF.map(CE(t,e)):hF(t)?uF.map(CE(t,e)):[],2),a=i[0],c=i[1];if(!a&&Rc(t))return ul(function(u){return ll(u,e,r)})(en(t));if(!a)throw new TypeError("Invalid event target");return new Wt(function(u){var p=o(function(){for(var v=[],y=0;y<arguments.length;y++)v[y]=arguments[y];return u.next(1<v.length?v:v[0])},"handler");return a(p),function(){return c(p)}})}o(ll,"fromEvent");function CE(t,e){return function(r){return function(n){return t[r](e,n)}}}o(CE,"toCommonHandlerRegistry");function lF(t){return At(t.addListener)&&At(t.removeListener)}o(lF,"isNodeStyleEventEmitter");function hF(t){return At(t.on)&&At(t.off)}o(hF,"isJQueryStyleEventEmitter");function dF(t){return At(t.addEventListener)&&At(t.removeEventListener)}o(dF,"isEventTarget");function hl(t,e,r){t===void 0&&(t=0),r===void 0&&(r=hE);var n=-1;return e!=null&&(M0(e)?r=e:n=e),new Wt(function(i){var a=AE(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(hl,"timer");function Cg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=pE(t),n=mE(t,1/0),i=t;return i.length?i.length===1?en(i[0]):TE(n)(EE(i,r)):S0}o(Cg,"merge");function kE(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(kE,"filter");function IE(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(IE,"defaultIfEmpty");function DE(t){return t<=0?function(){return S0}:Dr(function(e,r){var n=0;e.subscribe(Or(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}o(DE,"take");function OE(t){return t===void 0&&(t=pF),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 pF(){return new U0}o(pF,"defaultErrorFactory");function kg(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?kE(function(i,a){return t(i,a,n)}):Oc,DE(1),r?IE(e):OE(function(){return new U0}))}}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,p=u===void 0?!1:u,v=!1,y=null,S=null,O=!1,R=o(function(){S?.unsubscribe(),S=null,p&&(J(),O&&n.complete())},"endThrottling"),I=o(function(){S=null,O&&n.complete()},"cleanupThrottling"),N=o(function(L){return S=en(t(L)).subscribe(Or(n,R,I))},"startThrottle"),J=o(function(){if(v){v=!1;var L=y;y=null,n.next(L),!O&&N(L)}},"send");r.subscribe(Or(n,function(L){v=!0,y=L,!(S&&!S.closed)&&(c?J():N(L))},function(){O=!0,!(p&&v&&S&&!S.closed)&&n.complete()}))})}o(Ig,"throttle");var RE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(RE||(RE={}));var dl;(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"})(dl||(dl={}));var Og;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(Og||(Og={}));var os=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 Lt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Lt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Og.ANCHOR).map(({cid:e})=>Lt.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(os,"Stream");function Nc(){return t=>{}}o(Nc,"StreamStatic");var $E=Pt(LE(),1);function BE(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=>ll(r,"abort"))).pipe(kg()).subscribe(()=>{e.abort()}),e.signal)}o(BE,"mergeAbortSignals");var pl=class{constructor(e){let r=new AbortController;if(this.signal=r.signal,e<=0){r.abort();return}this._subscription=hl(e).subscribe(()=>{r.abort()})}clear(){this._subscription?.unsubscribe()}};o(pl,"TimedAbortSignal");async function UE(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(UE,"abortable");var mF=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||mF,n=new pl(r),i=e.signal?BE([e.signal,n.signal]):n.signal,a=await UE(i,c=>(0,$E.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 ml=Pt(_c(),1);Pi();function as(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(as,"toCID");var FE=0,Xt=class{static streamIdFromState(e){return new rt(e.type,e.log[0].cid)}static serializeCommit(e){let r=(0,ml.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,ml.default)(e);return Xt.isSignedCommitContainer(r)?(r.jws.link=as(r.jws.link),r.linkedBlock=Ot(r.linkedBlock,"base64"),r.cacaoBlock&&(r.cacaoBlock=Ot(r.cacaoBlock,"base64")),r):(Xt.isSignedCommit(r)&&(r.link=as(r.link)),Xt.isAnchorCommit(r)&&(r.proof=as(r.proof)),r.id&&(r.id=as(r.id)),r.prev&&(r.prev=as(r.prev)),r.header?.model&&(r.header.model=Ot(r.header.model,"base64")),r)}static serializeState(e){let r=(0,ml.default)(e);return r.log=r.log.map(n=>({...n,cid:n.cid.toString()})),r.anchorStatus!=null&&(r.anchorStatus=dl[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!=FE&&(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,ml.default)(e);return r.doctype&&(r.type=En.codeByName(r.doctype),delete r.doctype),r.log=r.log.map(n=>({...n,cid:as(n.cid)})),r.anchorProof&&(r.anchorProof.txHash=as(r.anchorProof.txHash),r.anchorProof.root=as(r.anchorProof.root)),r.anchorStatus&&(r.anchorStatus=dl[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!=FE&&(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 bl=class extends Sg{next(e){let r=this.value;Xt.statesEqual(r,e)||super.next(e)}};o(bl,"StreamStateSubject");var bF=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},gF={sync:yr.PREFER_CACHE},qE={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Ng(t,e){if(typeof t?.schema=="string")try{Lt.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,KE.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 HE(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(HE,"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 os{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,zE.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={...gF,...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={...qE,...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={...qE,...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=r0.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 HE(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 Fa(c),c}let a={data:r,header:i};return jn._signDagJWS(e,a)}static async _signDagJWS(e,r){return(await HE(e)).createDagJWS(r)}},"TileDocument");Gn.STREAM_TYPE_NAME="tile";Gn.STREAM_TYPE_ID=0;Gn=jn=bF([Nc()],Gn);var XE=Pt(VE(),1);function TF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(TF,"_checkPrivateRedeclaration");function CF(t,e){return e.get?e.get.call(t):e.value}o(CF,"_classApplyDescriptorGet");function kF(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(kF,"_classApplyDescriptorSet");function YE(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(YE,"_classExtractFieldDescriptor");function $g(t,e){var r=YE(t,e,"get");return CF(t,r)}o($g,"_classPrivateFieldGet");function WE(t,e,r){TF(t,e),e.set(t,r)}o(WE,"_classPrivateFieldInit");function JE(t,e,r){var n=YE(t,e,"set");return kF(t,n,r),r}o(JE,"_classPrivateFieldSet");function IF(t){return typeof t=="string"||Lt.isInstance(t)||rt.isInstance(t)?{streamId:t}:{streamId:t.streamId,genesis:t.genesis}}o(IF,"keyToQuery");function Fg(t){return typeof t=="string"?fn.from(t).toString():Lt.isInstance(t)||rt.isInstance(t)?t.toString():t.streamId.toString()}o(Fg,"keyToString");async function DF(t){let e=await Gn.makeGenesis({},null,{...t,deterministic:!0}),r=await rt.fromGenesis("tile",e);return{genesis:e,streamId:r}}o(DF,"getDeterministicQuery");var OF=o(()=>Promise.resolve([]),"tempBatchLoadFn"),q0=new WeakMap,qg=new WeakMap,gl=class extends XE.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,q0),e,r,n);return this.cache(i),i}async deterministic(e,r){let n=await DF(e);try{return await super.load(n)}catch{let a=await Gn.createFromGenesis($g(this,q0),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(OF,{cache:!0,cacheKeyFn:Fg,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),WE(this,q0,{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(IF),e.multiqueryTimeout);return r.map(i=>{let a=Fg(i),c=n[a];return c||new Error(`Failed to load stream: ${a}`)})},JE(this,q0,e.ceramic),JE(this,qg,!!e.cache)}};o(gl,"TileLoader");function Hg(t){return typeof t=="string"?rt.fromString(t):t}o(Hg,"typeStreamID");function ZE(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(ZE,"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=hl(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 bl(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=ZE(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 of;(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"})(of||(of={}));var Kg=Pt(_c(),1);var QE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(QE||(QE={}));var jg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(jg||(jg={}));var vl=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 Lt.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Lt.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===jg.ANCHOR).map(({cid:e})=>Lt.make(this.id,e))}get state(){return(0,Kg.default)(this.state$.value)}async sync(e={}){e={sync:of.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(vl,"Stream");function e9(){return t=>{}}o(e9,"StreamStatic");function t9(t){if(typeof t=="string"&&t.includes("@")){let[e,r]=t.split("@");if(!e||!r)throw new Error("Invalid accountId provided");return new Hs({address:e,chainId:r})}return new Hs(t)}o(t9,"normalizeAccountId");var RF="(?:%[0-9a-fA-F]{2})",r9=`(?:[a-zA-Z0-9._-]|${RF})`,NF="([a-z0-9]+)",PF=`((?:${r9}*:)*(${r9}+))`,n9="[a-zA-Z0-9_.:%-]",LF=`;${n9}+=${n9}*`,BF=`((${LF})*)`,UF="(/[^#?]*)?",$F="([?][^#]*)?",FF="(#.*)?",qF=new RegExp(`^did:${NF}:${PF}${BF}${UF}${$F}${FF}$`);function i9(t){if(t===""||!t)return null;let e=t.match(qF);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(i9,"parse");var s9=Pt(_c(),1),HF=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},sf,Gg=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),o9={anchor:!1,publish:!0,sync:of.PREFER_CACHE},Vg={anchor:!0,publish:!0},zF={sync:of.PREFER_CACHE},af=sf=o(class extends vl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,s9.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(e,r,n={}){n={...o9,...n};let i=t9(r),a=sf.makeGenesis(i);return sf.fromGenesis(e,a,n)}static async fromGenesis(e,r,n={}){return n={...o9,...n},e.createStreamFromGenesis(sf.STREAM_TYPE_ID,r,n)}async setDid(e,r,n={}){n={...Vg,...n};let i=typeof e=="string"?e.trim():e.id;if(i9(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={...zF,...n};let i=fn.from(r);if(i.type!=sf.STREAM_TYPE_ID)throw new Error(`StreamID ${i.toString()} does not refer to a '${sf.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");af.STREAM_TYPE_NAME="caip10-link";af.STREAM_TYPE_ID=1;af=sf=HF([e9()],af);Pi();Ea();var H9=Pt(F9(),1),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},yo,Bq={sync:yr.PREFER_CACHE};async function q9(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(q9,"_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 Js=yo=o(class extends os{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={...Bq,...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 q9(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 q9(e),e.did.createDagJWS(r)}},"Model");Js.STREAM_TYPE_NAME="model";Js.STREAM_TYPE_ID=2;Js.MODEL=function(){let t=Fa("model-v1"),e=H9.default.encode(t,"identity"),r=qo(sc,e),n=We.createV1(sc,r);return new rt("UNLOADABLE",n)}();Js=yo=Lq([Nc()],Js);var j9=Pt(Da(),1);var $q=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,Fq={anchor:!0,publish:!0,pin:!0,sync:yr.NEVER_SYNC,syncTimeoutSeconds:0},qq={anchor:!1,publish:!1,pin:!0,sync:yr.PREFER_CACHE},Hq={sync:yr.PREFER_CACHE},z9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function K9(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(K9,"_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 cf=Ji=o(class extends os{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={...Fq,...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={...qq,...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={...Hq,...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={...z9,...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={...z9,...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:r0.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?(Fa(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 K9(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,j9.randomBytes)(12)),{data:r,header:a}}static async _signDagJWS(e,r){return await K9(e),e.did.createDagJWS(r)}},"ModelInstanceDocument");cf.STREAM_TYPE_NAME="MID";cf.STREAM_TYPE_ID=3;cf=Ji=$q([Nc()],cf);var wl=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(wl,"RemotePinApi");var _l=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(_l,"RemoteIndexApi");var El=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(El,"RemoteAdminApi");var zq="/api/v0/",Kq="http://localhost:7007",jq={syncInterval:5e3},Gq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},Vq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},G9={sync:yr.PREFER_CACHE},Al=class{constructor(e=Kq,r={}){this._config={...jq,...r},this._apiUrl=new URL(zq,e),this._streamCache=new Map,this.context={api:this},this.pin=new wl(this._apiUrl),this.index=new _l(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new El(this._apiUrl,n),this._streamConstructors={[af.STREAM_TYPE_ID]:af,[Js.STREAM_TYPE_ID]:Js,[cf.STREAM_TYPE_ID]:cf,[Gn.STREAM_TYPE_ID]:Gn}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,r,n={}){n={...Vq,...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[p,v]=u,y=Xt.deserializeState(v),S=new tn(y,this._apiUrl,this._config.syncInterval);return c[p]=this.buildStreamFromDocument(S),c},{})}loadStreamCommits(e){let r=Hg(e);return tn.loadStreamCommits(r,this._apiUrl)}async applyCommit(e,r,n={}){n={...Gq,...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={...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(Al,"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"]),Ys=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"]),Wq=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,p=0;for(;p<c.path.length;){let v=c.path[p];p===c.path.length-1?(u[v]=u[v]||{_errors:[]},u[v]._errors.push(r(c))):u[v]=u[v]||{_errors:[]},u=u[v],p++}}},"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 Ml=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"),Y9=Ml;function Jq(t){Y9=t}o(Jq,"setErrorMap");function V0(){return Y9}o(V0,"getErrorMap");var W0=o(t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],c={...i,path:a},u="",p=n.filter(v=>!!v).slice().reverse();for(let v of p)u=v(c,{data:e,defaultError:u}).message;return{...i,path:a,message:i.message||u}},"makeIssue"),Yq=[];function Ke(t,e){let r=W0({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,V0(),Ml].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"}),X9=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"),J0=o(t=>t.status==="valid","isValid"),Y0=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(J0(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 Ys(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ys(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:Ys(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Y0(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:Ys(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:Ys(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Y0(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(p=>p?!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 ls.create(this)}or(e){return ta.create([this,e])}and(e){return ra.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 fa({innerType:this,defaultValue:r,typeName:pt.ZodDefault})}brand(){return new Sl({typeName:pt.ZodBranded,type:this,...Tt(void 0)})}catch(e){let r=typeof e=="function"?e:()=>e;return new pf({innerType:this,defaultValue:r,typeName:pt.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ca.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(xt,"ZodType");var Xq=/^c[^\s-]{8,}$/i,Zq=/^([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,Qq=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,eH=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")Qq.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")Zq.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")Xq.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"?eH(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 tH(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(tH,"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"?tH(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 Xs=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(Xs,"ZodBigInt");Xs.create=t=>{var e;return new Xs({typeName:pt.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tt(t)})};var Zs=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(Zs,"ZodBoolean");Zs.create=t=>new Zs({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 uf=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(uf,"ZodSymbol");uf.create=t=>new uf({typeName:pt.ZodSymbol,...Tt(t)});var Qs=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(Qs,"ZodUndefined");Qs.create=t=>new Qs({typeName:pt.ZodUndefined,...Tt(t)});var ea=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(ea,"ZodNull");ea.create=t=>new ea({typeName:pt.ZodNull,...Tt(t)});var cs=class extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return rn(e.data)}};o(cs,"ZodAny");cs.create=t=>new cs({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 lf=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(lf,"ZodVoid");lf.create=t=>new lf({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 X0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(X0||(X0={}));var W9=o(t=>e=>new er({...t,shape:()=>({...t.shape(),...e})}),"AugmentFactory");function $c(t){if(t instanceof er){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Jn.create($c(n))}return new er({...t._def,shape:()=>e})}else return t instanceof Sn?Sn.create($c(t.element)):t instanceof Jn?Jn.create($c(t.unwrap())):t instanceof Eo?Eo.create($c(t.unwrap())):t instanceof Wn?Wn.create(t.items.map(e=>$c(e))):t}o($c,"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 p=[];for(let v of c){let y=a[v],S=i.data[v];p.push({key:{status:"valid",value:v},value:y._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 y of u)p.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});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 y of u){let S=i.data[y];p.push({key:{status:"valid",value:y},value:v._parse(new Vn(i,S,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let v=[];for(let y of p){let S=await y.key;v.push({key:S,value:await y.value,alwaysSet:y.alwaysSet})}return v}).then(v=>Rr.mergeObjectSync(n,v)):Rr.mergeObjectSync(n,p)}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 p=(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:p}:{message:p}}}:{}})}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:()=>X0.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 $c(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 Z9(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 ta=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 p of n){let v={...r,common:{...r.common,issues:[]},parent:null},y=p._parseSync({data:r.data,path:r.path,parent:v});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,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(p=>new Si(p));return Ke(r,{code:Ne.invalid_union,unionErrors:u}),gt}}get options(){return this._def.options}};o(ta,"ZodUnion");ta.create=(t,e)=>new ta({options:t,typeName:pt.ZodUnion,...Tt(e)});var G0=o(t=>t instanceof ia?G0(t.schema):t instanceof Mn?G0(t.innerType()):t instanceof oa?[t.value]:t instanceof sa?t.options:t instanceof aa?Object.keys(t.enum):t instanceof fa?G0(t._def.innerType):t instanceof Qs?[void 0]:t instanceof ea?[null]:null,"getDiscriminator"),hf=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=G0(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 hf({typeName:pt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Tt(n)})}};o(hf,"ZodDiscriminatedUnion");function Qg(t,e){let r=Ys(t),n=Ys(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 p=Qg(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.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],p=Qg(c,u);if(!p.valid)return{valid:!1};i.push(p.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 ra=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(ra,"ZodIntersection");ra.create=(t,e,r)=>new ra({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 p=this._def.items[u]||this._def.rest;return p?p._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 na=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 na({keyType:e,valueType:r,typeName:pt.ZodRecord,...Tt(n)}):new na({keyType:Mi.create(),valueType:e,typeName:pt.ZodRecord,...Tt(r)})}};o(na,"ZodRecord");var df=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,p],v)=>({key:i._parse(new Vn(n,u,n.path,[v,"key"])),value:a._parse(new Vn(n,p,n.path,[v,"value"]))}));if(n.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let p of c){let v=await p.key,y=await p.value;if(v.status==="aborted"||y.status==="aborted")return gt;(v.status==="dirty"||y.status==="dirty")&&r.dirty(),u.set(v.value,y.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let p of c){let v=p.key,y=p.value;if(v.status==="aborted"||y.status==="aborted")return gt;(v.status==="dirty"||y.status==="dirty")&&r.dirty(),u.set(v.value,y.value)}return{status:r.value,value:u}}}};o(df,"ZodMap");df.create=(t,e,r)=>new df({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(p){let v=new Set;for(let y of p){if(y.status==="aborted")return gt;y.status==="dirty"&&r.dirty(),v.add(y.value)}return{status:r.value,value:v}}o(c,"finalizeSet");let u=[...n.data.values()].map((p,v)=>a._parse(new Vn(n,p,n.path,v)));return n.common.async?Promise.all(u).then(p=>c(p)):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 us=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,p){return W0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,V0(),Ml].filter(v=>!!v),issueData:{code:Ne.invalid_arguments,argumentsError:p}})}o(n,"makeArgsIssue");function i(u,p){return W0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,V0(),Ml].filter(v=>!!v),issueData:{code:Ne.invalid_return_type,returnTypeError:p}})}o(i,"makeReturnsIssue");let a={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof ls?rn(async(...u)=>{let p=new Si([]),v=await this._def.args.parseAsync(u,a).catch(O=>{throw p.addIssue(n(u,O)),p}),y=await c(...v);return await this._def.returns._def.type.parseAsync(y,a).catch(O=>{throw p.addIssue(i(y,O)),p})}):rn((...u)=>{let p=this._def.args.safeParse(u,a);if(!p.success)throw new Si([n(u,p.error)]);let v=c(...p.data),y=this._def.returns.safeParse(v,a);if(!y.success)throw new Si([i(v,y.error)]);return y.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new us({...this._def,args:Wn.create(e).rest(wo.create())})}returns(e){return new us({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new us({args:e||Wn.create([]).rest(wo.create()),returns:r||wo.create(),typeName:pt.ZodFunction,...Tt(n)})}};o(us,"ZodFunction");var ia=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(ia,"ZodLazy");ia.create=(t,e)=>new ia({getter:t,typeName:pt.ZodLazy,...Tt(e)});var oa=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(oa,"ZodLiteral");oa.create=(t,e)=>new oa({value:t,typeName:pt.ZodLiteral,...Tt(e)});function Z9(t,e){return new sa({values:t,typeName:pt.ZodEnum,...Tt(e)})}o(Z9,"createZodEnum");var sa=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(sa,"ZodEnum");sa.create=Z9;var aa=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(aa,"ZodNativeEnum");aa.create=(t,e)=>new aa({values:t,typeName:pt.ZodNativeEnum,...Tt(e)});var ls=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(ls,"ZodPromise");ls.create=(t,e)=>new ls({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 p=i.refinement(u,a);if(n.common.async)return Promise.resolve(p);if(p 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(!J0(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=>J0(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 fa=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(fa,"ZodDefault");fa.create=(t,e)=>new fa({innerType:t,typeName:pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tt(e)});var pf=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 Y0(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(pf,"ZodCatch");pf.create=(t,e)=>new pf({innerType:t,typeName:pt.ZodCatch,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tt(e)});var mf=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(mf,"ZodNaN");mf.create=t=>new mf({typeName:pt.ZodNaN,...Tt(t)});var rH=Symbol("zod_brand"),Sl=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(Sl,"ZodBranded");var ca=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(),X9(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 ca({in:e,out:r,typeName:pt.ZodPipeline})}};o(ca,"ZodPipeline");var Q9=o((t,e={},r)=>t?cs.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})}}):cs.create(),"custom"),nH={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 iH=o((t,e={message:`Input not instance of ${t.name}`})=>Q9(r=>r instanceof t,e,!0),"instanceOfType"),e7=Mi.create,t7=Yi.create,oH=mf.create,sH=Xs.create,r7=Zs.create,aH=xo.create,fH=uf.create,cH=Qs.create,uH=ea.create,lH=cs.create,hH=wo.create,dH=Ti.create,pH=lf.create,mH=Sn.create,bH=er.create,gH=er.strictCreate,vH=ta.create,yH=hf.create,xH=ra.create,wH=Wn.create,_H=na.create,EH=df.create,AH=_o.create,SH=us.create,MH=ia.create,TH=oa.create,CH=sa.create,kH=aa.create,IH=ls.create,J9=Mn.create,DH=Jn.create,OH=Eo.create,RH=Mn.createWithPreprocess,NH=ca.create,PH=o(()=>e7().optional(),"ostring"),LH=o(()=>t7().optional(),"onumber"),BH=o(()=>r7().optional(),"oboolean"),UH={string:t=>Mi.create({...t,coerce:!0}),number:t=>Yi.create({...t,coerce:!0}),boolean:t=>Zs.create({...t,coerce:!0}),bigint:t=>Xs.create({...t,coerce:!0}),date:t=>xo.create({...t,coerce:!0})},$H=gt,W=Object.freeze({__proto__:null,defaultErrorMap:Ml,setErrorMap:Jq,getErrorMap:V0,makeIssue:W0,EMPTY_PATH:Yq,addIssueToContext:Ke,ParseStatus:Rr,INVALID:gt,DIRTY:X9,OK:rn,isAborted:Xg,isDirty:Zg,isValid:J0,isAsync:Y0,get util(){return Ut},ZodParsedType:Fe,getParsedType:Ys,ZodType:xt,ZodString:Mi,ZodNumber:Yi,ZodBigInt:Xs,ZodBoolean:Zs,ZodDate:xo,ZodSymbol:uf,ZodUndefined:Qs,ZodNull:ea,ZodAny:cs,ZodUnknown:wo,ZodNever:Ti,ZodVoid:lf,ZodArray:Sn,get objectUtil(){return X0},ZodObject:er,ZodUnion:ta,ZodDiscriminatedUnion:hf,ZodIntersection:ra,ZodTuple:Wn,ZodRecord:na,ZodMap:df,ZodSet:_o,ZodFunction:us,ZodLazy:ia,ZodLiteral:oa,ZodEnum:sa,ZodNativeEnum:aa,ZodPromise:ls,ZodEffects:Mn,ZodTransformer:Mn,ZodOptional:Jn,ZodNullable:Eo,ZodDefault:fa,ZodCatch:pf,ZodNaN:mf,BRAND:rH,ZodBranded:Sl,ZodPipeline:ca,custom:Q9,Schema:xt,ZodSchema:xt,late:nH,get ZodFirstPartyTypeKind(){return pt},coerce:UH,any:lH,array:mH,bigint:sH,boolean:r7,date:aH,discriminatedUnion:yH,effect:J9,enum:CH,function:SH,instanceof:iH,intersection:xH,lazy:MH,literal:TH,map:EH,nan:oH,nativeEnum:kH,never:dH,null:uH,nullable:OH,number:t7,object:bH,oboolean:BH,onumber:LH,optional:DH,ostring:PH,pipeline:NH,preprocess:RH,promise:IH,record:_H,set:AH,strictObject:gH,string:e7,symbol:fH,transformer:J9,tuple:wH,undefined:cH,union:vH,unknown:hH,void:pH,NEVER:$H,ZodIssueCode:Ne,quotelessJson:Wq,ZodError:Si});var i7=W.array(W.string().or(W.record(W.any()))),$re=W.object({type:W.string().optional(),narrative:W.string().optional()}),Q0=W.string().or(W.object({id:W.string(),type:W.string(),caption:W.string().optional()})),FH=W.object({type:W.string().min(1).or(W.string().array().nonempty()),latitude:W.number(),longitude:W.number()}),qH=W.object({type:W.string().min(1).or(W.string().array().nonempty()),addressCountry:W.string().optional(),addressCountryCode:W.string().optional(),addressRegion:W.string().optional(),addressLocality:W.string().optional(),streetAddress:W.string().optional(),postOfficeBoxNumber:W.string().optional(),postalCode:W.string().optional(),geo:FH.optional()}),HH=W.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(W.string()),o7=W.object({type:W.string().min(1).or(W.string().array().nonempty()),identifier:W.string(),identifierType:HH}),Tl=W.string().or(W.object({id:W.string().optional(),type:W.string().or(W.string().array().nonempty().optional()),name:W.string().optional(),url:W.string().optional(),phone:W.string().optional(),description:W.string().optional(),endorsement:W.any().array().optional(),image:Q0.optional(),email:W.string().email().optional(),address:qH.optional(),otherIdentifier:o7.array().optional(),official:W.string().optional(),parentOrg:W.any().optional(),familyName:W.string().optional(),givenName:W.string().optional(),additionalName:W.string().optional(),patronymicName:W.string().optional(),honorificPrefix:W.string().optional(),honorificSuffix:W.string().optional(),familyNamePrefix:W.string().optional(),dateOfBirth:W.string().optional()}).catchall(W.any())),e2=W.object({id:W.string().optional()}).catchall(W.any()),zH=W.object({type:W.string(),id:W.string()}),KH=W.object({id:W.string(),type:W.string()}),jH=W.object({id:W.string(),type:W.string()}).catchall(W.any()),Z0=W.object({"@context":i7,id:W.string().optional(),type:W.string().array().nonempty(),issuer:Tl,issuanceDate:W.string(),expirationDate:W.string().optional(),credentialSubject:e2.or(e2.array()),credentialStatus:zH.optional(),credentialSchema:KH.array().optional(),refreshService:jH.optional()}).catchall(W.any()),ua=W.object({type:W.string(),created:W.string(),challenge:W.string().optional(),domain:W.string().optional(),nonce:W.string().optional(),proofPurpose:W.string(),verificationMethod:W.string(),jws:W.string().optional()}).catchall(W.any()),Cl=Z0.extend({proof:ua.or(ua.array())}),GH=W.object({"@context":i7,id:W.string().optional(),type:W.string().array().nonempty(),verifiableCredential:Cl.or(Cl.array()).optional(),holder:W.string().optional()}).catchall(W.any()),r2=GH.extend({proof:ua.or(ua.array())}),VH=W.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(W.string()),ep=W.object({type:W.string().array().nonempty(),targetCode:W.string().optional(),targetDescription:W.string().optional(),targetName:W.string(),targetFramework:W.string().optional(),targetType:VH.optional(),targetUrl:W.string()}),WH=W.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"]),JH=WH.or(W.string()),YH=W.object({id:W.string().optional(),narrative:W.string().optional()}).catchall(W.any()),XH=W.object({id:W.string(),type:W.string().array().nonempty(),endorsementComment:W.string().optional()}),ZH=Z0.extend({credentialSubject:XH,proof:ua.or(ua.array()).optional()}),QH=W.object({id:W.string(),"@language":W.string().optional(),version:W.string().optional()}),ez=W.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(W.string()),tz=W.object({id:W.string(),type:W.string().array().nonempty(),alignment:ep.array().optional(),description:W.string().optional(),level:W.string().optional(),name:W.string(),points:W.string().optional()}).catchall(W.any()),rz=W.object({id:W.string(),type:W.string().array().nonempty(),alignment:ep.array().optional(),allowedValue:W.string().array().optional(),name:W.string(),requiredLevel:W.string().optional(),requiredValue:W.string().optional(),resultType:ez,rubricCriterionLevel:tz.array().optional(),valueMax:W.string().optional(),valueMin:W.string().optional()}).catchall(W.any()),nz=W.object({id:W.string().optional(),type:W.string().array().nonempty(),alignment:ep.array().optional(),achievementType:JH.optional(),creator:Tl.optional(),creditsAvailable:W.number().optional(),criteria:YH,description:W.string(),endorsement:ZH.array().optional(),fieldOfStudy:W.string().optional(),humanCode:W.string().optional(),image:Q0.optional(),"@language":W.string().optional(),name:W.string(),otherIdentifier:o7.array().optional(),related:QH.array().optional(),resultDescription:rz.array().optional(),specialization:W.string().optional(),tag:W.string().array().optional(),version:W.string().optional()}).catchall(W.any()),iz=W.object({type:W.string(),hashed:W.boolean(),identityHash:W.string(),identityType:W.string(),salt:W.string().optional()}),oz=W.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),sz=W.object({type:W.string().array().nonempty(),achievedLevel:W.string().optional(),alignment:ep.array().optional(),resultDescription:W.string().optional(),status:oz.optional(),value:W.string().optional()}).catchall(W.any()),n7=W.object({id:W.string().optional(),type:W.string().array().nonempty(),activityEndDate:W.string().optional(),activityStartDate:W.string().optional(),creditsEarned:W.number().optional(),achievement:nz.optional(),identifier:iz.array().optional(),image:Q0.optional(),licenseNumber:W.string().optional(),narrative:W.string().optional(),result:sz.array().optional(),role:W.string().optional(),source:Tl.optional(),term:W.string().optional()}).catchall(W.any()),az=W.object({id:W.string().optional(),type:W.string().array().nonempty(),narrative:W.string().optional(),name:W.string().optional(),description:W.string().optional(),genre:W.string().optional(),audience:W.string().optional()}).catchall(W.any()),fz=Z0.extend({name:W.string().optional(),description:W.string().optional(),image:Q0.optional(),credentialSubject:n7.or(n7.array()),endorsement:Z0.array().optional(),evidence:az.array().optional()}),qre=fz.extend({proof:ua.or(ua.array())}),zre=W.object({checks:W.string().array(),warnings:W.string().array(),errors:W.string().array()}),s7=W.enum(["Success","Failed","Error"]),Kre=s7.enum,jre=W.object({check:W.string(),status:s7,message:W.string().optional(),details:W.string().optional()}),Gre=W.object({title:W.string().optional(),createdAt:W.string().optional(),issuer:Tl.optional(),issuee:Tl.optional(),credentialSubject:e2.optional()}),Vre=W.object({id:W.string(),uri:W.string()}).catchall(W.any()),Yre=W.object({limit:W.number(),cursor:W.string().optional()}),a7=W.object({cursor:W.string().optional(),hasMore:W.boolean()}),cz=W.object({kty:W.string(),crv:W.string(),x:W.string(),y:W.string().optional(),n:W.string().optional(),d:W.string()}),uz=W.object({alg:W.string(),iv:W.string(),tag:W.string(),epk:cz.partial().optional(),kid:W.string().optional(),apv:W.string().optional(),apu:W.string().optional()}),lz=W.object({header:uz,encrypted_key:W.string()}),hz=W.object({protected:W.string(),iv:W.string(),ciphertext:W.string(),tag:W.string(),aad:W.string().optional(),recipients:lz.array().optional()}),f7=W.object({encryptedRecord:hz,fields:W.string().array()}).catchall(W.any()),Zre=a7.extend({records:f7.array()}),dz=f7.extend({id:W.string()}),Qre=a7.extend({records:dz.array()}),t2=W.object({profileId:W.string().min(3).max(40),displayName:W.string().default(""),did:W.string(),email:W.string().optional(),image:W.string().optional(),isServiceProfile:W.boolean().default(!1).optional(),notificationsWebhook:W.string().url().startsWith("https://").optional()}),tne=W.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),rne=W.object({uri:W.string(),to:W.string(),from:W.string(),sent:W.string().datetime(),received:W.string().datetime().optional()}),pz=W.enum(["DRAFT","LIVE"]),nne=W.object({uri:W.string(),name:W.string().optional(),type:W.string().optional(),category:W.string().optional(),status:pz.optional()}),ine=W.object({to:t2,from:W.string(),received:W.string().optional()}),mz=W.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED"]),bz=W.object({title:W.string().optional(),body:W.string().optional()}),gz=W.object({vcUris:W.array(W.string()).optional(),vpUris:W.array(W.string()).optional()}),one=W.object({type:mz,to:t2.partial().and(W.object({did:W.string()})),from:t2.partial().and(W.object({did:W.string()})),message:bz.optional(),data:gz.optional(),sent:W.string().datetime().optional()}),sne=W.object({endpoint:W.string(),name:W.string(),did:W.string().optional()}),ane=W.object({ttlSeconds:W.number().optional(),totalUses:W.number().optional()}),vz=W.object({endpoint:W.string()}),fne=W.object({signingAuthority:vz,relationship:W.object({name:W.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:W.string()})});var tp=o(t=>`lc:ceramic:${t}`,"streamIdToCeramicURI");var n2=W.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 Al(e),i=o(async(R,I,N,J)=>t.invoke.didResolver(R,J),"learnCardResolver"),a={...y8.getResolver(),web:i},c=new Ga({resolver:a});n.did=c;let u=t.invoke.getKey(),p=new Qu(r8(u));n.did.setProvider(p),await n.did.authenticate();let v=new gl({ceramic:n}),y=o(async(R,I={},N={},J)=>{if(!R)throw new Error("content is required");if(I.controllers||(I.controllers=[n.did.id]),I.family||(I.family=r),"pin"in N||(N.pin=!0),J?.encrypt){t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - encrypt enabled",J);let V=J?.recipients||[];J?.controllersCanDecrypt&&(V=[...V,...I.controllers]),R=await n?.did?.createDagJWE(R,c7.default.uniq(V))}return t.debug?.("learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",R,I,N),(await Gn.create(n,R,I,N)).id.toString()},"publishContentToCeramic"),S=o(async R=>{let I=(await v.load(R))?.content;if(t.debug?.("learnCard.read.get.readContentFromCeramic",I),I?.ciphertext)try{return await c.decryptDagJWE(I)}catch(N){throw t.debug?.("learnCard.read.get.readContentFromCeramic - Could not decrypt credential - DID not authorized.",N),new Error("Could not decrypt credential - DID not authorized.")}return I},"readContentFromCeramic"),O=o(async(R,I)=>(await Cl.or(r2).parseAsync(R),tp(await y(R,{},{},I))),"uploadCredential");return{name:"Ceramic",displayName:"Ceramic",description:"Uploads/resolves credentials using the Ceramic Network (https://ceramic.network/)",store:{upload:async(R,I)=>(R.debug?.("learnCard.store.Ceramic.upload"),O(I)),uploadEncrypted:async(R,I,N)=>(R.debug?.("learnCard.store.Ceramic.uploadEncrypted"),O(I,{encrypt:!0,controllersCanDecrypt:!0,...N?{recipients:N.recipients}:{}}))},read:{get:async(R,I)=>{if(R.debug?.("learnCard.read.Ceramic.get"),!I)return;let N=await n2.spa(I);if(!N.success)return;let J=N.data.split(":")[2];try{return await Cl.or(r2).parseAsync(await S(J))}catch(L){R.debug?.(L);return}}},methods:{publishContentToCeramic:async(R,I,N)=>tp(await y(I,{},{},N)),readContentFromCeramic:async(R,I)=>S(I),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var yz=rp;
|
|
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 b0?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{E_(D)}catch(P){a=a??[],P instanceof b0?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 b0(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)E_(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 mg=Js.EMPTY;function g0(t){return t instanceof Js||t&&"closed"in t&&At(t.remove)&&At(t.add)&&At(t.unsubscribe)}o(g0,"isSubscription");function E_(t){At(t)?t():t.unsubscribe()}o(E_,"execFinalizer");var Wi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var kc={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=kc.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=kc.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function v0(t){kc.setTimeout(function(){var e=Wi.onUnhandledError;if(e)e(t);else throw t})}o(v0,"reportUnhandledError");function bg(){}o(bg,"noop");var A_=function(){return gg("C",void 0,void 0)}();function S_(t){return gg("E",void 0,t)}o(S_,"errorNotification");function M_(t){return gg("N",t,void 0)}o(M_,"nextNotification");function gg(t,e,r){return{kind:t,value:e,error:r}}o(gg,"createNotification");var of=null;function Ic(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(Ic,"errorContext");function T_(t){Wi.useDeprecatedSynchronousErrorHandling&&of&&(of.errorThrown=!0,of.error=t)}o(T_,"captureError");var fl=function(t){Qr(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,g0(r)&&r.add(n)):n.destination=b$,n}return o(e,"Subscriber"),e.create=function(r,n,i){return new x0(r,n,i)},e.prototype.next=function(r){this.isStopped?yg(M_(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?yg(S_(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?yg(A_,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 d$=Function.prototype.bind;function vg(t,e){return d$.call(t,e)}o(vg,"bind");var p$=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){y0(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){y0(n)}else y0(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){y0(r)}},t}(),x0=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&&vg(r.next,u),error:r.error&&vg(r.error,u),complete:r.complete&&vg(r.complete,u)}):c=r}return a.destination=new p$(c),a}return o(e,"SafeSubscriber"),e}(fl);function y0(t){Wi.useDeprecatedSynchronousErrorHandling?T_(t):v0(t)}o(y0,"handleUnhandledError");function m$(t){throw t}o(m$,"defaultErrorHandler");function yg(t,e){var r=Wi.onStoppedNotification;r&&kc.setTimeout(function(){return r(t,e)})}o(yg,"handleStoppedNotification");var b$={closed:!0,next:bg,error:m$,complete:bg};var Dc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Oc(t){return t}o(Oc,"identity");function C_(t){return t.length===0?Oc:t.length===1?t[0]:o(function(r){return t.reduce(function(n,i){return i(n)},r)},"piped")}o(C_,"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=v$(e)?e:new x0(e,r,n);return Ic(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=k_(r),new r(function(i,a){var c=new x0({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[Dc]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return C_(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=k_(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 k_(t){var e;return(e=t??Wi.Promise)!==null&&e!==void 0?e:Promise}o(k_,"getPromiseCtor");function g$(t){return t&&At(t.next)&&At(t.error)&&At(t.complete)}o(g$,"isObserver");function v$(t){return t&&t instanceof fl||g$(t)&&g0(t)}o(v$,"isSubscriber");function y$(t){return At(t?.lift)}o(y$,"hasLift");function Dr(t){return function(e){if(y$(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 x$(t,e,r,n,i)}o(Or,"createOperatorSubscriber");var x$=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}(fl);var I_=Cc(function(t){return o(function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var xg=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 D_(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new I_},e.prototype.next=function(r){var n=this;Ic(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;Ic(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;Ic(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?mg:(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 D_(r,n)},e}(Wt);var D_=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:mg},e}(xg);var wg=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}(xg);var _g={now:function(){return(_g.delegate||Date).now()},delegate:void 0};var O_=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 cl={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=cl.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=cl.delegate;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var R_=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),cl.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&&cl.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}(O_);var Eg=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=_g.now,t}();var N_=function(t){Qr(e,t);function e(r,n){n===void 0&&(n=Eg.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}(Eg);var w$=new N_(R_),P_=w$;var w0=new Wt(function(t){return t.complete()});function _0(t){return t&&At(t.schedule)}o(_0,"isScheduler");function L_(t){return t[t.length-1]}o(L_,"last");function B_(t){return _0(L_(t))?t.pop():void 0}o(B_,"popScheduler");function U_(t,e){return typeof L_(t)=="number"?t.pop():e}o(U_,"popNumber");var Rc=o(function(t){return t&&typeof t.length=="number"&&typeof t!="function"},"isArrayLike");function E0(t){return At(t?.then)}o(E0,"isPromise");function A0(t){return At(t[Dc])}o(A0,"isInteropObservable");function S0(t){return Symbol.asyncIterator&&At(t?.[Symbol.asyncIterator])}o(S0,"isAsyncIterable");function M0(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(M0,"createInvalidObservableTypeError");function _$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(_$,"getSymbolIterator");var T0=_$();function C0(t){return At(t?.[T0])}o(C0,"isIterable");function k0(t){return w_(this,arguments,o(function(){var r,n,i,a;return m0(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(k0,"readableStreamLikeToAsyncGenerator");function I0(t){return At(t?.getReader)}o(I0,"isReadableStreamLike");function en(t){if(t instanceof Wt)return t;if(t!=null){if(A0(t))return E$(t);if(Rc(t))return A$(t);if(E0(t))return S$(t);if(S0(t))return $_(t);if(C0(t))return M$(t);if(I0(t))return T$(t)}throw M0(t)}o(en,"innerFrom");function E$(t){return new Wt(function(e){var r=t[Dc]();if(At(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(E$,"fromInteropObservable");function A$(t){return new Wt(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}o(A$,"fromArrayLike");function S$(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,v0)})}o(S$,"fromPromise");function M$(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(M$,"fromIterable");function $_(t){return new Wt(function(e){C$(t,e).catch(function(r){return e.error(r)})})}o($_,"fromAsyncIterable");function T$(t){return $_(k0(t))}o(T$,"fromReadableStreamLike");function C$(t,e){var r,n,i,a;return x_(this,void 0,void 0,function(){var c,u;return m0(this,function(m){switch(m.label){case 0:m.trys.push([0,5,6,11]),r=__(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(C$,"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 D0(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(D0,"observeOn");function O0(t,e){return e===void 0&&(e=0),Dr(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}o(O0,"subscribeOn");function F_(t,e){return en(t).pipe(O0(e),D0(e))}o(F_,"scheduleObservable");function q_(t,e){return en(t).pipe(O0(e),D0(e))}o(q_,"schedulePromise");function H_(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(H_,"scheduleArray");function z_(t,e){return new Wt(function(r){var n;return Ai(r,e,function(){n=t[T0](),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(z_,"scheduleIterable");function R0(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(R0,"scheduleAsyncIterable");function K_(t,e){return R0(k0(t),e)}o(K_,"scheduleReadableStreamLike");function j_(t,e){if(t!=null){if(A0(t))return F_(t,e);if(Rc(t))return H_(t,e);if(E0(t))return q_(t,e);if(S0(t))return R0(t,e);if(C0(t))return z_(t,e);if(I0(t))return K_(t,e)}throw M0(t)}o(j_,"scheduled");function G_(t,e){return e?j_(t,e):en(t)}o(G_,"from");var N0=Cc(function(t){return o(function(){t(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function V_(t){return t instanceof Date&&!isNaN(t)}o(V_,"isValidDate");function P0(t,e){return Dr(function(r,n){var i=0;r.subscribe(Or(n,function(a){n.next(t.call(e,a,i++))}))})}o(P0,"map");var k$=Array.isArray;function I$(t,e){return k$(e)?t.apply(void 0,Vi([],Kn(e))):t(e)}o(I$,"callOrApply");function W_(t){return P0(function(e){return I$(t,e)})}o(W_,"mapOneOrManyArgs");function J_(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(J_,"mergeInternals");function ul(t,e,r){return r===void 0&&(r=1/0),At(e)?ul(function(n,i){return P0(function(a,c){return e(n,a,i,c)})(en(t(n,i)))},r):(typeof e=="number"&&(r=e),Dr(function(n,i){return J_(n,i,t,r)}))}o(ul,"mergeMap");function Y_(t){return t===void 0&&(t=1/0),ul(Oc,t)}o(Y_,"mergeAll");var D$=["addListener","removeListener"],O$=["addEventListener","removeEventListener"],R$=["on","off"];function ll(t,e,r,n){if(At(r)&&(n=r,r=void 0),n)return ll(t,e,r).pipe(W_(n));var i=Kn(L$(t)?O$.map(function(u){return function(m){return t[u](e,m,r)}}):N$(t)?D$.map(X_(t,e)):P$(t)?R$.map(X_(t,e)):[],2),a=i[0],c=i[1];if(!a&&Rc(t))return ul(function(u){return ll(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(ll,"fromEvent");function X_(t,e){return function(r){return function(n){return t[r](e,n)}}}o(X_,"toCommonHandlerRegistry");function N$(t){return At(t.addListener)&&At(t.removeListener)}o(N$,"isNodeStyleEventEmitter");function P$(t){return At(t.on)&&At(t.off)}o(P$,"isJQueryStyleEventEmitter");function L$(t){return At(t.addEventListener)&&At(t.removeEventListener)}o(L$,"isEventTarget");function hl(t,e,r){t===void 0&&(t=0),r===void 0&&(r=P_);var n=-1;return e!=null&&(_0(e)?r=e:n=e),new Wt(function(i){var a=V_(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(hl,"timer");function Ag(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=B_(t),n=U_(t,1/0),i=t;return i.length?i.length===1?en(i[0]):Y_(n)(G_(i,r)):w0}o(Ag,"merge");function Z_(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(Z_,"filter");function Q_(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(Q_,"defaultIfEmpty");function eE(t){return t<=0?function(){return w0}:Dr(function(e,r){var n=0;e.subscribe(Or(r,function(i){++n<=t&&(r.next(i),t<=n&&r.complete())}))})}o(eE,"take");function tE(t){return t===void 0&&(t=B$),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(tE,"throwIfEmpty");function B$(){return new N0}o(B$,"defaultErrorFactory");function Sg(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Z_(function(i,a){return t(i,a,n)}):Oc,eE(1),r?Q_(e):tE(function(){return new N0}))}}o(Sg,"first");function Mg(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(Mg,"throttle");var rE;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(rE||(rE={}));var dl;(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"})(dl||(dl={}));var Cg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(Cg||(Cg={}));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,Tg.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===Cg.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,Tg.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 Nc(){return t=>{}}o(Nc,"StreamStatic");var fE=Lt(oE(),1);function sE(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):(Ag(...t.map(r=>ll(r,"abort"))).pipe(Sg()).subscribe(()=>{e.abort()}),e.signal)}o(sE,"mergeAbortSignals");var pl=class{constructor(e){let r=new AbortController;if(this.signal=r.signal,e<=0){r.abort();return}this._subscription=hl(e).subscribe(()=>{r.abort()})}clear(){this._subscription?.unsubscribe()}};o(pl,"TimedAbortSignal");async function aE(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(aE,"abortable");var U$=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||U$,n=new pl(r),i=e.signal?sE([e.signal,n.signal]):n.signal,a=await aE(i,c=>(0,fE.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 ml=Lt(Ec(),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 cE=0,Xt=class{static streamIdFromState(e){return new rt(e.type,e.log[0].cid)}static serializeCommit(e){let r=(0,ml.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,ml.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,ml.default)(e);return r.log=r.log.map(n=>({...n,cid:n.cid.toString()})),r.anchorStatus!=null&&(r.anchorStatus=dl[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!=cE&&(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,ml.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=dl[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!=cE&&(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 bl=class extends wg{next(e){let r=this.value;Xt.statesEqual(r,e)||super.next(e)}};o(bl,"StreamStateSubject");var $$=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,kg={anchor:!0,publish:!0,pin:!0,sync:yr.PREFER_CACHE},F$={sync:yr.PREFER_CACHE},uE={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Ig(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,dE.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(Ig,"headerFromMetadata");async function lE(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(lE,"getAuthenticatedDID");async function Dg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Dg,"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,hE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(e,r,n,i={}){i={...kg,...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={...kg,...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={...kg,...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={...F$,...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={...uE,...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={...uE,...r};let i={header:Ig(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=Dg,this.patch=Dg,this.sync=Dg,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=Ig(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=r0.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 lE(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=Ig(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 lE(e)).createDagJWS(r)}},"TileDocument");Gn.STREAM_TYPE_NAME="tile";Gn.STREAM_TYPE_ID=0;Gn=jn=$$([Nc()],Gn);var xE=Lt(bE(),1);function Y$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(Y$,"_checkPrivateRedeclaration");function X$(t,e){return e.get?e.get.call(t):e.value}o(X$,"_classApplyDescriptorGet");function Z$(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(Z$,"_classApplyDescriptorSet");function yE(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}o(yE,"_classExtractFieldDescriptor");function Pg(t,e){var r=yE(t,e,"get");return X$(t,r)}o(Pg,"_classPrivateFieldGet");function gE(t,e,r){Y$(t,e),e.set(t,r)}o(gE,"_classPrivateFieldInit");function vE(t,e,r){var n=yE(t,e,"set");return Z$(t,n,r),r}o(vE,"_classPrivateFieldSet");function Q$(t){return typeof t=="string"||Pt.isInstance(t)||rt.isInstance(t)?{streamId:t}:{streamId:t.streamId,genesis:t.genesis}}o(Q$,"keyToQuery");function Lg(t){return typeof t=="string"?fn.from(t).toString():Pt.isInstance(t)||rt.isInstance(t)?t.toString():t.streamId.toString()}o(Lg,"keyToString");async function eF(t){let e=await Gn.makeGenesis({},null,{...t,deterministic:!0}),r=await rt.fromGenesis("tile",e);return{genesis:e,streamId:r}}o(eF,"getDeterministicQuery");var tF=o(()=>Promise.resolve([]),"tempBatchLoadFn"),B0=new WeakMap,Bg=new WeakMap,gl=class extends xE.default{cache(e){if(!Pg(this,Bg))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(Pg(this,B0),e,r,n);return this.cache(i),i}async deterministic(e,r){let n=await eF(e);try{return await super.load(n)}catch{let a=await Gn.createFromGenesis(Pg(this,B0),n.genesis,r);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,r,n,i){let a=Lg(e);this.clear(a);let c=await this.load({streamId:a});return await c.update(r,n,i),c}constructor(e){super(tF,{cache:!0,cacheKeyFn:Lg,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),gE(this,B0,{writable:!0,value:void 0}),gE(this,Bg,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{e.cache||this.clearAll();let n=await e.ceramic.multiQuery(r.map(Q$),e.multiqueryTimeout);return r.map(i=>{let a=Lg(i),c=n[a];return c||new Error(`Failed to load stream: ${a}`)})},vE(this,B0,e.ceramic),vE(this,Bg,!!e.cache)}};o(gl,"TileLoader");function Ug(t){return typeof t=="string"?rt.fromString(t):t}o(Ug,"typeStreamID");function wE(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(wE,"serializeObjectToSearchParams");function $g(t){let e={};for(let[r,n]of Object.entries(t))rt.isInstance(n)?e[r]=n.toString():e[r]=n;return e}o($g,"serializeObjectForHttpPost");var tn=class extends Wt{constructor(e,r,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=hl(0,n).pipe(Mg(()=>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 bl(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=wE(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 Fg=Lt(Ec(),1);var _E;(function(t){t[t.GENESIS=0]="GENESIS",t[t.PARTIAL=1]="PARTIAL",t[t.SIGNED=2]="SIGNED"})(_E||(_E={}));var qg;(function(t){t[t.GENESIS=0]="GENESIS",t[t.SIGNED=1]="SIGNED",t[t.ANCHOR=2]="ANCHOR"})(qg||(qg={}));var vl=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,Fg.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===qg.ANCHOR).map(({cid:e})=>Pt.make(this.id,e))}get state(){return(0,Fg.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(vl,"Stream");function EE(){return t=>{}}o(EE,"StreamStatic");function AE(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(AE,"normalizeAccountId");var rF="(?:%[0-9a-fA-F]{2})",SE=`(?:[a-zA-Z0-9._-]|${rF})`,nF="([a-z0-9]+)",iF=`((?:${SE}*:)*(${SE}+))`,ME="[a-zA-Z0-9_.:%-]",oF=`;${ME}+=${ME}*`,sF=`((${oF})*)`,aF="(/[^#?]*)?",fF="([?][^#]*)?",cF="(#.*)?",uF=new RegExp(`^did:${nF}:${iF}${sF}${aF}${fF}${cF}$`);function TE(t){if(t===""||!t)return null;let e=t.match(uF);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(TE,"parse");var kE=Lt(Ec(),1),lF=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,Hg=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),CE={anchor:!1,publish:!0,sync:sf.PREFER_CACHE},zg={anchor:!0,publish:!0},hF={sync:sf.PREFER_CACHE},ff=af=o(class extends vl{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:e,metadata:r}=this.state$.value;return(0,kE.default)(e?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(e,r,n={}){n={...CE,...n};let i=AE(r),a=af.makeGenesis(i);return af.fromGenesis(e,a,n)}static async fromGenesis(e,r,n={}){return n={...CE,...n},e.createStreamFromGenesis(af.STREAM_TYPE_ID,r,n)}async setDid(e,r,n={}){n={...zg,...n};let i=typeof e=="string"?e.trim():e.id;if(TE(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={...zg,...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={...zg,...r};let n=await e.createLink("");return this.setDidProof(n,r)}static async load(e,r,n={}){n={...hF,...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=Hg,this.setDid=Hg,this.sync=Hg,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");ff.STREAM_TYPE_NAME="caip10-link";ff.STREAM_TYPE_ID=1;ff=af=lF([EE()],ff);Pi();Aa();var l9=Lt(c9(),1),oq=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,sq={sync:yr.PREFER_CACHE};async function u9(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(u9,"_ensureAuthenticated");async function aq(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(aq,"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={...sq,...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 u9(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=aq,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(e,r){return await u9(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=l9.default.encode(t,"identity"),r=qo(ac,e),n=We.createV1(ac,r);return new rt("UNLOADABLE",n)}();Ys=yo=oq([Nc()],Ys);var p9=Lt(Oa(),1);var 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},Ji,cq={anchor:!0,publish:!0,pin:!0,sync:yr.NEVER_SYNC,syncTimeoutSeconds:0},uq={anchor:!1,publish:!1,pin:!0,sync:yr.PREFER_CACHE},lq={sync:yr.PREFER_CACHE},h9={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function d9(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(d9,"_ensureAuthenticated");async function Gg(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}o(Gg,"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={...cq,...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={...uq,...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={...lq,...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={...h9,...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={...h9,...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=Gg,this.patch=Gg,this.sync=Gg,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:r0.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 d9(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,p9.randomBytes)(12)),{data:r,header:a}}static async _signDagJWS(e,r){return await d9(e),e.did.createDagJWS(r)}},"ModelInstanceDocument");uf.STREAM_TYPE_NAME="MID";uf.STREAM_TYPE_ID=3;uf=Ji=fq([Nc()],uf);var wl=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(wl,"RemotePinApi");var _l=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:$g(e)})).count}async query(e){let r=await this._fetchJson(this._collectionURL,{method:"POST",body:$g(e)});return{edges:r.edges.map(i=>({cursor:i.cursor,node:Xt.deserializeState(i.node)})),pageInfo:r.pageInfo}}};o(_l,"RemoteIndexApi");var El=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(El,"RemoteAdminApi");var hq="/api/v0/",dq="http://localhost:7007",pq={syncInterval:5e3},mq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},bq={anchor:!0,publish:!0,sync:yr.PREFER_CACHE},m9={sync:yr.PREFER_CACHE},Al=class{constructor(e=dq,r={}){this._config={...pq,...r},this._apiUrl=new URL(hq,e),this._streamCache=new Map,this.context={api:this},this.pin=new wl(this._apiUrl),this.index=new _l(this._apiUrl);let n=(()=>this.did).bind(this);this.admin=new El(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={...bq,...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={...m9,...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=Ug(e);return tn.loadStreamCommits(r,this._apiUrl)}async applyCommit(e,r,n={}){n={...mq,...n};let i=Ug(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={...m9,...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(Al,"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"]),gq=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 Ml=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"),y9=Ml;function vq(t){y9=t}o(vq,"setErrorMap");function z0(){return y9}o(z0,"getErrorMap");var K0=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"),yq=[];function Ke(t,e){let r=K0({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,z0(),Ml].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"}),x9=o(t=>({status:"dirty",value:t}),"DIRTY"),rn=o(t=>({status:"valid",value:t}),"OK"),Vg=o(t=>t.status==="aborted","isAborted"),Wg=o(t=>t.status==="dirty","isDirty"),j0=o(t=>t.status==="valid","isValid"),G0=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 b9=o((t,e)=>{if(j0(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(G0(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 b9(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(G0(i)?i:Promise.resolve(i));return b9(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 Sl({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 xq=/^c[^\s-]{8,}$/i,wq=/^([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,_q=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Eq=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")_q.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")wq.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")xq.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"?Eq(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 Aq(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(Aq,"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"?Aq(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 V0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(V0||(V0={}));var g9=o(t=>e=>new er({...t,shape:()=>({...t.shape(),...e})}),"AugmentFactory");function $c(t){if(t instanceof er){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Jn.create($c(n))}return new er({...t._def,shape:()=>e})}else return t instanceof Sn?Sn.create($c(t.element)):t instanceof Jn?Jn.create($c(t.unwrap())):t instanceof Eo?Eo.create($c(t.unwrap())):t instanceof Wn?Wn.create(t.items.map(e=>$c(e))):t}o($c,"deepPartialify");var er=class extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=g9(this._def),this.extend=g9(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:()=>V0.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 $c(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 w9(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 H0=o(t=>t instanceof oa?H0(t.schema):t instanceof Mn?H0(t.innerType()):t instanceof sa?[t.value]:t instanceof aa?t.options:t instanceof fa?Object.keys(t.enum):t instanceof ca?H0(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=H0(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 Jg(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=Jg(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=Jg(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(Jg,"mergeValues");var na=class extends xt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=o((a,c)=>{if(Vg(a)||Vg(c))return gt;let u=Jg(a.value,c.value);return u.valid?((Wg(a)||Wg(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 K0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,z0(),Ml].filter(v=>!!v),issueData:{code:Ne.invalid_arguments,argumentsError:m}})}o(n,"makeArgsIssue");function i(u,m){return K0({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,z0(),Ml].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 w9(t,e){return new aa({values:t,typeName:pt.ZodEnum,...Tt(e)})}o(w9,"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=w9;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(!j0(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=>j0(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 G0(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 Sq=Symbol("zod_brand"),Sl=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(Sl,"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(),x9(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 _9=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"),Mq={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 Tq=o((t,e={message:`Input not instance of ${t.name}`})=>_9(r=>r instanceof t,e,!0),"instanceOfType"),E9=Mi.create,A9=Yi.create,Cq=bf.create,kq=Zs.create,S9=Qs.create,Iq=xo.create,Dq=lf.create,Oq=ea.create,Rq=ta.create,Nq=us.create,Pq=wo.create,Lq=Ti.create,Bq=hf.create,Uq=Sn.create,$q=er.create,Fq=er.strictCreate,qq=ra.create,Hq=df.create,zq=na.create,Kq=Wn.create,jq=ia.create,Gq=pf.create,Vq=_o.create,Wq=ls.create,Jq=oa.create,Yq=sa.create,Xq=aa.create,Zq=fa.create,Qq=hs.create,v9=Mn.create,eH=Jn.create,tH=Eo.create,rH=Mn.createWithPreprocess,nH=ua.create,iH=o(()=>E9().optional(),"ostring"),oH=o(()=>A9().optional(),"onumber"),sH=o(()=>S9().optional(),"oboolean"),aH={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})},fH=gt,V=Object.freeze({__proto__:null,defaultErrorMap:Ml,setErrorMap:vq,getErrorMap:z0,makeIssue:K0,EMPTY_PATH:yq,addIssueToContext:Ke,ParseStatus:Rr,INVALID:gt,DIRTY:x9,OK:rn,isAborted:Vg,isDirty:Wg,isValid:j0,isAsync:G0,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 V0},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:Sq,ZodBranded:Sl,ZodPipeline:ua,custom:_9,Schema:xt,ZodSchema:xt,late:Mq,get ZodFirstPartyTypeKind(){return pt},coerce:aH,any:Nq,array:Uq,bigint:kq,boolean:S9,date:Iq,discriminatedUnion:Hq,effect:v9,enum:Xq,function:Wq,instanceof:Tq,intersection:zq,lazy:Jq,literal:Yq,map:Gq,nan:Cq,nativeEnum:Zq,never:Lq,null:Rq,nullable:tH,number:A9,object:$q,oboolean:sH,onumber:oH,optional:eH,ostring:iH,pipeline:nH,preprocess:rH,promise:Qq,record:jq,set:Vq,strictObject:Fq,string:E9,symbol:Dq,transformer:v9,tuple:Kq,undefined:Oq,union:qq,unknown:Pq,void:Bq,NEVER:fH,ZodIssueCode:Ne,quotelessJson:gq,ZodError:Si});var T9=V.array(V.string().or(V.record(V.any()))),qte=V.object({type:V.string().optional(),narrative:V.string().optional()}),J0=V.string().or(V.object({id:V.string(),type:V.string(),caption:V.string().optional()})),cH=V.object({type:V.string().min(1).or(V.string().array().nonempty()),latitude:V.number(),longitude:V.number()}),uH=V.object({type:V.string().min(1).or(V.string().array().nonempty()),addressCountry:V.string().optional(),addressCountryCode:V.string().optional(),addressRegion:V.string().optional(),addressLocality:V.string().optional(),streetAddress:V.string().optional(),postOfficeBoxNumber:V.string().optional(),postalCode:V.string().optional(),geo:cH.optional()}),lH=V.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(V.string()),C9=V.object({type:V.string().min(1).or(V.string().array().nonempty()),identifier:V.string(),identifierType:lH}),Tl=V.string().or(V.object({id:V.string().optional(),type:V.string().or(V.string().array().nonempty().optional()),name:V.string().optional(),url:V.string().optional(),phone:V.string().optional(),description:V.string().optional(),endorsement:V.any().array().optional(),image:J0.optional(),email:V.string().email().optional(),address:uH.optional(),otherIdentifier:C9.array().optional(),official:V.string().optional(),parentOrg:V.any().optional(),familyName:V.string().optional(),givenName:V.string().optional(),additionalName:V.string().optional(),patronymicName:V.string().optional(),honorificPrefix:V.string().optional(),honorificSuffix:V.string().optional(),familyNamePrefix:V.string().optional(),dateOfBirth:V.string().optional()}).catchall(V.any())),Yg=V.object({id:V.string().optional()}).catchall(V.any()),hH=V.object({type:V.string(),id:V.string()}),dH=V.object({id:V.string(),type:V.string()}),pH=V.object({id:V.string(),type:V.string()}).catchall(V.any()),W0=V.object({"@context":T9,id:V.string().optional(),type:V.string().array().nonempty(),issuer:Tl,issuanceDate:V.string(),expirationDate:V.string().optional(),credentialSubject:Yg.or(Yg.array()),credentialStatus:hH.optional(),credentialSchema:dH.array().optional(),refreshService:pH.optional()}).catchall(V.any()),la=V.object({type:V.string(),created:V.string(),challenge:V.string().optional(),domain:V.string().optional(),nonce:V.string().optional(),proofPurpose:V.string(),verificationMethod:V.string(),jws:V.string().optional()}).catchall(V.any()),Cl=W0.extend({proof:la.or(la.array())}),mH=V.object({"@context":T9,id:V.string().optional(),type:V.string().array().nonempty(),verifiableCredential:Cl.or(Cl.array()).optional(),holder:V.string().optional()}).catchall(V.any()),Zg=mH.extend({proof:la.or(la.array())}),bH=V.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(V.string()),Y0=V.object({type:V.string().array().nonempty(),targetCode:V.string().optional(),targetDescription:V.string().optional(),targetName:V.string(),targetFramework:V.string().optional(),targetType:bH.optional(),targetUrl:V.string()}),gH=V.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"]),vH=gH.or(V.string()),yH=V.object({id:V.string().optional(),narrative:V.string().optional()}).catchall(V.any()),xH=V.object({id:V.string(),type:V.string().array().nonempty(),endorsementComment:V.string().optional()}),wH=W0.extend({credentialSubject:xH,proof:la.or(la.array()).optional()}),_H=V.object({id:V.string(),"@language":V.string().optional(),version:V.string().optional()}),EH=V.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(V.string()),AH=V.object({id:V.string(),type:V.string().array().nonempty(),alignment:Y0.array().optional(),description:V.string().optional(),level:V.string().optional(),name:V.string(),points:V.string().optional()}).catchall(V.any()),SH=V.object({id:V.string(),type:V.string().array().nonempty(),alignment:Y0.array().optional(),allowedValue:V.string().array().optional(),name:V.string(),requiredLevel:V.string().optional(),requiredValue:V.string().optional(),resultType:EH,rubricCriterionLevel:AH.array().optional(),valueMax:V.string().optional(),valueMin:V.string().optional()}).catchall(V.any()),MH=V.object({id:V.string().optional(),type:V.string().array().nonempty(),alignment:Y0.array().optional(),achievementType:vH.optional(),creator:Tl.optional(),creditsAvailable:V.number().optional(),criteria:yH,description:V.string(),endorsement:wH.array().optional(),fieldOfStudy:V.string().optional(),humanCode:V.string().optional(),image:J0.optional(),"@language":V.string().optional(),name:V.string(),otherIdentifier:C9.array().optional(),related:_H.array().optional(),resultDescription:SH.array().optional(),specialization:V.string().optional(),tag:V.string().array().optional(),version:V.string().optional()}).catchall(V.any()),TH=V.object({type:V.string(),hashed:V.boolean(),identityHash:V.string(),identityType:V.string(),salt:V.string().optional()}),CH=V.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),kH=V.object({type:V.string().array().nonempty(),achievedLevel:V.string().optional(),alignment:Y0.array().optional(),resultDescription:V.string().optional(),status:CH.optional(),value:V.string().optional()}).catchall(V.any()),M9=V.object({id:V.string().optional(),type:V.string().array().nonempty(),activityEndDate:V.string().optional(),activityStartDate:V.string().optional(),creditsEarned:V.number().optional(),achievement:MH.optional(),identifier:TH.array().optional(),image:J0.optional(),licenseNumber:V.string().optional(),narrative:V.string().optional(),result:kH.array().optional(),role:V.string().optional(),source:Tl.optional(),term:V.string().optional()}).catchall(V.any()),IH=V.object({id:V.string().optional(),type:V.string().array().nonempty(),narrative:V.string().optional(),name:V.string().optional(),description:V.string().optional(),genre:V.string().optional(),audience:V.string().optional()}).catchall(V.any()),DH=W0.extend({name:V.string().optional(),description:V.string().optional(),image:J0.optional(),credentialSubject:M9.or(M9.array()),endorsement:W0.array().optional(),evidence:IH.array().optional()}),zte=DH.extend({proof:la.or(la.array())}),jte=V.object({checks:V.string().array(),warnings:V.string().array(),errors:V.string().array()}),k9=V.enum(["Success","Failed","Error"]),Gte=k9.enum,Vte=V.object({check:V.string(),status:k9,message:V.string().optional(),details:V.string().optional()}),Wte=V.object({title:V.string().optional(),createdAt:V.string().optional(),issuer:Tl.optional(),issuee:Tl.optional(),credentialSubject:Yg.optional()}),Jte=V.object({id:V.string(),uri:V.string()}).catchall(V.any()),Zte=V.object({limit:V.number(),cursor:V.string().optional()}),I9=V.object({cursor:V.string().optional(),hasMore:V.boolean()}),OH=V.object({kty:V.string(),crv:V.string(),x:V.string(),y:V.string().optional(),n:V.string().optional(),d:V.string()}),RH=V.object({alg:V.string(),iv:V.string(),tag:V.string(),epk:OH.partial().optional(),kid:V.string().optional(),apv:V.string().optional(),apu:V.string().optional()}),NH=V.object({header:RH,encrypted_key:V.string()}),PH=V.object({protected:V.string(),iv:V.string(),ciphertext:V.string(),tag:V.string(),aad:V.string().optional(),recipients:NH.array().optional()}),D9=V.object({encryptedRecord:PH,fields:V.string().array()}).catchall(V.any()),ere=I9.extend({records:D9.array()}),LH=D9.extend({id:V.string()}),tre=I9.extend({records:LH.array()}),Xg=V.object({profileId:V.string().min(3).max(40),displayName:V.string().default(""),did:V.string(),email:V.string().optional(),image:V.string().optional(),isServiceProfile:V.boolean().default(!1).optional(),notificationsWebhook:V.string().url().startsWith("https://").optional()}),nre=V.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),ire=V.object({uri:V.string(),to:V.string(),from:V.string(),sent:V.string().datetime(),received:V.string().datetime().optional()}),BH=V.enum(["DRAFT","LIVE"]),ore=V.object({uri:V.string(),name:V.string().optional(),type:V.string().optional(),category:V.string().optional(),status:BH.optional()}),sre=V.object({to:Xg,from:V.string(),received:V.string().optional()}),UH=V.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED"]),$H=V.object({title:V.string().optional(),body:V.string().optional()}),FH=V.object({vcUris:V.array(V.string()).optional(),vpUris:V.array(V.string()).optional()}),are=V.object({type:UH,to:Xg.partial().and(V.object({did:V.string()})),from:Xg.partial().and(V.object({did:V.string()})),message:$H.optional(),data:FH.optional(),sent:V.string().datetime().optional()}),fre=V.object({endpoint:V.string(),name:V.string(),did:V.string().optional()}),cre=V.object({ttlSeconds:V.number().optional(),totalUses:V.number().optional()}),qH=V.object({endpoint:V.string()}),ure=V.object({signingAuthority:qH,relationship:V.object({name:V.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:V.string()})});var X0=o(t=>`lc:ceramic:${t}`,"streamIdToCeramicURI");var Qg=V.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 Z0=o(async(t,{ceramicEndpoint:e,defaultContentFamily:r})=>{let n=new Al(e),i=o(async(R,D,P,J)=>t.invoke.didResolver(R,J),"learnCardResolver"),a={...m8.getResolver(),web:i},c=new Va({resolver:a});n.did=c;let u=t.invoke.getKey(),m=new Qu(Z5(u));n.did.setProvider(m),await n.did.authenticate();let v=new gl({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,O9.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 Cl.or(Zg).parseAsync(R),X0(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 Qg.spa(D);if(!P.success)return;let J=P.data.split(":")[2];try{return await Cl.or(Zg).parseAsync(await S(J))}catch(L){R.debug?.(L);return}}},methods:{publishContentToCeramic:async(R,D,P)=>X0(await x(D,{},{},P)),readContentFromCeramic:async(R,D)=>S(D),getCeramicClient:()=>n,getDIDObject:()=>n.did}}},"getCeramicPlugin");var HH=Z0;
|
|
818
818
|
/*!
|
|
819
819
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
820
820
|
* (c) 2017-2021 Joachim Wester
|