@mapxus/mapxus-map-jp 9.1.0 → 9.2.0
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/index.css +1 -191
- package/dist/index.umd.js +27 -2
- package/dist/utils.cjs +13 -0
- package/es/context-DcBNN51L.mjs +8294 -0
- package/es/index.d.ts +260 -186
- package/es/index.mjs +7316 -2
- package/es/utils/index.mjs +36 -2
- package/package.json +16 -5
- package/dist/index.umd.js.LICENSE.txt +0 -14
- package/es/index.mjs.LICENSE.txt +0 -14
- package/es/utils/index.mjs.LICENSE.txt +0 -14
- package/lib/index.cjs +0 -2
- package/lib/index.cjs.LICENSE.txt +0 -14
- package/lib/utils/index.cjs +0 -2
- package/lib/utils/index.cjs.LICENSE.txt +0 -14
package/dist/utils.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const $r="9.2.0",_e={version:$r},br=_e.version,Jr="https://map-api.mapxus.co.jp/accounts/v1/auth/secure-token",Qr="https://map-sdk.mapxus.co.jp/prod/static/resources/manifest-z6frc5.dat",wr=10,vr=1;var ti={value:()=>{}};function tn(){for(var t=0,e=arguments.length,r={},c;t<e;++t){if(!(c=arguments[t]+"")||c in r||/[\s.]/.test(c))throw new Error("illegal type: "+c);r[c]=[]}return new ve(r)}function ve(t){this._=t}function ei(t,e){return t.trim().split(/^|\s+/).map(function(r){var c="",l=r.indexOf(".");if(l>=0&&(c=r.slice(l+1),r=r.slice(0,l)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:c}})}ve.prototype=tn.prototype={constructor:ve,on:function(t,e){var r=this._,c=ei(t+"",r),l,a=-1,h=c.length;if(arguments.length<2){for(;++a<h;)if((l=(t=c[a]).type)&&(l=ni(r[l],t.name)))return l;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<h;)if(l=(t=c[a]).type)r[l]=mn(r[l],t.name,e);else if(e==null)for(l in r)r[l]=mn(r[l],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new ve(t)},call:function(t,e){if((l=arguments.length-2)>0)for(var r=new Array(l),c=0,l,a;c<l;++c)r[c]=arguments[c+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],c=0,l=a.length;c<l;++c)a[c].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var c=this._[t],l=0,a=c.length;l<a;++l)c[l].value.apply(e,r)}};function ni(t,e){for(var r=0,c=t.length,l;r<c;++r)if((l=t[r]).name===e)return l.value}function mn(t,e,r){for(var c=0,l=t.length;c<l;++c)if(t[c].name===e){t[c]=ti,t=t.slice(0,c).concat(t.slice(c+1));break}return r!=null&&t.push({name:e,value:r}),t}var ze=function(){return ze=Object.assign||function(e){for(var r,c=1,l=arguments.length;c<l;c++){r=arguments[c];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ze.apply(this,arguments)};function Ft(t,e,r,c){function l(a){return a instanceof r?a:new r(function(h){h(a)})}return new(r||(r=Promise))(function(a,h){function d(H){try{C(c.next(H))}catch(b){h(b)}}function O(H){try{C(c.throw(H))}catch(b){h(b)}}function C(H){H.done?a(H.value):l(H.value).then(d,O)}C((c=c.apply(t,e||[])).next())})}function Dt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},c,l,a,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=d(0),h.throw=d(1),h.return=d(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function d(C){return function(H){return O([C,H])}}function O(C){if(c)throw new TypeError("Generator is already executing.");for(;h&&(h=0,C[0]&&(r=0)),r;)try{if(c=1,l&&(a=C[0]&2?l.return:C[0]?l.throw||((a=l.return)&&a.call(l),0):l.next)&&!(a=a.call(l,C[1])).done)return a;switch(l=0,a&&(C=[C[0]&2,a.value]),C[0]){case 0:case 1:a=C;break;case 4:return r.label++,{value:C[1],done:!1};case 5:r.label++,l=C[1],C=[0];continue;case 7:C=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(C[0]===6||C[0]===2)){r=0;continue}if(C[0]===3&&(!a||C[1]>a[0]&&C[1]<a[3])){r.label=C[1];break}if(C[0]===6&&r.label<a[1]){r.label=a[1],a=C;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(C);break}a[2]&&r.ops.pop(),r.trys.pop();continue}C=e.call(t,r)}catch(H){C=[6,H],l=0}finally{c=a=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}}function Er(t,e,r){if(r||arguments.length===2)for(var c=0,l=e.length,a;c<l;c++)(a||!(c in e))&&(a||(a=Array.prototype.slice.call(e,0,c)),a[c]=e[c]);return t.concat(a||Array.prototype.slice.call(e))}var Br="4.6.2";function xe(t,e){return new Promise(function(r){return setTimeout(r,t,e)})}function ri(){return new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})}function ii(t,e){e===void 0&&(e=1/0);var r=window.requestIdleCallback;return r?new Promise(function(c){return r.call(window,function(){return c()},{timeout:e})}):xe(Math.min(t,e))}function _r(t){return!!t&&typeof t.then=="function"}function gn(t,e){try{var r=t();_r(r)?r.then(function(c){return e(!0,c)},function(c){return e(!1,c)}):e(!0,r)}catch(c){e(!1,c)}}function pn(t,e,r){return r===void 0&&(r=16),Ft(this,void 0,void 0,function(){var c,l,a,h;return Dt(this,function(d){switch(d.label){case 0:c=Array(t.length),l=Date.now(),a=0,d.label=1;case 1:return a<t.length?(c[a]=e(t[a],a),h=Date.now(),h>=l+r?(l=h,[4,ri()]):[3,3]):[3,4];case 2:d.sent(),d.label=3;case 3:return++a,[3,1];case 4:return[2,c]}})})}function le(t){return t.then(void 0,function(){}),t}function oi(t,e){for(var r=0,c=t.length;r<c;++r)if(t[r]===e)return!0;return!1}function si(t,e){return!oi(t,e)}function en(t){return parseInt(t)}function Mt(t){return parseFloat(t)}function Kt(t,e){return typeof t=="number"&&isNaN(t)?e:t}function Rt(t){return t.reduce(function(e,r){return e+(r?1:0)},0)}function xr(t,e){if(e===void 0&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var r=1/e;return Math.round(t*r)/r}function ci(t){for(var e,r,c="Unexpected syntax '".concat(t,"'"),l=/^\s*([a-z-]*)(.*)$/i.exec(t),a=l[1]||void 0,h={},d=/([.:#][\w-]+|\[.+?\])/gi,O=function(k,B){h[k]=h[k]||[],h[k].push(B)};;){var C=d.exec(l[2]);if(!C)break;var H=C[0];switch(H[0]){case".":O("class",H.slice(1));break;case"#":O("id",H.slice(1));break;case"[":{var b=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(H);if(b)O(b[1],(r=(e=b[4])!==null&&e!==void 0?e:b[5])!==null&&r!==void 0?r:"");else throw new Error(c);break}default:throw new Error(c)}}return[a,h]}function ai(t){for(var e=new Uint8Array(t.length),r=0;r<t.length;r++){var c=t.charCodeAt(r);if(c>127)return new TextEncoder().encode(t);e[r]=c}return e}function Zt(t,e){var r=t[0]>>>16,c=t[0]&65535,l=t[1]>>>16,a=t[1]&65535,h=e[0]>>>16,d=e[0]&65535,O=e[1]>>>16,C=e[1]&65535,H=0,b=0,k=0,B=0;B+=a+C,k+=B>>>16,B&=65535,k+=l+O,b+=k>>>16,k&=65535,b+=c+d,H+=b>>>16,b&=65535,H+=r+h,H&=65535,t[0]=H<<16|b,t[1]=k<<16|B}function Nt(t,e){var r=t[0]>>>16,c=t[0]&65535,l=t[1]>>>16,a=t[1]&65535,h=e[0]>>>16,d=e[0]&65535,O=e[1]>>>16,C=e[1]&65535,H=0,b=0,k=0,B=0;B+=a*C,k+=B>>>16,B&=65535,k+=l*C,b+=k>>>16,k&=65535,k+=a*O,b+=k>>>16,k&=65535,b+=c*C,H+=b>>>16,b&=65535,b+=l*O,H+=b>>>16,b&=65535,b+=a*d,H+=b>>>16,b&=65535,H+=r*C+c*O+l*d+a*h,H&=65535,t[0]=H<<16|b,t[1]=k<<16|B}function te(t,e){var r=t[0];e%=64,e===32?(t[0]=t[1],t[1]=r):e<32?(t[0]=r<<e|t[1]>>>32-e,t[1]=t[1]<<e|r>>>32-e):(e-=32,t[0]=t[1]<<e|r>>>32-e,t[1]=r<<e|t[1]>>>32-e)}function Ot(t,e){e%=64,e!==0&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function St(t,e){t[0]^=e[0],t[1]^=e[1]}var ui=[4283543511,3981806797],fi=[3301882366,444984403];function bn(t){var e=[0,t[0]>>>1];St(t,e),Nt(t,ui),e[1]=t[0]>>>1,St(t,e),Nt(t,fi),e[1]=t[0]>>>1,St(t,e)}var ge=[2277735313,289559509],pe=[1291169091,658871167],wn=[0,5],li=[0,1390208809],di=[0,944331445];function hi(t,e){var r=ai(t);e=e||0;var c=[0,r.length],l=c[1]%16,a=c[1]-l,h=[0,e],d=[0,e],O=[0,0],C=[0,0],H;for(H=0;H<a;H=H+16)O[0]=r[H+4]|r[H+5]<<8|r[H+6]<<16|r[H+7]<<24,O[1]=r[H]|r[H+1]<<8|r[H+2]<<16|r[H+3]<<24,C[0]=r[H+12]|r[H+13]<<8|r[H+14]<<16|r[H+15]<<24,C[1]=r[H+8]|r[H+9]<<8|r[H+10]<<16|r[H+11]<<24,Nt(O,ge),te(O,31),Nt(O,pe),St(h,O),te(h,27),Zt(h,d),Nt(h,wn),Zt(h,li),Nt(C,pe),te(C,33),Nt(C,ge),St(d,C),te(d,31),Zt(d,h),Nt(d,wn),Zt(d,di);O[0]=0,O[1]=0,C[0]=0,C[1]=0;var b=[0,0];switch(l){case 15:b[1]=r[H+14],Ot(b,48),St(C,b);case 14:b[1]=r[H+13],Ot(b,40),St(C,b);case 13:b[1]=r[H+12],Ot(b,32),St(C,b);case 12:b[1]=r[H+11],Ot(b,24),St(C,b);case 11:b[1]=r[H+10],Ot(b,16),St(C,b);case 10:b[1]=r[H+9],Ot(b,8),St(C,b);case 9:b[1]=r[H+8],St(C,b),Nt(C,pe),te(C,33),Nt(C,ge),St(d,C);case 8:b[1]=r[H+7],Ot(b,56),St(O,b);case 7:b[1]=r[H+6],Ot(b,48),St(O,b);case 6:b[1]=r[H+5],Ot(b,40),St(O,b);case 5:b[1]=r[H+4],Ot(b,32),St(O,b);case 4:b[1]=r[H+3],Ot(b,24),St(O,b);case 3:b[1]=r[H+2],Ot(b,16),St(O,b);case 2:b[1]=r[H+1],Ot(b,8),St(O,b);case 1:b[1]=r[H],St(O,b),Nt(O,ge),te(O,31),Nt(O,pe),St(h,O)}return St(h,c),St(d,c),Zt(h,d),Zt(d,h),bn(h),bn(d),Zt(h,d),Zt(d,h),("00000000"+(h[0]>>>0).toString(16)).slice(-8)+("00000000"+(h[1]>>>0).toString(16)).slice(-8)+("00000000"+(d[0]>>>0).toString(16)).slice(-8)+("00000000"+(d[1]>>>0).toString(16)).slice(-8)}function yi(t){var e;return ze({name:t.name,message:t.message,stack:(e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
2
|
+
`)},t)}function mi(t){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))}function gi(t){return typeof t!="function"}function pi(t,e){var r=le(new Promise(function(c){var l=Date.now();gn(t.bind(null,e),function(){for(var a=[],h=0;h<arguments.length;h++)a[h]=arguments[h];var d=Date.now()-l;if(!a[0])return c(function(){return{error:a[1],duration:d}});var O=a[1];if(gi(O))return c(function(){return{value:O,duration:d}});c(function(){return new Promise(function(C){var H=Date.now();gn(O,function(){for(var b=[],k=0;k<arguments.length;k++)b[k]=arguments[k];var B=d+Date.now()-H;if(!b[0])return C({error:b[1],duration:B});C({value:b[1],duration:B})})})})})}));return function(){return r.then(function(l){return l()})}}function bi(t,e,r,c){var l=Object.keys(t).filter(function(h){return si(r,h)}),a=le(pn(l,function(h){return pi(t[h],e)},c));return function(){return Ft(this,void 0,void 0,function(){var d,O,C,H,b;return Dt(this,function(k){switch(k.label){case 0:return[4,a];case 1:return d=k.sent(),[4,pn(d,function(B){return le(B())},c)];case 2:return O=k.sent(),[4,Promise.all(O)];case 3:for(C=k.sent(),H={},b=0;b<l.length;++b)H[l[b]]=C[b];return[2,H]}})})}}function Sr(){var t=window,e=navigator;return Rt(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function wi(){var t=window,e=navigator;return Rt(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!Sr()}function de(){var t=window,e=navigator;return Rt(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,(e.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function Vt(){var t=window,e=navigator;return Rt(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,e.vendor.indexOf("Apple")===0,"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function nn(){var t=window,e=t.HTMLElement,r=t.Document;return Rt(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),r&&"pointerLockElement"in r.prototype])>=4}function he(){var t=window;return mi(t.print)&&String(t.browser)==="[object WebPageNamespace]"}function Ir(){var t,e,r=window;return Rt(["buildID"in navigator,"MozAppearance"in((e=(t=document.documentElement)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function vi(){var t=window;return Rt([!("MediaSettingsRange"in t),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3}function Ei(){var t=window,e=t.URLPattern;return Rt(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Bi(){var t=window;return Rt(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}function ye(){var t=window,e=navigator,r=t.CSS,c=t.HTMLButtonElement;return Rt([!("getStorageUpdates"in e),c&&"popover"in c.prototype,"CSSCounterStyleRule"in t,r.supports("font-size-adjust: ex-height 0.5"),r.supports("text-transform: full-width")])>=4}function _i(){if(navigator.platform==="iPad")return!0;var t=screen,e=t.width/t.height;return Rt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}function xi(){var t=document;return t.fullscreenElement||t.msFullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||null}function Si(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function rn(){var t=de(),e=Ir(),r=window,c=navigator,l="connection";return t?Rt([!("SharedWorker"in r),c[l]&&"ontypechange"in c[l],!("sinkId"in new Audio)])>=2:e?Rt(["onorientationchange"in r,"orientation"in r,/android/i.test(c.appVersion)])>=2:!1}function Ii(){var t=navigator,e=window,r=Audio.prototype,c=e.visualViewport;return Rt(["srLatency"in r,"srChannelCount"in r,"devicePosture"in t,c&&"segments"in c,"getTextInformation"in Image.prototype])>=3}function Ai(){return Ci()?-4:Ti()}function Ti(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(Li())return-1;var r=4500,c=5e3,l=new e(1,c,44100),a=l.createOscillator();a.type="triangle",a.frequency.value=1e4;var h=l.createDynamicsCompressor();h.threshold.value=-50,h.knee.value=40,h.ratio.value=12,h.attack.value=0,h.release.value=.25,a.connect(h),h.connect(l.destination),a.start(0);var d=Ri(l),O=d[0],C=d[1],H=le(O.then(function(b){return Hi(b.getChannelData(0).subarray(r))},function(b){if(b.name==="timeout"||b.name==="suspended")return-3;throw b}));return function(){return C(),H}}function Li(){return Vt()&&!nn()&&!Bi()}function Ci(){return Vt()&&ye()&&he()||de()&&Ii()&&Ei()}function Ri(t){var e=3,r=500,c=500,l=5e3,a=function(){},h=new Promise(function(d,O){var C=!1,H=0,b=0;t.oncomplete=function(p){return d(p.renderedBuffer)};var k=function(){setTimeout(function(){return O(vn("timeout"))},Math.min(c,b+l-Date.now()))},B=function(){try{var p=t.startRendering();switch(_r(p)&&le(p),t.state){case"running":b=Date.now(),C&&k();break;case"suspended":document.hidden||H++,C&&H>=e?O(vn("suspended")):setTimeout(B,r);break}}catch(S){O(S)}};B(),a=function(){C||(C=!0,b>0&&k())}});return[h,a]}function Hi(t){for(var e=0,r=0;r<t.length;++r)e+=Math.abs(t[r]);return e}function vn(t){var e=new Error(t);return e.name=t,e}function Ar(t,e,r){var c,l,a;return r===void 0&&(r=50),Ft(this,void 0,void 0,function(){var h,d;return Dt(this,function(O){switch(O.label){case 0:h=document,O.label=1;case 1:return h.body?[3,3]:[4,xe(r)];case 2:return O.sent(),[3,1];case 3:d=h.createElement("iframe"),O.label=4;case 4:return O.trys.push([4,,10,11]),[4,new Promise(function(C,H){var b=!1,k=function(){b=!0,C()},B=function(L){b=!0,H(L)};d.onload=k,d.onerror=B;var p=d.style;p.setProperty("display","block","important"),p.position="absolute",p.top="0",p.left="0",p.visibility="hidden",e&&"srcdoc"in d?d.srcdoc=e:d.src="about:blank",h.body.appendChild(d);var S=function(){var L,U;b||(((U=(L=d.contentWindow)===null||L===void 0?void 0:L.document)===null||U===void 0?void 0:U.readyState)==="complete"?k():setTimeout(S,10))};S()})];case 5:O.sent(),O.label=6;case 6:return!((l=(c=d.contentWindow)===null||c===void 0?void 0:c.document)===null||l===void 0)&&l.body?[3,8]:[4,xe(r)];case 7:return O.sent(),[3,6];case 8:return[4,t(d,d.contentWindow)];case 9:return[2,O.sent()];case 10:return(a=d.parentNode)===null||a===void 0||a.removeChild(d),[7];case 11:return[2]}})})}function Oi(t){for(var e=ci(t),r=e[0],c=e[1],l=document.createElement(r??"div"),a=0,h=Object.keys(c);a<h.length;a++){var d=h[a],O=c[d].join(" ");d==="style"?Ui(l.style,O):l.setAttribute(d,O)}return l}function Ui(t,e){for(var r=0,c=e.split(";");r<c.length;r++){var l=c[r],a=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(l);if(a){var h=a[1],d=a[2],O=a[4];t.setProperty(h,d,O||"")}}}function Pi(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(r){if(r instanceof Error&&r.name==="SecurityError")return!0;throw r}t=e}}var Ni="mmMwWLliI0O&1",ki="48px",ee=["monospace","sans-serif","serif"],En=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Mi(){var t=this;return Ar(function(e,r){var c=r.document;return Ft(t,void 0,void 0,function(){var l,a,h,d,O,C,H,b,k,B,p,S;return Dt(this,function(L){for(l=c.body,l.style.fontSize=ki,a=c.createElement("div"),a.style.setProperty("visibility","hidden","important"),h={},d={},O=function(U){var K=c.createElement("span"),W=K.style;return W.position="absolute",W.top="0",W.left="0",W.fontFamily=U,K.textContent=Ni,a.appendChild(K),K},C=function(U,K){return O("'".concat(U,"',").concat(K))},H=function(){return ee.map(O)},b=function(){for(var U={},K=function(P){U[P]=ee.map(function(Y){return C(P,Y)})},W=0,et=En;W<et.length;W++){var D=et[W];K(D)}return U},k=function(U){return ee.some(function(K,W){return U[W].offsetWidth!==h[K]||U[W].offsetHeight!==d[K]})},B=H(),p=b(),l.appendChild(a),S=0;S<ee.length;S++)h[ee[S]]=B[S].offsetWidth,d[ee[S]]=B[S].offsetHeight;return[2,En.filter(function(U){return k(p[U])})]})})})}function Vi(){var t=navigator.plugins;if(t){for(var e=[],r=0;r<t.length;++r){var c=t[r];if(c){for(var l=[],a=0;a<c.length;++a){var h=c[a];l.push({type:h.type,suffixes:h.suffixes})}e.push({name:c.name,description:c.description,mimeTypes:l})}}return e}}function Fi(){return Di(Yi())}function Di(t){var e,r=!1,c,l,a=Ki(),h=a[0],d=a[1];return ji(h,d)?(r=Gi(d),t?c=l="skipped":(e=Zi(h,d),c=e[0],l=e[1])):c=l="unsupported",{winding:r,geometry:c,text:l}}function Ki(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}function ji(t,e){return!!(e&&t.toDataURL)}function Gi(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}function Zi(t,e){qi(t,e);var r=Ae(t),c=Ae(t);if(r!==c)return["unstable","unstable"];Wi(t,e);var l=Ae(t);return[l,r]}function qi(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat("😃");e.fillText(r,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(r,4,45)}function Wi(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var r=0,c=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<c.length;r++){var l=c[r],a=l[0],h=l[1],d=l[2];e.fillStyle=a,e.beginPath(),e.arc(h,d,40,0,Math.PI*2,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,Math.PI*2,!0),e.arc(60,60,20,0,Math.PI*2,!0),e.fill("evenodd")}function Ae(t){return t.toDataURL()}function Yi(){return Vt()&&ye()&&he()}function zi(){var t=navigator,e=0,r;t.maxTouchPoints!==void 0?e=en(t.maxTouchPoints):t.msMaxTouchPoints!==void 0&&(e=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),r=!0}catch{r=!1}var c="ontouchstart"in window;return{maxTouchPoints:e,touchEvent:r,touchStart:c}}function Xi(){return navigator.oscpu}function $i(){var t=navigator,e=[],r=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(r!==void 0&&e.push([r]),Array.isArray(t.languages))de()&&vi()||e.push(t.languages);else if(typeof t.languages=="string"){var c=t.languages;c&&e.push(c.split(","))}return e}function Ji(){return window.screen.colorDepth}function Qi(){return Kt(Mt(navigator.deviceMemory),void 0)}function to(){if(!(Vt()&&ye()&&he()))return eo()}function eo(){var t=screen,e=function(c){return Kt(en(c),null)},r=[e(t.width),e(t.height)];return r.sort().reverse(),r}var no=2500,ro=10,Ee,Te;function io(){if(Te===void 0){var t=function(){var e=Xe();$e(e)?Te=setTimeout(t,no):(Ee=e,Te=void 0)};t()}}function oo(){var t=this;return io(),function(){return Ft(t,void 0,void 0,function(){var e;return Dt(this,function(r){switch(r.label){case 0:return e=Xe(),$e(e)?Ee?[2,Er([],Ee,!0)]:xi()?[4,Si()]:[3,2]:[3,2];case 1:r.sent(),e=Xe(),r.label=2;case 2:return $e(e)||(Ee=e),[2,e]}})})}}function so(){var t=this;if(Vt()&&ye()&&he())return function(){return Promise.resolve(void 0)};var e=oo();return function(){return Ft(t,void 0,void 0,function(){var r,c;return Dt(this,function(l){switch(l.label){case 0:return[4,e()];case 1:return r=l.sent(),c=function(a){return a===null?null:xr(a,ro)},[2,[c(r[0]),c(r[1]),c(r[2]),c(r[3])]]}})})}}function Xe(){var t=screen;return[Kt(Mt(t.availTop),null),Kt(Mt(t.width)-Mt(t.availWidth)-Kt(Mt(t.availLeft),0),null),Kt(Mt(t.height)-Mt(t.availHeight)-Kt(Mt(t.availTop),0),null),Kt(Mt(t.availLeft),null)]}function $e(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function co(){return Kt(en(navigator.hardwareConcurrency),void 0)}function ao(){var t,e=(t=window.Intl)===null||t===void 0?void 0:t.DateTimeFormat;if(e){var r=new e().resolvedOptions().timeZone;if(r)return r}var c=-uo();return"UTC".concat(c>=0?"+":"").concat(c)}function uo(){var t=new Date().getFullYear();return Math.max(Mt(new Date(t,0,1).getTimezoneOffset()),Mt(new Date(t,6,1).getTimezoneOffset()))}function fo(){try{return!!window.sessionStorage}catch{return!0}}function lo(){try{return!!window.localStorage}catch{return!0}}function ho(){if(!(Sr()||wi()))try{return!!window.indexedDB}catch{return!0}}function yo(){return!!window.openDatabase}function mo(){return navigator.cpuClass}function go(){var t=navigator.platform;return t==="MacIntel"&&Vt()&&!nn()?_i()?"iPad":"iPhone":t}function po(){return navigator.vendor||""}function bo(){for(var t=[],e=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<r.length;e++){var c=r[e],l=window[c];l&&typeof l=="object"&&t.push(c)}return t.sort()}function wo(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=t.cookie.indexOf("cookietest=")!==-1;return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch{return!1}}function vo(){var t=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',t("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",t("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",t("LnNwb25zb3JpdA=="),".ylamainos",t("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",t("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",t("LmhlYWRlci1ibG9ja2VkLWFk"),t("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",t("I2FkXzMwMFgyNTA="),t("I2Jhbm5lcmZsb2F0MjI="),t("I2NhbXBhaWduLWJhbm5lcg=="),t("I0FkLUNvbnRlbnQ=")],adGuardChinese:[t("LlppX2FkX2FfSA=="),t("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",t("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),t("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",t("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",t("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",t("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),t("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),t("LmFkZ29vZ2xl"),t("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[t("YW1wLWF1dG8tYWRz"),t("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",t("I2FkX2ludmlld19hcmVh")],adGuardRussian:[t("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),t("LnJlY2xhbWE="),'div[id^="smi2adblock"]',t("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[t("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),t("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",t("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),t("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),t("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",t("I3Jla2xhbWk="),t("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),t("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),t("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[t("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",t("LndpZGdldF9wb19hZHNfd2lkZ2V0"),t("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",t("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[t("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),t("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",t("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",t("I3Jla2xhbW5pLWJveA=="),t("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",t("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[t("I2FkdmVydGVudGll"),t("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",t("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",t("LnNwb25zb3JsaW5rZ3J1ZW4="),t("I3dlcmJ1bmdza3k="),t("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),t("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[t("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",t("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[t("LnJla2xhbW9zX3RhcnBhcw=="),t("LnJla2xhbW9zX251b3JvZG9z"),t("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),t("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),t("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[t("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[t("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),t("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",t("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[t("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),t("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),t("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",t("LmFkX19tYWlu"),t("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[t("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[t("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),t("I2xpdmVyZUFkV3JhcHBlcg=="),t("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),t("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[t("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",t("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),t("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),t("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[t("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),t("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),t("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",t("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),t("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),t("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),t("ZGl2I3NrYXBpZWNfYWQ=")],ro:[t("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),t("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[t("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),t("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),t("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",t("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),t("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",t("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Eo(t){var e=t===void 0?{}:t,r=e.debug;return Ft(this,void 0,void 0,function(){var c,l,a,h,d,O;return Dt(this,function(C){switch(C.label){case 0:return Bo()?(c=vo(),l=Object.keys(c),a=(O=[]).concat.apply(O,l.map(function(H){return c[H]})),[4,_o(a)]):[2,void 0];case 1:return h=C.sent(),r&&xo(c,h),d=l.filter(function(H){var b=c[H],k=Rt(b.map(function(B){return h[B]}));return k>b.length*.6}),d.sort(),[2,d]}})})}function Bo(){return Vt()||rn()}function _o(t){var e;return Ft(this,void 0,void 0,function(){var r,c,l,a,O,h,d,O;return Dt(this,function(C){switch(C.label){case 0:for(r=document,c=r.createElement("div"),l=new Array(t.length),a={},Bn(c),O=0;O<t.length;++O)h=Oi(t[O]),h.tagName==="DIALOG"&&h.show(),d=r.createElement("div"),Bn(d),d.appendChild(h),c.appendChild(d),l[O]=h;C.label=1;case 1:return r.body?[3,3]:[4,xe(50)];case 2:return C.sent(),[3,1];case 3:r.body.appendChild(c);try{for(O=0;O<t.length;++O)l[O].offsetParent||(a[t[O]]=!0)}finally{(e=c.parentNode)===null||e===void 0||e.removeChild(c)}return[2,a]}})})}function Bn(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function xo(t,e){for(var r="DOM blockers debug:\n```",c=0,l=Object.keys(t);c<l.length;c++){var a=l[c];r+=`
|
|
3
|
+
`.concat(a,":");for(var h=0,d=t[a];h<d.length;h++){var O=d[h];r+=`
|
|
4
|
+
`.concat(e[O]?"🚫":"➡️"," ").concat(O)}}console.log("".concat(r,"\n```"))}function So(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var r=e[t];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}}function Io(){if(_n("inverted"))return!0;if(_n("none"))return!1}function _n(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function Ao(){if(xn("active"))return!0;if(xn("none"))return!1}function xn(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}var To=100;function Lo(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=To;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}}function Co(){if(ne("no-preference"))return 0;if(ne("high")||ne("more"))return 1;if(ne("low")||ne("less"))return-1;if(ne("forced"))return 10}function ne(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function Ro(){if(Sn("reduce"))return!0;if(Sn("no-preference"))return!1}function Sn(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function Ho(){if(In("reduce"))return!0;if(In("no-preference"))return!1}function In(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function Oo(){if(An("high"))return!0;if(An("standard"))return!1}function An(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var Bt=Math,Ct=function(){return 0};function Uo(){var t=Bt.acos||Ct,e=Bt.acosh||Ct,r=Bt.asin||Ct,c=Bt.asinh||Ct,l=Bt.atanh||Ct,a=Bt.atan||Ct,h=Bt.sin||Ct,d=Bt.sinh||Ct,O=Bt.cos||Ct,C=Bt.cosh||Ct,H=Bt.tan||Ct,b=Bt.tanh||Ct,k=Bt.exp||Ct,B=Bt.expm1||Ct,p=Bt.log1p||Ct,S=function(J){return Bt.pow(Bt.PI,J)},L=function(J){return Bt.log(J+Bt.sqrt(J*J-1))},U=function(J){return Bt.log(J+Bt.sqrt(J*J+1))},K=function(J){return Bt.log((1+J)/(1-J))/2},W=function(J){return Bt.exp(J)-1/Bt.exp(J)/2},et=function(J){return(Bt.exp(J)+1/Bt.exp(J))/2},D=function(J){return Bt.exp(J)-1},P=function(J){return(Bt.exp(2*J)-1)/(Bt.exp(2*J)+1)},Y=function(J){return Bt.log(1+J)};return{acos:t(.12312423423423424),acosh:e(1e308),acoshPf:L(1e154),asin:r(.12312423423423424),asinh:c(1),asinhPf:U(1),atanh:l(.5),atanhPf:K(.5),atan:a(.5),sin:h(-1e300),sinh:d(1),sinhPf:W(1),cos:O(10.000000000123),cosh:C(1),coshPf:et(1),tan:H(-1e300),tanh:b(1),tanhPf:P(1),exp:k(1),expm1:B(1),expm1Pf:D(1),log1p:p(10),log1pPf:Y(10),powPI:S(-100)}}var Po="mmMwWLliI0fiflO&1",Le={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function No(){return ko(function(t,e){for(var r={},c={},l=0,a=Object.keys(Le);l<a.length;l++){var h=a[l],d=Le[h],O=d[0],C=O===void 0?{}:O,H=d[1],b=H===void 0?Po:H,k=t.createElement("span");k.textContent=b,k.style.whiteSpace="nowrap";for(var B=0,p=Object.keys(C);B<p.length;B++){var S=p[B],L=C[S];L!==void 0&&(k.style[S]=L)}r[h]=k,e.append(t.createElement("br"),k)}for(var U=0,K=Object.keys(Le);U<K.length;U++){var h=K[U];c[h]=r[h].getBoundingClientRect().width}return c})}function ko(t,e){return e===void 0&&(e=4e3),Ar(function(r,c){var l=c.document,a=l.body,h=a.style;h.width="".concat(e,"px"),h.webkitTextSizeAdjust=h.textSizeAdjust="none",de()?a.style.zoom="".concat(1/c.devicePixelRatio):Vt()&&(a.style.zoom="reset");var d=l.createElement("div");return d.textContent=Er([],Array(e/20<<0),!0).map(function(){return"word"}).join(" "),a.appendChild(d),t(l,a)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Mo(){return navigator.pdfViewerEnabled}function Vo(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]}function Fo(){var t=window.ApplePaySession;if(typeof t?.canMakePayments!="function")return-1;if(Do())return-3;try{return t.canMakePayments()?1:0}catch(e){return Ko(e)}}var Do=Pi;function Ko(t){if(t instanceof Error&&t.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}function jo(){var t,e=document.createElement("a"),r=(t=e.attributionSourceId)!==null&&t!==void 0?t:e.attributionsourceid;return r===void 0?void 0:String(r)}var Tr=-1,Lr=-2,Go=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Zo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),qo=["FRAGMENT_SHADER","VERTEX_SHADER"],Wo=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Cr="WEBGL_debug_renderer_info",Yo="WEBGL_polygon_mode";function zo(t){var e,r,c,l,a,h,d=t.cache,O=Rr(d);if(!O)return Tr;if(!Or(O))return Lr;var C=Hr()?null:O.getExtension(Cr);return{version:((e=O.getParameter(O.VERSION))===null||e===void 0?void 0:e.toString())||"",vendor:((r=O.getParameter(O.VENDOR))===null||r===void 0?void 0:r.toString())||"",vendorUnmasked:C?(c=O.getParameter(C.UNMASKED_VENDOR_WEBGL))===null||c===void 0?void 0:c.toString():"",renderer:((l=O.getParameter(O.RENDERER))===null||l===void 0?void 0:l.toString())||"",rendererUnmasked:C?(a=O.getParameter(C.UNMASKED_RENDERER_WEBGL))===null||a===void 0?void 0:a.toString():"",shadingLanguageVersion:((h=O.getParameter(O.SHADING_LANGUAGE_VERSION))===null||h===void 0?void 0:h.toString())||""}}function Xo(t){var e=t.cache,r=Rr(e);if(!r)return Tr;if(!Or(r))return Lr;var c=r.getSupportedExtensions(),l=r.getContextAttributes(),a=[],h=[],d=[],O=[],C=[];if(l)for(var H=0,b=Object.keys(l);H<b.length;H++){var k=b[H];h.push("".concat(k,"=").concat(l[k]))}for(var B=Tn(r),p=0,S=B;p<S.length;p++){var L=S[p],U=r[L];d.push("".concat(L,"=").concat(U).concat(Go.has(U)?"=".concat(r.getParameter(U)):""))}if(c)for(var K=0,W=c;K<W.length;K++){var et=W[K];if(!(et===Cr&&Hr()||et===Yo&&Qo())){var D=r.getExtension(et);if(!D){a.push(et);continue}for(var P=0,Y=Tn(D);P<Y.length;P++){var L=Y[P],U=D[L];O.push("".concat(L,"=").concat(U).concat(Zo.has(U)?"=".concat(r.getParameter(U)):""))}}}for(var J=0,Z=qo;J<Z.length;J++)for(var $=Z[J],tt=0,nt=Wo;tt<nt.length;tt++){var X=nt[tt],z=$o(r,$,X);C.push("".concat($,".").concat(X,"=").concat(z.join(",")))}return O.sort(),d.sort(),{contextAttributes:h,parameters:d,shaderPrecisions:C,extensions:c,extensionParameters:O,unsupportedExtensions:a}}function Rr(t){if(t.webgl)return t.webgl.context;var e=document.createElement("canvas"),r;e.addEventListener("webglCreateContextError",function(){return r=void 0});for(var c=0,l=["webgl","experimental-webgl"];c<l.length;c++){var a=l[c];try{r=e.getContext(a)}catch{}if(r)break}return t.webgl={context:r},r}function $o(t,e,r){var c=t.getShaderPrecisionFormat(t[e],t[r]);return c?[c.rangeMin,c.rangeMax,c.precision]:[]}function Tn(t){var e=Object.keys(t.__proto__);return e.filter(Jo)}function Jo(t){return typeof t=="string"&&!t.match(/[^A-Z0-9_x]/)}function Hr(){return Ir()}function Qo(){return de()||Vt()}function Or(t){return typeof t.getParameter=="function"}function ts(){var t=rn()||Vt();if(!t)return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function es(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return!e&&e!==""?-3:e}var ns={fonts:Mi,domBlockers:Eo,fontPreferences:No,audio:Ai,screenFrame:so,canvas:Fi,osCpu:Xi,languages:$i,colorDepth:Ji,deviceMemory:Qi,screenResolution:to,hardwareConcurrency:co,timezone:ao,sessionStorage:fo,localStorage:lo,indexedDB:ho,openDatabase:yo,cpuClass:mo,platform:go,plugins:Vi,touchSupport:zi,vendor:po,vendorFlavors:bo,cookiesEnabled:wo,colorGamut:So,invertedColors:Io,forcedColors:Ao,monochrome:Lo,contrast:Co,reducedMotion:Ro,reducedTransparency:Ho,hdr:Oo,math:Uo,pdfViewerEnabled:Mo,architecture:Vo,applePay:Fo,privateClickMeasurement:jo,audioBaseLatency:ts,dateTimeLocale:es,webGlBasics:zo,webGlExtensions:Xo};function rs(t){return bi(ns,t,[])}var is="$ if upgrade to Pro: https://fpjs.dev/pro";function os(t){var e=ss(t),r=cs(e);return{score:e,comment:is.replace(/\$/g,"".concat(r))}}function ss(t){if(rn())return .4;if(Vt())return nn()&&!(ye()&&he())?.5:.3;var e="value"in t.platform?t.platform.value:"";return/^Win/.test(e)?.6:/^Mac/.test(e)?.5:.7}function cs(t){return xr(.99+.01*t,1e-4)}function as(t){for(var e="",r=0,c=Object.keys(t).sort();r<c.length;r++){var l=c[r],a=t[l],h="error"in a?"error":JSON.stringify(a.value);e+="".concat(e?"|":"").concat(l.replace(/([:|\\])/g,"\\$1"),":").concat(h)}return e}function Ur(t){return JSON.stringify(t,function(e,r){return r instanceof Error?yi(r):r},2)}function Pr(t){return hi(as(t))}function us(t){var e,r=os(t);return{get visitorId(){return e===void 0&&(e=Pr(this.components)),e},set visitorId(c){e=c},confidence:r,components:t,version:Br}}function fs(t){return t===void 0&&(t=50),ii(t,t*2)}function ls(t,e){var r=Date.now();return{get:function(c){return Ft(this,void 0,void 0,function(){var l,a,h;return Dt(this,function(d){switch(d.label){case 0:return l=Date.now(),[4,t()];case 1:return a=d.sent(),h=us(a),(e||c?.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(h.version,`
|
|
5
|
+
userAgent: `).concat(navigator.userAgent,`
|
|
6
|
+
timeBetweenLoadAndGet: `).concat(l-r,`
|
|
7
|
+
visitorId: `).concat(h.visitorId,`
|
|
8
|
+
components: `).concat(Ur(a),"\n```")),[2,h]}})})}}}function ds(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(Br,"/npm-monitoring"),!0),t.send()}catch(e){console.error(e)}}function hs(t){var e;return t===void 0&&(t={}),Ft(this,void 0,void 0,function(){var r,c,l;return Dt(this,function(a){switch(a.label){case 0:return(!((e=t.monitoring)!==null&&e!==void 0)||e)&&ds(),r=t.delayFallback,c=t.debug,[4,fs(r)];case 1:return a.sent(),l=rs({cache:{},debug:c}),[2,ls(l,c)]}})})}var ys={load:hs,hashComponents:Pr,componentsToDebugString:Ur};let Nr=[];const kr={[Symbol.for("mapxus/callers-register")]:t=>{Nr=t}};function ms(){return Nr}const Se="-webkit-extension-67d8e3e8-";let Be=null;async function gs(){let t=sessionStorage.getItem(Se);if(!t)try{Mr(),await Vr(Date.now()),t=sessionStorage.getItem(Se)}catch(e){throw new Error("Failed to fetch public key: "+e)}return t}function Mr(){sessionStorage.removeItem(Se),Be&&(clearTimeout(Be),Be=null)}function ps(t){sessionStorage.setItem(Se,t)}async function Vr(t){try{const e=await fetch(`${Qr}?timestamp=${t}`,{method:"GET",headers:{"Content-Type":"text/plain"}}),{headers:r}=e,c=parseInt(r.get("x-retry-in"));Be=setTimeout(async()=>{await Vr(t)},c*1e3),ps(await e.text())}catch(e){throw e}}function on(){return jt.getInstance().getIdentifier()}function Fr(t){jt.getInstance().setTokenGetter(t)}function Dr(){return jt.getInstance().setupTokenManager()}var Ce={},ie={},Ln;function bs(){if(Ln)return ie;Ln=1,ie.byteLength=d,ie.toByteArray=C,ie.fromByteArray=k;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,a=c.length;l<a;++l)t[l]=c[l],e[c.charCodeAt(l)]=l;e[45]=62,e[95]=63;function h(B){var p=B.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=B.indexOf("=");S===-1&&(S=p);var L=S===p?0:4-S%4;return[S,L]}function d(B){var p=h(B),S=p[0],L=p[1];return(S+L)*3/4-L}function O(B,p,S){return(p+S)*3/4-S}function C(B){var p,S=h(B),L=S[0],U=S[1],K=new r(O(B,L,U)),W=0,et=U>0?L-4:L,D;for(D=0;D<et;D+=4)p=e[B.charCodeAt(D)]<<18|e[B.charCodeAt(D+1)]<<12|e[B.charCodeAt(D+2)]<<6|e[B.charCodeAt(D+3)],K[W++]=p>>16&255,K[W++]=p>>8&255,K[W++]=p&255;return U===2&&(p=e[B.charCodeAt(D)]<<2|e[B.charCodeAt(D+1)]>>4,K[W++]=p&255),U===1&&(p=e[B.charCodeAt(D)]<<10|e[B.charCodeAt(D+1)]<<4|e[B.charCodeAt(D+2)]>>2,K[W++]=p>>8&255,K[W++]=p&255),K}function H(B){return t[B>>18&63]+t[B>>12&63]+t[B>>6&63]+t[B&63]}function b(B,p,S){for(var L,U=[],K=p;K<S;K+=3)L=(B[K]<<16&16711680)+(B[K+1]<<8&65280)+(B[K+2]&255),U.push(H(L));return U.join("")}function k(B){for(var p,S=B.length,L=S%3,U=[],K=16383,W=0,et=S-L;W<et;W+=K)U.push(b(B,W,W+K>et?et:W+K));return L===1?(p=B[S-1],U.push(t[p>>2]+t[p<<4&63]+"==")):L===2&&(p=(B[S-2]<<8)+B[S-1],U.push(t[p>>10]+t[p>>4&63]+t[p<<2&63]+"=")),U.join("")}return ie}var be={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Cn;function ws(){return Cn||(Cn=1,be.read=function(t,e,r,c,l){var a,h,d=l*8-c-1,O=(1<<d)-1,C=O>>1,H=-7,b=r?l-1:0,k=r?-1:1,B=t[e+b];for(b+=k,a=B&(1<<-H)-1,B>>=-H,H+=d;H>0;a=a*256+t[e+b],b+=k,H-=8);for(h=a&(1<<-H)-1,a>>=-H,H+=c;H>0;h=h*256+t[e+b],b+=k,H-=8);if(a===0)a=1-C;else{if(a===O)return h?NaN:(B?-1:1)*(1/0);h=h+Math.pow(2,c),a=a-C}return(B?-1:1)*h*Math.pow(2,a-c)},be.write=function(t,e,r,c,l,a){var h,d,O,C=a*8-l-1,H=(1<<C)-1,b=H>>1,k=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=c?0:a-1,p=c?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(d=isNaN(e)?1:0,h=H):(h=Math.floor(Math.log(e)/Math.LN2),e*(O=Math.pow(2,-h))<1&&(h--,O*=2),h+b>=1?e+=k/O:e+=k*Math.pow(2,1-b),e*O>=2&&(h++,O/=2),h+b>=H?(d=0,h=H):h+b>=1?(d=(e*O-1)*Math.pow(2,l),h=h+b):(d=e*Math.pow(2,b-1)*Math.pow(2,l),h=0));l>=8;t[r+B]=d&255,B+=p,d/=256,l-=8);for(h=h<<l|d,C+=l;C>0;t[r+B]=h&255,B+=p,h/=256,C-=8);t[r+B-p]|=S*128}),be}/*!
|
|
9
|
+
* The buffer module from node.js, for the browser.
|
|
10
|
+
*
|
|
11
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12
|
+
* @license MIT
|
|
13
|
+
*/var Rn;function vs(){return Rn||(Rn=1,(function(t){const e=bs(),r=ws(),c=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=K,t.INSPECT_MAX_BYTES=50;const l=2147483647;t.kMaxLength=l,d.TYPED_ARRAY_SUPPORT=a(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const f=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(f,n),f.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function h(f){if(f>l)throw new RangeError('The value "'+f+'" is invalid for option "size"');const n=new Uint8Array(f);return Object.setPrototypeOf(n,d.prototype),n}function d(f,n,i){if(typeof f=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(f)}return O(f,n,i)}d.poolSize=8192;function O(f,n,i){if(typeof f=="string")return k(f,n);if(ArrayBuffer.isView(f))return p(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(yt(f,ArrayBuffer)||f&&yt(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(yt(f,SharedArrayBuffer)||f&&yt(f.buffer,SharedArrayBuffer)))return S(f,n,i);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const w=f.valueOf&&f.valueOf();if(w!=null&&w!==f)return d.from(w,n,i);const N=L(f);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return d.from(f[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}d.from=function(f,n,i){return O(f,n,i)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function C(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function H(f,n,i){return C(f),f<=0?h(f):n!==void 0?typeof i=="string"?h(f).fill(n,i):h(f).fill(n):h(f)}d.alloc=function(f,n,i){return H(f,n,i)};function b(f){return C(f),h(f<0?0:U(f)|0)}d.allocUnsafe=function(f){return b(f)},d.allocUnsafeSlow=function(f){return b(f)};function k(f,n){if((typeof n!="string"||n==="")&&(n="utf8"),!d.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=W(f,n)|0;let w=h(i);const N=w.write(f,n);return N!==i&&(w=w.slice(0,N)),w}function B(f){const n=f.length<0?0:U(f.length)|0,i=h(n);for(let w=0;w<n;w+=1)i[w]=f[w]&255;return i}function p(f){if(yt(f,Uint8Array)){const n=new Uint8Array(f);return S(n.buffer,n.byteOffset,n.byteLength)}return B(f)}function S(f,n,i){if(n<0||f.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let w;return n===void 0&&i===void 0?w=new Uint8Array(f):i===void 0?w=new Uint8Array(f,n):w=new Uint8Array(f,n,i),Object.setPrototypeOf(w,d.prototype),w}function L(f){if(d.isBuffer(f)){const n=U(f.length)|0,i=h(n);return i.length===0||f.copy(i,0,0,n),i}if(f.length!==void 0)return typeof f.length!="number"||ht(f.length)?h(0):B(f);if(f.type==="Buffer"&&Array.isArray(f.data))return B(f.data)}function U(f){if(f>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return f|0}function K(f){return+f!=f&&(f=0),d.alloc(+f)}d.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==d.prototype},d.compare=function(n,i){if(yt(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),yt(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),!d.isBuffer(n)||!d.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let w=n.length,N=i.length;for(let Q=0,rt=Math.min(w,N);Q<rt;++Q)if(n[Q]!==i[Q]){w=n[Q],N=i[Q];break}return w<N?-1:N<w?1:0},d.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return d.alloc(0);let w;if(i===void 0)for(i=0,w=0;w<n.length;++w)i+=n[w].length;const N=d.allocUnsafe(i);let Q=0;for(w=0;w<n.length;++w){let rt=n[w];if(yt(rt,Uint8Array))Q+rt.length>N.length?(d.isBuffer(rt)||(rt=d.from(rt)),rt.copy(N,Q)):Uint8Array.prototype.set.call(N,rt,Q);else if(d.isBuffer(rt))rt.copy(N,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=rt.length}return N};function W(f,n){if(d.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||yt(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);const i=f.length,w=arguments.length>2&&arguments[2]===!0;if(!w&&i===0)return 0;let N=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return ut(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return lt(f).length;default:if(N)return w?-1:ut(f).length;n=(""+n).toLowerCase(),N=!0}}d.byteLength=W;function et(f,n,i){let w=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(f||(f="utf8");;)switch(f){case"hex":return _(this,n,i);case"utf8":case"utf-8":return z(this,n,i);case"ascii":return v(this,n,i);case"latin1":case"binary":return g(this,n,i);case"base64":return X(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,n,i);default:if(w)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),w=!0}}d.prototype._isBuffer=!0;function D(f,n,i){const w=f[n];f[n]=f[i],f[i]=w}d.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)D(this,i,i+1);return this},d.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)D(this,i,i+3),D(this,i+1,i+2);return this},d.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)D(this,i,i+7),D(this,i+1,i+6),D(this,i+2,i+5),D(this,i+3,i+4);return this},d.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?z(this,0,n):et.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(n){if(!d.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:d.compare(this,n)===0},d.prototype.inspect=function(){let n="";const i=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},c&&(d.prototype[c]=d.prototype.inspect),d.prototype.compare=function(n,i,w,N,Q){if(yt(n,Uint8Array)&&(n=d.from(n,n.offset,n.byteLength)),!d.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),w===void 0&&(w=n?n.length:0),N===void 0&&(N=0),Q===void 0&&(Q=this.length),i<0||w>n.length||N<0||Q>this.length)throw new RangeError("out of range index");if(N>=Q&&i>=w)return 0;if(N>=Q)return-1;if(i>=w)return 1;if(i>>>=0,w>>>=0,N>>>=0,Q>>>=0,this===n)return 0;let rt=Q-N,mt=w-i;const pt=Math.min(rt,mt),gt=this.slice(N,Q),vt=n.slice(i,w);for(let bt=0;bt<pt;++bt)if(gt[bt]!==vt[bt]){rt=gt[bt],mt=vt[bt];break}return rt<mt?-1:mt<rt?1:0};function P(f,n,i,w,N){if(f.length===0)return-1;if(typeof i=="string"?(w=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,ht(i)&&(i=N?0:f.length-1),i<0&&(i=f.length+i),i>=f.length){if(N)return-1;i=f.length-1}else if(i<0)if(N)i=0;else return-1;if(typeof n=="string"&&(n=d.from(n,w)),d.isBuffer(n))return n.length===0?-1:Y(f,n,i,w,N);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(f,n,i):Uint8Array.prototype.lastIndexOf.call(f,n,i):Y(f,[n],i,w,N);throw new TypeError("val must be string, number or Buffer")}function Y(f,n,i,w,N){let Q=1,rt=f.length,mt=n.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(f.length<2||n.length<2)return-1;Q=2,rt/=2,mt/=2,i/=2}function pt(vt,bt){return Q===1?vt[bt]:vt.readUInt16BE(bt*Q)}let gt;if(N){let vt=-1;for(gt=i;gt<rt;gt++)if(pt(f,gt)===pt(n,vt===-1?0:gt-vt)){if(vt===-1&&(vt=gt),gt-vt+1===mt)return vt*Q}else vt!==-1&&(gt-=gt-vt),vt=-1}else for(i+mt>rt&&(i=rt-mt),gt=i;gt>=0;gt--){let vt=!0;for(let bt=0;bt<mt;bt++)if(pt(f,gt+bt)!==pt(n,bt)){vt=!1;break}if(vt)return gt}return-1}d.prototype.includes=function(n,i,w){return this.indexOf(n,i,w)!==-1},d.prototype.indexOf=function(n,i,w){return P(this,n,i,w,!0)},d.prototype.lastIndexOf=function(n,i,w){return P(this,n,i,w,!1)};function J(f,n,i,w){i=Number(i)||0;const N=f.length-i;w?(w=Number(w),w>N&&(w=N)):w=N;const Q=n.length;w>Q/2&&(w=Q/2);let rt;for(rt=0;rt<w;++rt){const mt=parseInt(n.substr(rt*2,2),16);if(ht(mt))return rt;f[i+rt]=mt}return rt}function Z(f,n,i,w){return wt(ut(n,f.length-i),f,i,w)}function $(f,n,i,w){return wt(ft(n),f,i,w)}function tt(f,n,i,w){return wt(lt(n),f,i,w)}function nt(f,n,i,w){return wt(dt(n,f.length-i),f,i,w)}d.prototype.write=function(n,i,w,N){if(i===void 0)N="utf8",w=this.length,i=0;else if(w===void 0&&typeof i=="string")N=i,w=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(w)?(w=w>>>0,N===void 0&&(N="utf8")):(N=w,w=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Q=this.length-i;if((w===void 0||w>Q)&&(w=Q),n.length>0&&(w<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let rt=!1;for(;;)switch(N){case"hex":return J(this,n,i,w);case"utf8":case"utf-8":return Z(this,n,i,w);case"ascii":case"latin1":case"binary":return $(this,n,i,w);case"base64":return tt(this,n,i,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,n,i,w);default:if(rt)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),rt=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(f,n,i){return n===0&&i===f.length?e.fromByteArray(f):e.fromByteArray(f.slice(n,i))}function z(f,n,i){i=Math.min(f.length,i);const w=[];let N=n;for(;N<i;){const Q=f[N];let rt=null,mt=Q>239?4:Q>223?3:Q>191?2:1;if(N+mt<=i){let pt,gt,vt,bt;switch(mt){case 1:Q<128&&(rt=Q);break;case 2:pt=f[N+1],(pt&192)===128&&(bt=(Q&31)<<6|pt&63,bt>127&&(rt=bt));break;case 3:pt=f[N+1],gt=f[N+2],(pt&192)===128&&(gt&192)===128&&(bt=(Q&15)<<12|(pt&63)<<6|gt&63,bt>2047&&(bt<55296||bt>57343)&&(rt=bt));break;case 4:pt=f[N+1],gt=f[N+2],vt=f[N+3],(pt&192)===128&&(gt&192)===128&&(vt&192)===128&&(bt=(Q&15)<<18|(pt&63)<<12|(gt&63)<<6|vt&63,bt>65535&&bt<1114112&&(rt=bt))}}rt===null?(rt=65533,mt=1):rt>65535&&(rt-=65536,w.push(rt>>>10&1023|55296),rt=56320|rt&1023),w.push(rt),N+=mt}return M(w)}const y=4096;function M(f){const n=f.length;if(n<=y)return String.fromCharCode.apply(String,f);let i="",w=0;for(;w<n;)i+=String.fromCharCode.apply(String,f.slice(w,w+=y));return i}function v(f,n,i){let w="";i=Math.min(f.length,i);for(let N=n;N<i;++N)w+=String.fromCharCode(f[N]&127);return w}function g(f,n,i){let w="";i=Math.min(f.length,i);for(let N=n;N<i;++N)w+=String.fromCharCode(f[N]);return w}function _(f,n,i){const w=f.length;(!n||n<0)&&(n=0),(!i||i<0||i>w)&&(i=w);let N="";for(let Q=n;Q<i;++Q)N+=at[f[Q]];return N}function V(f,n,i){const w=f.slice(n,i);let N="";for(let Q=0;Q<w.length-1;Q+=2)N+=String.fromCharCode(w[Q]+w[Q+1]*256);return N}d.prototype.slice=function(n,i){const w=this.length;n=~~n,i=i===void 0?w:~~i,n<0?(n+=w,n<0&&(n=0)):n>w&&(n=w),i<0?(i+=w,i<0&&(i=0)):i>w&&(i=w),i<n&&(i=n);const N=this.subarray(n,i);return Object.setPrototypeOf(N,d.prototype),N};function o(f,n,i){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+n>i)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(n,i,w){n=n>>>0,i=i>>>0,w||o(n,i,this.length);let N=this[n],Q=1,rt=0;for(;++rt<i&&(Q*=256);)N+=this[n+rt]*Q;return N},d.prototype.readUintBE=d.prototype.readUIntBE=function(n,i,w){n=n>>>0,i=i>>>0,w||o(n,i,this.length);let N=this[n+--i],Q=1;for(;i>0&&(Q*=256);)N+=this[n+--i]*Q;return N},d.prototype.readUint8=d.prototype.readUInt8=function(n,i){return n=n>>>0,i||o(n,1,this.length),this[n]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||o(n,2,this.length),this[n]|this[n+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||o(n,2,this.length),this[n]<<8|this[n+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||o(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||o(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},d.prototype.readBigUInt64LE=st(function(n){n=n>>>0,I(n,"offset");const i=this[n],w=this[n+7];(i===void 0||w===void 0)&&j(n,this.length-8);const N=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,Q=this[++n]+this[++n]*2**8+this[++n]*2**16+w*2**24;return BigInt(N)+(BigInt(Q)<<BigInt(32))}),d.prototype.readBigUInt64BE=st(function(n){n=n>>>0,I(n,"offset");const i=this[n],w=this[n+7];(i===void 0||w===void 0)&&j(n,this.length-8);const N=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],Q=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+w;return(BigInt(N)<<BigInt(32))+BigInt(Q)}),d.prototype.readIntLE=function(n,i,w){n=n>>>0,i=i>>>0,w||o(n,i,this.length);let N=this[n],Q=1,rt=0;for(;++rt<i&&(Q*=256);)N+=this[n+rt]*Q;return Q*=128,N>=Q&&(N-=Math.pow(2,8*i)),N},d.prototype.readIntBE=function(n,i,w){n=n>>>0,i=i>>>0,w||o(n,i,this.length);let N=i,Q=1,rt=this[n+--N];for(;N>0&&(Q*=256);)rt+=this[n+--N]*Q;return Q*=128,rt>=Q&&(rt-=Math.pow(2,8*i)),rt},d.prototype.readInt8=function(n,i){return n=n>>>0,i||o(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},d.prototype.readInt16LE=function(n,i){n=n>>>0,i||o(n,2,this.length);const w=this[n]|this[n+1]<<8;return w&32768?w|4294901760:w},d.prototype.readInt16BE=function(n,i){n=n>>>0,i||o(n,2,this.length);const w=this[n+1]|this[n]<<8;return w&32768?w|4294901760:w},d.prototype.readInt32LE=function(n,i){return n=n>>>0,i||o(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},d.prototype.readInt32BE=function(n,i){return n=n>>>0,i||o(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},d.prototype.readBigInt64LE=st(function(n){n=n>>>0,I(n,"offset");const i=this[n],w=this[n+7];(i===void 0||w===void 0)&&j(n,this.length-8);const N=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(w<<24);return(BigInt(N)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),d.prototype.readBigInt64BE=st(function(n){n=n>>>0,I(n,"offset");const i=this[n],w=this[n+7];(i===void 0||w===void 0)&&j(n,this.length-8);const N=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(N)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+w)}),d.prototype.readFloatLE=function(n,i){return n=n>>>0,i||o(n,4,this.length),r.read(this,n,!0,23,4)},d.prototype.readFloatBE=function(n,i){return n=n>>>0,i||o(n,4,this.length),r.read(this,n,!1,23,4)},d.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||o(n,8,this.length),r.read(this,n,!0,52,8)},d.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||o(n,8,this.length),r.read(this,n,!1,52,8)};function s(f,n,i,w,N,Q){if(!d.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>N||n<Q)throw new RangeError('"value" argument is out of bounds');if(i+w>f.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(n,i,w,N){if(n=+n,i=i>>>0,w=w>>>0,!N){const mt=Math.pow(2,8*w)-1;s(this,n,i,w,mt,0)}let Q=1,rt=0;for(this[i]=n&255;++rt<w&&(Q*=256);)this[i+rt]=n/Q&255;return i+w},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(n,i,w,N){if(n=+n,i=i>>>0,w=w>>>0,!N){const mt=Math.pow(2,8*w)-1;s(this,n,i,w,mt,0)}let Q=w-1,rt=1;for(this[i+Q]=n&255;--Q>=0&&(rt*=256);)this[i+Q]=n/rt&255;return i+w},d.prototype.writeUint8=d.prototype.writeUInt8=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,1,255,0),this[i]=n&255,i+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function u(f,n,i,w,N){q(n,w,N,f,i,7);let Q=Number(n&BigInt(4294967295));f[i++]=Q,Q=Q>>8,f[i++]=Q,Q=Q>>8,f[i++]=Q,Q=Q>>8,f[i++]=Q;let rt=Number(n>>BigInt(32)&BigInt(4294967295));return f[i++]=rt,rt=rt>>8,f[i++]=rt,rt=rt>>8,f[i++]=rt,rt=rt>>8,f[i++]=rt,i}function m(f,n,i,w,N){q(n,w,N,f,i,7);let Q=Number(n&BigInt(4294967295));f[i+7]=Q,Q=Q>>8,f[i+6]=Q,Q=Q>>8,f[i+5]=Q,Q=Q>>8,f[i+4]=Q;let rt=Number(n>>BigInt(32)&BigInt(4294967295));return f[i+3]=rt,rt=rt>>8,f[i+2]=rt,rt=rt>>8,f[i+1]=rt,rt=rt>>8,f[i]=rt,i+8}d.prototype.writeBigUInt64LE=st(function(n,i=0){return u(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=st(function(n,i=0){return m(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(n,i,w,N){if(n=+n,i=i>>>0,!N){const pt=Math.pow(2,8*w-1);s(this,n,i,w,pt-1,-pt)}let Q=0,rt=1,mt=0;for(this[i]=n&255;++Q<w&&(rt*=256);)n<0&&mt===0&&this[i+Q-1]!==0&&(mt=1),this[i+Q]=(n/rt>>0)-mt&255;return i+w},d.prototype.writeIntBE=function(n,i,w,N){if(n=+n,i=i>>>0,!N){const pt=Math.pow(2,8*w-1);s(this,n,i,w,pt-1,-pt)}let Q=w-1,rt=1,mt=0;for(this[i+Q]=n&255;--Q>=0&&(rt*=256);)n<0&&mt===0&&this[i+Q+1]!==0&&(mt=1),this[i+Q]=(n/rt>>0)-mt&255;return i+w},d.prototype.writeInt8=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},d.prototype.writeInt16LE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},d.prototype.writeInt16BE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},d.prototype.writeInt32LE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},d.prototype.writeInt32BE=function(n,i,w){return n=+n,i=i>>>0,w||s(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},d.prototype.writeBigInt64LE=st(function(n,i=0){return u(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=st(function(n,i=0){return m(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function E(f,n,i,w,N,Q){if(i+w>f.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function T(f,n,i,w,N){return n=+n,i=i>>>0,N||E(f,n,i,4),r.write(f,n,i,w,23,4),i+4}d.prototype.writeFloatLE=function(n,i,w){return T(this,n,i,!0,w)},d.prototype.writeFloatBE=function(n,i,w){return T(this,n,i,!1,w)};function G(f,n,i,w,N){return n=+n,i=i>>>0,N||E(f,n,i,8),r.write(f,n,i,w,52,8),i+8}d.prototype.writeDoubleLE=function(n,i,w){return G(this,n,i,!0,w)},d.prototype.writeDoubleBE=function(n,i,w){return G(this,n,i,!1,w)},d.prototype.copy=function(n,i,w,N){if(!d.isBuffer(n))throw new TypeError("argument should be a Buffer");if(w||(w=0),!N&&N!==0&&(N=this.length),i>=n.length&&(i=n.length),i||(i=0),N>0&&N<w&&(N=w),N===w||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(w<0||w>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),n.length-i<N-w&&(N=n.length-i+w);const Q=N-w;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,w,N):Uint8Array.prototype.set.call(n,this.subarray(w,N),i),Q},d.prototype.fill=function(n,i,w,N){if(typeof n=="string"){if(typeof i=="string"?(N=i,i=0,w=this.length):typeof w=="string"&&(N=w,w=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!d.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(n.length===1){const rt=n.charCodeAt(0);(N==="utf8"&&rt<128||N==="latin1")&&(n=rt)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<w)throw new RangeError("Out of range index");if(w<=i)return this;i=i>>>0,w=w===void 0?this.length:w>>>0,n||(n=0);let Q;if(typeof n=="number")for(Q=i;Q<w;++Q)this[Q]=n;else{const rt=d.isBuffer(n)?n:d.from(n,N),mt=rt.length;if(mt===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(Q=0;Q<w-i;++Q)this[Q+i]=rt[Q%mt]}return this};const x={};function A(f,n,i){x[f]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}A("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),A("ERR_INVALID_ARG_TYPE",function(f,n){return`The "${f}" argument must be of type number. Received type ${typeof n}`},TypeError),A("ERR_OUT_OF_RANGE",function(f,n,i){let w=`The value of "${f}" is out of range.`,N=i;return Number.isInteger(i)&&Math.abs(i)>2**32?N=R(String(i)):typeof i=="bigint"&&(N=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(N=R(N)),N+="n"),w+=` It must be ${n}. Received ${N}`,w},RangeError);function R(f){let n="",i=f.length;const w=f[0]==="-"?1:0;for(;i>=w+4;i-=3)n=`_${f.slice(i-3,i)}${n}`;return`${f.slice(0,i)}${n}`}function F(f,n,i){I(n,"offset"),(f[n]===void 0||f[n+i]===void 0)&&j(n,f.length-(i+1))}function q(f,n,i,w,N,Q){if(f>i||f<n){const rt=typeof n=="bigint"?"n":"";let mt;throw n===0||n===BigInt(0)?mt=`>= 0${rt} and < 2${rt} ** ${(Q+1)*8}${rt}`:mt=`>= -(2${rt} ** ${(Q+1)*8-1}${rt}) and < 2 ** ${(Q+1)*8-1}${rt}`,new x.ERR_OUT_OF_RANGE("value",mt,f)}F(w,N,Q)}function I(f,n){if(typeof f!="number")throw new x.ERR_INVALID_ARG_TYPE(n,"number",f)}function j(f,n,i){throw Math.floor(f)!==f?(I(f,i),new x.ERR_OUT_OF_RANGE("offset","an integer",f)):n<0?new x.ERR_BUFFER_OUT_OF_BOUNDS:new x.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${n}`,f)}const it=/[^+/0-9A-Za-z-_]/g;function ot(f){if(f=f.split("=")[0],f=f.trim().replace(it,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function ut(f,n){n=n||1/0;let i;const w=f.length;let N=null;const Q=[];for(let rt=0;rt<w;++rt){if(i=f.charCodeAt(rt),i>55295&&i<57344){if(!N){if(i>56319){(n-=3)>-1&&Q.push(239,191,189);continue}else if(rt+1===w){(n-=3)>-1&&Q.push(239,191,189);continue}N=i;continue}if(i<56320){(n-=3)>-1&&Q.push(239,191,189),N=i;continue}i=(N-55296<<10|i-56320)+65536}else N&&(n-=3)>-1&&Q.push(239,191,189);if(N=null,i<128){if((n-=1)<0)break;Q.push(i)}else if(i<2048){if((n-=2)<0)break;Q.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;Q.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;Q.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return Q}function ft(f){const n=[];for(let i=0;i<f.length;++i)n.push(f.charCodeAt(i)&255);return n}function dt(f,n){let i,w,N;const Q=[];for(let rt=0;rt<f.length&&!((n-=2)<0);++rt)i=f.charCodeAt(rt),w=i>>8,N=i%256,Q.push(N),Q.push(w);return Q}function lt(f){return e.toByteArray(ot(f))}function wt(f,n,i,w){let N;for(N=0;N<w&&!(N+i>=n.length||N>=f.length);++N)n[N+i]=f[N];return N}function yt(f,n){return f instanceof n||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===n.name}function ht(f){return f!==f}const at=(function(){const f="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const w=i*16;for(let N=0;N<16;++N)n[w+N]=f[i]+f[N]}return n})();function st(f){return typeof BigInt>"u"?ct:f}function ct(){throw new Error("BigInt not supported")}})(Ce)),Ce}var Es=vs(),Re={},He={},Hn;function kt(){return Hn||(Hn=1,(function(t){/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCipher=t.Hash=t.nextTick=t.isLE=void 0,t.isBytes=e,t.abool=r,t.anumber=c,t.abytes=l,t.ahash=a,t.aexists=h,t.aoutput=d,t.u8=O,t.u32=C,t.clean=H,t.createView=b,t.bytesToHex=p,t.hexToBytes=U,t.hexToNumber=K,t.bytesToNumberBE=W,t.numberToBytesBE=et,t.utf8ToBytes=P,t.bytesToUtf8=Y,t.toBytes=J,t.overlapBytes=Z,t.complexOverlapBytes=$,t.concatBytes=tt,t.checkOpts=nt,t.equalBytes=X,t.getOutput=M,t.setBigUint64=v,t.u64Lengths=g,t.isAligned32=_,t.copyBytes=V;function e(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function r(o){if(typeof o!="boolean")throw new Error(`boolean expected, not ${o}`)}function c(o){if(!Number.isSafeInteger(o)||o<0)throw new Error("positive integer expected, got "+o)}function l(o,...s){if(!e(o))throw new Error("Uint8Array expected");if(s.length>0&&!s.includes(o.length))throw new Error("Uint8Array expected of length "+s+", got length="+o.length)}function a(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");c(o.outputLen),c(o.blockLen)}function h(o,s=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(s&&o.finished)throw new Error("Hash#digest() has already been called")}function d(o,s){l(o);const u=s.outputLen;if(o.length<u)throw new Error("digestInto() expects output buffer of length at least "+u)}function O(o){return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}function C(o){return new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4))}function H(...o){for(let s=0;s<o.length;s++)o[s].fill(0)}function b(o){return new DataView(o.buffer,o.byteOffset,o.byteLength)}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const k=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",B=Array.from({length:256},(o,s)=>s.toString(16).padStart(2,"0"));function p(o){if(l(o),k)return o.toHex();let s="";for(let u=0;u<o.length;u++)s+=B[o[u]];return s}const S={_0:48,_9:57,A:65,F:70,a:97,f:102};function L(o){if(o>=S._0&&o<=S._9)return o-S._0;if(o>=S.A&&o<=S.F)return o-(S.A-10);if(o>=S.a&&o<=S.f)return o-(S.a-10)}function U(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);if(k)return Uint8Array.fromHex(o);const s=o.length,u=s/2;if(s%2)throw new Error("hex string expected, got unpadded hex of length "+s);const m=new Uint8Array(u);for(let E=0,T=0;E<u;E++,T+=2){const G=L(o.charCodeAt(T)),x=L(o.charCodeAt(T+1));if(G===void 0||x===void 0){const A=o[T]+o[T+1];throw new Error('hex string expected, got non-hex character "'+A+'" at index '+T)}m[E]=G*16+x}return m}function K(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);return BigInt(o===""?"0":"0x"+o)}function W(o){return K(p(o))}function et(o,s){return U(o.toString(16).padStart(s*2,"0"))}const D=async()=>{};t.nextTick=D;function P(o){if(typeof o!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(o))}function Y(o){return new TextDecoder().decode(o)}function J(o){if(typeof o=="string")o=P(o);else if(e(o))o=V(o);else throw new Error("Uint8Array expected, got "+typeof o);return o}function Z(o,s){return o.buffer===s.buffer&&o.byteOffset<s.byteOffset+s.byteLength&&s.byteOffset<o.byteOffset+o.byteLength}function $(o,s){if(Z(o,s)&&o.byteOffset<s.byteOffset)throw new Error("complex overlap of input and output is not supported")}function tt(...o){let s=0;for(let m=0;m<o.length;m++){const E=o[m];l(E),s+=E.length}const u=new Uint8Array(s);for(let m=0,E=0;m<o.length;m++){const T=o[m];u.set(T,E),E+=T.length}return u}function nt(o,s){if(s==null||typeof s!="object")throw new Error("options must be defined");return Object.assign(o,s)}function X(o,s){if(o.length!==s.length)return!1;let u=0;for(let m=0;m<o.length;m++)u|=o[m]^s[m];return u===0}class z{}t.Hash=z;const y=(o,s)=>{function u(m,...E){if(l(m),!t.isLE)throw new Error("Non little-endian hardware is not yet supported");if(o.nonceLength!==void 0){const F=E[0];if(!F)throw new Error("nonce / iv required");o.varSizeNonce?l(F):l(F,o.nonceLength)}const T=o.tagLength;T&&E[1]!==void 0&&l(E[1]);const G=s(m,...E),x=(F,q)=>{if(q!==void 0){if(F!==2)throw new Error("cipher output not supported");l(q)}};let A=!1;return{encrypt(F,q){if(A)throw new Error("cannot encrypt() twice with same key + nonce");return A=!0,l(F),x(G.encrypt.length,q),G.encrypt(F,q)},decrypt(F,q){if(l(F),T&&F.length<T)throw new Error("invalid ciphertext length: smaller than tagLength="+T);return x(G.decrypt.length,q),G.decrypt(F,q)}}}return Object.assign(u,o),u};t.wrapCipher=y;function M(o,s,u=!0){if(s===void 0)return new Uint8Array(o);if(s.length!==o)throw new Error("invalid output length, expected "+o+", got: "+s.length);if(u&&!_(s))throw new Error("invalid output, must be aligned");return s}function v(o,s,u,m){if(typeof o.setBigUint64=="function")return o.setBigUint64(s,u,m);const E=BigInt(32),T=BigInt(4294967295),G=Number(u>>E&T),x=Number(u&T),A=m?4:0,R=m?0:4;o.setUint32(s+A,G,m),o.setUint32(s+R,x,m)}function g(o,s,u){r(u);const m=new Uint8Array(16),E=b(m);return v(E,0,BigInt(s),u),v(E,8,BigInt(o),u),m}function _(o){return o.byteOffset%4===0}function V(o){return Uint8Array.from(o)}})(He)),He}var Oe={},At={},On;function sn(){return On||(On=1,Object.defineProperty(At,"__esModule",{value:!0}),At.AEAD_TAG_LENGTH=At.XCHACHA20_NONCE_LENGTH=At.CURVE25519_PUBLIC_KEY_SIZE=At.ETH_PUBLIC_KEY_SIZE=At.UNCOMPRESSED_PUBLIC_KEY_SIZE=At.COMPRESSED_PUBLIC_KEY_SIZE=At.SECRET_KEY_LENGTH=void 0,At.SECRET_KEY_LENGTH=32,At.COMPRESSED_PUBLIC_KEY_SIZE=33,At.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,At.ETH_PUBLIC_KEY_SIZE=64,At.CURVE25519_PUBLIC_KEY_SIZE=32,At.XCHACHA20_NONCE_LENGTH=24,At.AEAD_TAG_LENGTH=16),At}var Un;function Ie(){return Un||(Un=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ephemeralKeySize=t.symmetricNonceLength=t.symmetricAlgorithm=t.isHkdfKeyCompressed=t.isEphemeralKeyCompressed=t.ellipticCurve=t.ECIES_CONFIG=void 0;var e=sn(),r=(function(){function C(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16}return C})();t.ECIES_CONFIG=new r;var c=function(){return t.ECIES_CONFIG.ellipticCurve};t.ellipticCurve=c;var l=function(){return t.ECIES_CONFIG.isEphemeralKeyCompressed};t.isEphemeralKeyCompressed=l;var a=function(){return t.ECIES_CONFIG.isHkdfKeyCompressed};t.isHkdfKeyCompressed=a;var h=function(){return t.ECIES_CONFIG.symmetricAlgorithm};t.symmetricAlgorithm=h;var d=function(){return t.ECIES_CONFIG.symmetricNonceLength};t.symmetricNonceLength=d;var O=function(){var C={secp256k1:t.ECIES_CONFIG.isEphemeralKeyCompressed?e.COMPRESSED_PUBLIC_KEY_SIZE:e.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:e.CURVE25519_PUBLIC_KEY_SIZE,ed25519:e.CURVE25519_PUBLIC_KEY_SIZE};if(t.ECIES_CONFIG.ellipticCurve in C)return C[t.ECIES_CONFIG.ellipticCurve];throw new Error("Not implemented")};t.ephemeralKeySize=O})(Oe)),Oe}var Ue={},oe={},zt={},Pe={},Ne={},se={},Pn;function Bs(){return Pn||(Pn=1,Object.defineProperty(se,"__esModule",{value:!0}),se.crypto=void 0,se.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),se}var Nn;function Kr(){return Nn||(Nn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.gcm=t.ctr=t.cbc=t.utils=void 0,t.randomBytes=c,t.getWebcryptoSubtle=l,t.managedNonce=a;const e=Bs(),r=kt();function c(C=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(C));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(C));throw new Error("crypto.getRandomValues must be defined")}function l(){if(e.crypto&&typeof e.crypto.subtle=="object"&&e.crypto.subtle!=null)return e.crypto.subtle;throw new Error("crypto.subtle must be defined")}function a(C){const{nonceLength:H}=C;return(0,r.anumber)(H),((b,...k)=>({encrypt(B,...p){const S=c(H),L=C(b,S,...k).encrypt(B,...p),U=(0,r.concatBytes)(S,L);return L.fill(0),U},decrypt(B,...p){const S=B.subarray(0,H),L=B.subarray(H);return C(b,S,...k).decrypt(L,...p)}}))}t.utils={async encrypt(C,H,b,k){const B=l(),p=await B.importKey("raw",C,H,!0,["encrypt"]),S=await B.encrypt(b,p,k);return new Uint8Array(S)},async decrypt(C,H,b,k){const B=l(),p=await B.importKey("raw",C,H,!0,["decrypt"]),S=await B.decrypt(b,p,k);return new Uint8Array(S)}};const h={CBC:"AES-CBC",CTR:"AES-CTR",GCM:"AES-GCM"};function d(C,H,b){if(C===h.CBC)return{name:h.CBC,iv:H};if(C===h.CTR)return{name:h.CTR,counter:H,length:64};if(C===h.GCM)return b?{name:h.GCM,iv:H,additionalData:b}:{name:h.GCM,iv:H};throw new Error("unknown aes block mode")}function O(C){return(H,b,k)=>{(0,r.abytes)(H),(0,r.abytes)(b);const B={name:C,length:H.length*8},p=d(C,b,k);let S=!1;return{encrypt(L){if((0,r.abytes)(L),S)throw new Error("Cannot encrypt() twice with same key / nonce");return S=!0,t.utils.encrypt(H,B,p,L)},decrypt(L){return(0,r.abytes)(L),t.utils.decrypt(H,B,p,L)}}}}t.cbc=O(h.CBC),t.ctr=O(h.CTR),t.gcm=O(h.GCM)})(Ne)),Ne}var ke={},_t={},Lt={},Me={},ce={},kn;function _s(){return kn||(kn=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.crypto=void 0,ce.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),ce}var Mn;function Gt(){return Mn||(Mn=1,(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=r,t.anumber=c,t.abytes=l,t.ahash=a,t.aexists=h,t.aoutput=d,t.u8=O,t.u32=C,t.clean=H,t.createView=b,t.rotr=k,t.rotl=B,t.byteSwap=p,t.byteSwap32=S,t.bytesToHex=K,t.hexToBytes=D,t.asyncLoop=Y,t.utf8ToBytes=J,t.bytesToUtf8=Z,t.toBytes=$,t.kdfInputToBytes=tt,t.concatBytes=nt,t.checkOpts=X,t.createHasher=y,t.createOptHasher=M,t.createXOFer=v,t.randomBytes=g;const e=_s();function r(_){return _ instanceof Uint8Array||ArrayBuffer.isView(_)&&_.constructor.name==="Uint8Array"}function c(_){if(!Number.isSafeInteger(_)||_<0)throw new Error("positive integer expected, got "+_)}function l(_,...V){if(!r(_))throw new Error("Uint8Array expected");if(V.length>0&&!V.includes(_.length))throw new Error("Uint8Array expected of length "+V+", got length="+_.length)}function a(_){if(typeof _!="function"||typeof _.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");c(_.outputLen),c(_.blockLen)}function h(_,V=!0){if(_.destroyed)throw new Error("Hash instance has been destroyed");if(V&&_.finished)throw new Error("Hash#digest() has already been called")}function d(_,V){l(_);const o=V.outputLen;if(_.length<o)throw new Error("digestInto() expects output buffer of length at least "+o)}function O(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}function C(_){return new Uint32Array(_.buffer,_.byteOffset,Math.floor(_.byteLength/4))}function H(..._){for(let V=0;V<_.length;V++)_[V].fill(0)}function b(_){return new DataView(_.buffer,_.byteOffset,_.byteLength)}function k(_,V){return _<<32-V|_>>>V}function B(_,V){return _<<V|_>>>32-V>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function p(_){return _<<24&4278190080|_<<8&16711680|_>>>8&65280|_>>>24&255}t.swap8IfBE=t.isLE?_=>_:_=>p(_),t.byteSwapIfBE=t.swap8IfBE;function S(_){for(let V=0;V<_.length;V++)_[V]=p(_[V]);return _}t.swap32IfBE=t.isLE?_=>_:S;const L=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",U=Array.from({length:256},(_,V)=>V.toString(16).padStart(2,"0"));function K(_){if(l(_),L)return _.toHex();let V="";for(let o=0;o<_.length;o++)V+=U[_[o]];return V}const W={_0:48,_9:57,A:65,F:70,a:97,f:102};function et(_){if(_>=W._0&&_<=W._9)return _-W._0;if(_>=W.A&&_<=W.F)return _-(W.A-10);if(_>=W.a&&_<=W.f)return _-(W.a-10)}function D(_){if(typeof _!="string")throw new Error("hex string expected, got "+typeof _);if(L)return Uint8Array.fromHex(_);const V=_.length,o=V/2;if(V%2)throw new Error("hex string expected, got unpadded hex of length "+V);const s=new Uint8Array(o);for(let u=0,m=0;u<o;u++,m+=2){const E=et(_.charCodeAt(m)),T=et(_.charCodeAt(m+1));if(E===void 0||T===void 0){const G=_[m]+_[m+1];throw new Error('hex string expected, got non-hex character "'+G+'" at index '+m)}s[u]=E*16+T}return s}const P=async()=>{};t.nextTick=P;async function Y(_,V,o){let s=Date.now();for(let u=0;u<_;u++){o(u);const m=Date.now()-s;m>=0&&m<V||(await(0,t.nextTick)(),s+=m)}}function J(_){if(typeof _!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(_))}function Z(_){return new TextDecoder().decode(_)}function $(_){return typeof _=="string"&&(_=J(_)),l(_),_}function tt(_){return typeof _=="string"&&(_=J(_)),l(_),_}function nt(..._){let V=0;for(let s=0;s<_.length;s++){const u=_[s];l(u),V+=u.length}const o=new Uint8Array(V);for(let s=0,u=0;s<_.length;s++){const m=_[s];o.set(m,u),u+=m.length}return o}function X(_,V){if(V!==void 0&&{}.toString.call(V)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(_,V)}class z{}t.Hash=z;function y(_){const V=s=>_().update($(s)).digest(),o=_();return V.outputLen=o.outputLen,V.blockLen=o.blockLen,V.create=()=>_(),V}function M(_){const V=(s,u)=>_(u).update($(s)).digest(),o=_({});return V.outputLen=o.outputLen,V.blockLen=o.blockLen,V.create=s=>_(s),V}function v(_){const V=(s,u)=>_(u).update($(s)).digest(),o=_({});return V.outputLen=o.outputLen,V.blockLen=o.blockLen,V.create=s=>_(s),V}t.wrapConstructor=y,t.wrapConstructorWithOpts=M,t.wrapXOFConstructorWithOpts=v;function g(_=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(_));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(_));throw new Error("crypto.getRandomValues must be defined")}})(Me)),Me}var Vn;function xs(){if(Vn)return Lt;Vn=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.SHA512_IV=Lt.SHA384_IV=Lt.SHA224_IV=Lt.SHA256_IV=Lt.HashMD=void 0,Lt.setBigUint64=e,Lt.Chi=r,Lt.Maj=c;const t=Gt();function e(a,h,d,O){if(typeof a.setBigUint64=="function")return a.setBigUint64(h,d,O);const C=BigInt(32),H=BigInt(4294967295),b=Number(d>>C&H),k=Number(d&H),B=O?4:0,p=O?0:4;a.setUint32(h+B,b,O),a.setUint32(h+p,k,O)}function r(a,h,d){return a&h^~a&d}function c(a,h,d){return a&h^a&d^h&d}class l extends t.Hash{constructor(h,d,O,C){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=h,this.outputLen=d,this.padOffset=O,this.isLE=C,this.buffer=new Uint8Array(h),this.view=(0,t.createView)(this.buffer)}update(h){(0,t.aexists)(this),h=(0,t.toBytes)(h),(0,t.abytes)(h);const{view:d,buffer:O,blockLen:C}=this,H=h.length;for(let b=0;b<H;){const k=Math.min(C-this.pos,H-b);if(k===C){const B=(0,t.createView)(h);for(;C<=H-b;b+=C)this.process(B,b);continue}O.set(h.subarray(b,b+k),this.pos),this.pos+=k,b+=k,this.pos===C&&(this.process(d,0),this.pos=0)}return this.length+=h.length,this.roundClean(),this}digestInto(h){(0,t.aexists)(this),(0,t.aoutput)(h,this),this.finished=!0;const{buffer:d,view:O,blockLen:C,isLE:H}=this;let{pos:b}=this;d[b++]=128,(0,t.clean)(this.buffer.subarray(b)),this.padOffset>C-b&&(this.process(O,0),b=0);for(let L=b;L<C;L++)d[L]=0;e(O,C-8,BigInt(this.length*8),H),this.process(O,0);const k=(0,t.createView)(h),B=this.outputLen;if(B%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=B/4,S=this.get();if(p>S.length)throw new Error("_sha2: outputLen bigger than state");for(let L=0;L<p;L++)k.setUint32(4*L,S[L],H)}digest(){const{buffer:h,outputLen:d}=this;this.digestInto(h);const O=h.slice(0,d);return this.destroy(),O}_cloneInto(h){h||(h=new this.constructor),h.set(...this.get());const{blockLen:d,buffer:O,length:C,finished:H,destroyed:b,pos:k}=this;return h.destroyed=b,h.finished=H,h.length=C,h.pos=k,C%d&&h.buffer.set(O),h}clone(){return this._cloneInto()}}return Lt.HashMD=l,Lt.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Lt.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Lt.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Lt.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Lt}var Et={},Fn;function Ss(){if(Fn)return Et;Fn=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.toBig=Et.shrSL=Et.shrSH=Et.rotrSL=Et.rotrSH=Et.rotrBL=Et.rotrBH=Et.rotr32L=Et.rotr32H=Et.rotlSL=Et.rotlSH=Et.rotlBL=Et.rotlBH=Et.add5L=Et.add5H=Et.add4L=Et.add4H=Et.add3L=Et.add3H=void 0,Et.add=U,Et.fromBig=r,Et.split=c;const t=BigInt(2**32-1),e=BigInt(32);function r(Z,$=!1){return $?{h:Number(Z&t),l:Number(Z>>e&t)}:{h:Number(Z>>e&t)|0,l:Number(Z&t)|0}}function c(Z,$=!1){const tt=Z.length;let nt=new Uint32Array(tt),X=new Uint32Array(tt);for(let z=0;z<tt;z++){const{h:y,l:M}=r(Z[z],$);[nt[z],X[z]]=[y,M]}return[nt,X]}const l=(Z,$)=>BigInt(Z>>>0)<<e|BigInt($>>>0);Et.toBig=l;const a=(Z,$,tt)=>Z>>>tt;Et.shrSH=a;const h=(Z,$,tt)=>Z<<32-tt|$>>>tt;Et.shrSL=h;const d=(Z,$,tt)=>Z>>>tt|$<<32-tt;Et.rotrSH=d;const O=(Z,$,tt)=>Z<<32-tt|$>>>tt;Et.rotrSL=O;const C=(Z,$,tt)=>Z<<64-tt|$>>>tt-32;Et.rotrBH=C;const H=(Z,$,tt)=>Z>>>tt-32|$<<64-tt;Et.rotrBL=H;const b=(Z,$)=>$;Et.rotr32H=b;const k=(Z,$)=>Z;Et.rotr32L=k;const B=(Z,$,tt)=>Z<<tt|$>>>32-tt;Et.rotlSH=B;const p=(Z,$,tt)=>$<<tt|Z>>>32-tt;Et.rotlSL=p;const S=(Z,$,tt)=>$<<tt-32|Z>>>64-tt;Et.rotlBH=S;const L=(Z,$,tt)=>Z<<tt-32|$>>>64-tt;Et.rotlBL=L;function U(Z,$,tt,nt){const X=($>>>0)+(nt>>>0);return{h:Z+tt+(X/2**32|0)|0,l:X|0}}const K=(Z,$,tt)=>(Z>>>0)+($>>>0)+(tt>>>0);Et.add3L=K;const W=(Z,$,tt,nt)=>$+tt+nt+(Z/2**32|0)|0;Et.add3H=W;const et=(Z,$,tt,nt)=>(Z>>>0)+($>>>0)+(tt>>>0)+(nt>>>0);Et.add4L=et;const D=(Z,$,tt,nt,X)=>$+tt+nt+X+(Z/2**32|0)|0;Et.add4H=D;const P=(Z,$,tt,nt,X)=>(Z>>>0)+($>>>0)+(tt>>>0)+(nt>>>0)+(X>>>0);Et.add5L=P;const Y=(Z,$,tt,nt,X,z)=>$+tt+nt+X+z+(Z/2**32|0)|0;Et.add5H=Y;const J={fromBig:r,split:c,toBig:l,shrSH:a,shrSL:h,rotrSH:d,rotrSL:O,rotrBH:C,rotrBL:H,rotr32H:b,rotr32L:k,rotlSH:B,rotlSL:p,rotlBH:S,rotlBL:L,add:U,add3L:K,add3H:W,add4L:et,add4H:D,add5H:Y,add5L:P};return Et.default=J,Et}var Dn;function cn(){if(Dn)return _t;Dn=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.sha512_224=_t.sha512_256=_t.sha384=_t.sha512=_t.sha224=_t.sha256=_t.SHA512_256=_t.SHA512_224=_t.SHA384=_t.SHA512=_t.SHA224=_t.SHA256=void 0;const t=xs(),e=Ss(),r=Gt(),c=Uint32Array.from([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]),l=new Uint32Array(64);class a extends t.HashMD{constructor(W=32){super(64,W,8,!1),this.A=t.SHA256_IV[0]|0,this.B=t.SHA256_IV[1]|0,this.C=t.SHA256_IV[2]|0,this.D=t.SHA256_IV[3]|0,this.E=t.SHA256_IV[4]|0,this.F=t.SHA256_IV[5]|0,this.G=t.SHA256_IV[6]|0,this.H=t.SHA256_IV[7]|0}get(){const{A:W,B:et,C:D,D:P,E:Y,F:J,G:Z,H:$}=this;return[W,et,D,P,Y,J,Z,$]}set(W,et,D,P,Y,J,Z,$){this.A=W|0,this.B=et|0,this.C=D|0,this.D=P|0,this.E=Y|0,this.F=J|0,this.G=Z|0,this.H=$|0}process(W,et){for(let X=0;X<16;X++,et+=4)l[X]=W.getUint32(et,!1);for(let X=16;X<64;X++){const z=l[X-15],y=l[X-2],M=(0,r.rotr)(z,7)^(0,r.rotr)(z,18)^z>>>3,v=(0,r.rotr)(y,17)^(0,r.rotr)(y,19)^y>>>10;l[X]=v+l[X-7]+M+l[X-16]|0}let{A:D,B:P,C:Y,D:J,E:Z,F:$,G:tt,H:nt}=this;for(let X=0;X<64;X++){const z=(0,r.rotr)(Z,6)^(0,r.rotr)(Z,11)^(0,r.rotr)(Z,25),y=nt+z+(0,t.Chi)(Z,$,tt)+c[X]+l[X]|0,v=((0,r.rotr)(D,2)^(0,r.rotr)(D,13)^(0,r.rotr)(D,22))+(0,t.Maj)(D,P,Y)|0;nt=tt,tt=$,$=Z,Z=J+y|0,J=Y,Y=P,P=D,D=y+v|0}D=D+this.A|0,P=P+this.B|0,Y=Y+this.C|0,J=J+this.D|0,Z=Z+this.E|0,$=$+this.F|0,tt=tt+this.G|0,nt=nt+this.H|0,this.set(D,P,Y,J,Z,$,tt,nt)}roundClean(){(0,r.clean)(l)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,r.clean)(this.buffer)}}_t.SHA256=a;class h extends a{constructor(){super(28),this.A=t.SHA224_IV[0]|0,this.B=t.SHA224_IV[1]|0,this.C=t.SHA224_IV[2]|0,this.D=t.SHA224_IV[3]|0,this.E=t.SHA224_IV[4]|0,this.F=t.SHA224_IV[5]|0,this.G=t.SHA224_IV[6]|0,this.H=t.SHA224_IV[7]|0}}_t.SHA224=h;const d=e.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(K=>BigInt(K))),O=d[0],C=d[1],H=new Uint32Array(80),b=new Uint32Array(80);class k extends t.HashMD{constructor(W=64){super(128,W,16,!1),this.Ah=t.SHA512_IV[0]|0,this.Al=t.SHA512_IV[1]|0,this.Bh=t.SHA512_IV[2]|0,this.Bl=t.SHA512_IV[3]|0,this.Ch=t.SHA512_IV[4]|0,this.Cl=t.SHA512_IV[5]|0,this.Dh=t.SHA512_IV[6]|0,this.Dl=t.SHA512_IV[7]|0,this.Eh=t.SHA512_IV[8]|0,this.El=t.SHA512_IV[9]|0,this.Fh=t.SHA512_IV[10]|0,this.Fl=t.SHA512_IV[11]|0,this.Gh=t.SHA512_IV[12]|0,this.Gl=t.SHA512_IV[13]|0,this.Hh=t.SHA512_IV[14]|0,this.Hl=t.SHA512_IV[15]|0}get(){const{Ah:W,Al:et,Bh:D,Bl:P,Ch:Y,Cl:J,Dh:Z,Dl:$,Eh:tt,El:nt,Fh:X,Fl:z,Gh:y,Gl:M,Hh:v,Hl:g}=this;return[W,et,D,P,Y,J,Z,$,tt,nt,X,z,y,M,v,g]}set(W,et,D,P,Y,J,Z,$,tt,nt,X,z,y,M,v,g){this.Ah=W|0,this.Al=et|0,this.Bh=D|0,this.Bl=P|0,this.Ch=Y|0,this.Cl=J|0,this.Dh=Z|0,this.Dl=$|0,this.Eh=tt|0,this.El=nt|0,this.Fh=X|0,this.Fl=z|0,this.Gh=y|0,this.Gl=M|0,this.Hh=v|0,this.Hl=g|0}process(W,et){for(let o=0;o<16;o++,et+=4)H[o]=W.getUint32(et),b[o]=W.getUint32(et+=4);for(let o=16;o<80;o++){const s=H[o-15]|0,u=b[o-15]|0,m=e.rotrSH(s,u,1)^e.rotrSH(s,u,8)^e.shrSH(s,u,7),E=e.rotrSL(s,u,1)^e.rotrSL(s,u,8)^e.shrSL(s,u,7),T=H[o-2]|0,G=b[o-2]|0,x=e.rotrSH(T,G,19)^e.rotrBH(T,G,61)^e.shrSH(T,G,6),A=e.rotrSL(T,G,19)^e.rotrBL(T,G,61)^e.shrSL(T,G,6),R=e.add4L(E,A,b[o-7],b[o-16]),F=e.add4H(R,m,x,H[o-7],H[o-16]);H[o]=F|0,b[o]=R|0}let{Ah:D,Al:P,Bh:Y,Bl:J,Ch:Z,Cl:$,Dh:tt,Dl:nt,Eh:X,El:z,Fh:y,Fl:M,Gh:v,Gl:g,Hh:_,Hl:V}=this;for(let o=0;o<80;o++){const s=e.rotrSH(X,z,14)^e.rotrSH(X,z,18)^e.rotrBH(X,z,41),u=e.rotrSL(X,z,14)^e.rotrSL(X,z,18)^e.rotrBL(X,z,41),m=X&y^~X&v,E=z&M^~z&g,T=e.add5L(V,u,E,C[o],b[o]),G=e.add5H(T,_,s,m,O[o],H[o]),x=T|0,A=e.rotrSH(D,P,28)^e.rotrBH(D,P,34)^e.rotrBH(D,P,39),R=e.rotrSL(D,P,28)^e.rotrBL(D,P,34)^e.rotrBL(D,P,39),F=D&Y^D&Z^Y&Z,q=P&J^P&$^J&$;_=v|0,V=g|0,v=y|0,g=M|0,y=X|0,M=z|0,{h:X,l:z}=e.add(tt|0,nt|0,G|0,x|0),tt=Z|0,nt=$|0,Z=Y|0,$=J|0,Y=D|0,J=P|0;const I=e.add3L(x,R,q);D=e.add3H(I,G,A,F),P=I|0}({h:D,l:P}=e.add(this.Ah|0,this.Al|0,D|0,P|0)),{h:Y,l:J}=e.add(this.Bh|0,this.Bl|0,Y|0,J|0),{h:Z,l:$}=e.add(this.Ch|0,this.Cl|0,Z|0,$|0),{h:tt,l:nt}=e.add(this.Dh|0,this.Dl|0,tt|0,nt|0),{h:X,l:z}=e.add(this.Eh|0,this.El|0,X|0,z|0),{h:y,l:M}=e.add(this.Fh|0,this.Fl|0,y|0,M|0),{h:v,l:g}=e.add(this.Gh|0,this.Gl|0,v|0,g|0),{h:_,l:V}=e.add(this.Hh|0,this.Hl|0,_|0,V|0),this.set(D,P,Y,J,Z,$,tt,nt,X,z,y,M,v,g,_,V)}roundClean(){(0,r.clean)(H,b)}destroy(){(0,r.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}_t.SHA512=k;class B extends k{constructor(){super(48),this.Ah=t.SHA384_IV[0]|0,this.Al=t.SHA384_IV[1]|0,this.Bh=t.SHA384_IV[2]|0,this.Bl=t.SHA384_IV[3]|0,this.Ch=t.SHA384_IV[4]|0,this.Cl=t.SHA384_IV[5]|0,this.Dh=t.SHA384_IV[6]|0,this.Dl=t.SHA384_IV[7]|0,this.Eh=t.SHA384_IV[8]|0,this.El=t.SHA384_IV[9]|0,this.Fh=t.SHA384_IV[10]|0,this.Fl=t.SHA384_IV[11]|0,this.Gh=t.SHA384_IV[12]|0,this.Gl=t.SHA384_IV[13]|0,this.Hh=t.SHA384_IV[14]|0,this.Hl=t.SHA384_IV[15]|0}}_t.SHA384=B;const p=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),S=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class L extends k{constructor(){super(28),this.Ah=p[0]|0,this.Al=p[1]|0,this.Bh=p[2]|0,this.Bl=p[3]|0,this.Ch=p[4]|0,this.Cl=p[5]|0,this.Dh=p[6]|0,this.Dl=p[7]|0,this.Eh=p[8]|0,this.El=p[9]|0,this.Fh=p[10]|0,this.Fl=p[11]|0,this.Gh=p[12]|0,this.Gl=p[13]|0,this.Hh=p[14]|0,this.Hl=p[15]|0}}_t.SHA512_224=L;class U extends k{constructor(){super(32),this.Ah=S[0]|0,this.Al=S[1]|0,this.Bh=S[2]|0,this.Bl=S[3]|0,this.Ch=S[4]|0,this.Cl=S[5]|0,this.Dh=S[6]|0,this.Dl=S[7]|0,this.Eh=S[8]|0,this.El=S[9]|0,this.Fh=S[10]|0,this.Fl=S[11]|0,this.Gh=S[12]|0,this.Gl=S[13]|0,this.Hh=S[14]|0,this.Hl=S[15]|0}}return _t.SHA512_256=U,_t.sha256=(0,r.createHasher)(()=>new a),_t.sha224=(0,r.createHasher)(()=>new h),_t.sha512=(0,r.createHasher)(()=>new k),_t.sha384=(0,r.createHasher)(()=>new B),_t.sha512_256=(0,r.createHasher)(()=>new U),_t.sha512_224=(0,r.createHasher)(()=>new L),_t}var Pt={},Ve={},Kn;function Yt(){return Kn||(Kn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=t.utf8ToBytes=t.randomBytes=t.isBytes=t.hexToBytes=t.concatBytes=t.bytesToUtf8=t.bytesToHex=t.anumber=t.abytes=void 0,t.abool=a,t._abool2=h,t._abytes2=d,t.numberToHexUnpadded=O,t.hexToNumber=C,t.bytesToNumberBE=H,t.bytesToNumberLE=b,t.numberToBytesBE=k,t.numberToBytesLE=B,t.numberToVarBytesBE=p,t.ensureBytes=S,t.equalBytes=L,t.copyBytes=U,t.asciiToBytes=K,t.inRange=et,t.aInRange=D,t.bitLen=P,t.bitGet=Y,t.bitSet=J,t.createHmacDrbg=$,t.validateObject=nt,t.isHash=X,t._validateObject=z,t.memoized=M;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=Gt();var r=Gt();Object.defineProperty(t,"abytes",{enumerable:!0,get:function(){return r.abytes}}),Object.defineProperty(t,"anumber",{enumerable:!0,get:function(){return r.anumber}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return r.bytesToHex}}),Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return r.bytesToUtf8}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return r.concatBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return r.hexToBytes}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return r.isBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return r.randomBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return r.utf8ToBytes}});const c=BigInt(0),l=BigInt(1);function a(v,g){if(typeof g!="boolean")throw new Error(v+" boolean expected, got "+g)}function h(v,g=""){if(typeof v!="boolean"){const _=g&&`"${g}"`;throw new Error(_+"expected boolean, got type="+typeof v)}return v}function d(v,g,_=""){const V=(0,e.isBytes)(v),o=v?.length,s=g!==void 0;if(!V||s&&o!==g){const u=_&&`"${_}" `,m=s?` of length ${g}`:"",E=V?`length=${o}`:`type=${typeof v}`;throw new Error(u+"expected Uint8Array"+m+", got "+E)}return v}function O(v){const g=v.toString(16);return g.length&1?"0"+g:g}function C(v){if(typeof v!="string")throw new Error("hex string expected, got "+typeof v);return v===""?c:BigInt("0x"+v)}function H(v){return C((0,e.bytesToHex)(v))}function b(v){return(0,e.abytes)(v),C((0,e.bytesToHex)(Uint8Array.from(v).reverse()))}function k(v,g){return(0,e.hexToBytes)(v.toString(16).padStart(g*2,"0"))}function B(v,g){return k(v,g).reverse()}function p(v){return(0,e.hexToBytes)(O(v))}function S(v,g,_){let V;if(typeof g=="string")try{V=(0,e.hexToBytes)(g)}catch(s){throw new Error(v+" must be hex string or Uint8Array, cause: "+s)}else if((0,e.isBytes)(g))V=Uint8Array.from(g);else throw new Error(v+" must be hex string or Uint8Array");const o=V.length;if(typeof _=="number"&&o!==_)throw new Error(v+" of length "+_+" expected, got "+o);return V}function L(v,g){if(v.length!==g.length)return!1;let _=0;for(let V=0;V<v.length;V++)_|=v[V]^g[V];return _===0}function U(v){return Uint8Array.from(v)}function K(v){return Uint8Array.from(v,(g,_)=>{const V=g.charCodeAt(0);if(g.length!==1||V>127)throw new Error(`string contains non-ASCII character "${v[_]}" with code ${V} at position ${_}`);return V})}const W=v=>typeof v=="bigint"&&c<=v;function et(v,g,_){return W(v)&&W(g)&&W(_)&&g<=v&&v<_}function D(v,g,_,V){if(!et(g,_,V))throw new Error("expected valid "+v+": "+_+" <= n < "+V+", got "+g)}function P(v){let g;for(g=0;v>c;v>>=l,g+=1);return g}function Y(v,g){return v>>BigInt(g)&l}function J(v,g,_){return v|(_?l:c)<<BigInt(g)}const Z=v=>(l<<BigInt(v))-l;t.bitMask=Z;function $(v,g,_){if(typeof v!="number"||v<2)throw new Error("hashLen must be a number");if(typeof g!="number"||g<2)throw new Error("qByteLen must be a number");if(typeof _!="function")throw new Error("hmacFn must be a function");const V=R=>new Uint8Array(R),o=R=>Uint8Array.of(R);let s=V(v),u=V(v),m=0;const E=()=>{s.fill(1),u.fill(0),m=0},T=(...R)=>_(u,s,...R),G=(R=V(0))=>{u=T(o(0),R),s=T(),R.length!==0&&(u=T(o(1),R),s=T())},x=()=>{if(m++>=1e3)throw new Error("drbg: tried 1000 values");let R=0;const F=[];for(;R<g;){s=T();const q=s.slice();F.push(q),R+=s.length}return(0,e.concatBytes)(...F)};return(R,F)=>{E(),G(R);let q;for(;!(q=F(x()));)G();return E(),q}}const tt={bigint:v=>typeof v=="bigint",function:v=>typeof v=="function",boolean:v=>typeof v=="boolean",string:v=>typeof v=="string",stringOrUint8Array:v=>typeof v=="string"||(0,e.isBytes)(v),isSafeInteger:v=>Number.isSafeInteger(v),array:v=>Array.isArray(v),field:(v,g)=>g.Fp.isValid(v),hash:v=>typeof v=="function"&&Number.isSafeInteger(v.outputLen)};function nt(v,g,_={}){const V=(o,s,u)=>{const m=tt[s];if(typeof m!="function")throw new Error("invalid validator function");const E=v[o];if(!(u&&E===void 0)&&!m(E,v))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+E)};for(const[o,s]of Object.entries(g))V(o,s,!1);for(const[o,s]of Object.entries(_))V(o,s,!0);return v}function X(v){return typeof v=="function"&&Number.isSafeInteger(v.outputLen)}function z(v,g,_={}){if(!v||typeof v!="object")throw new Error("expected valid options object");function V(o,s,u){const m=v[o];if(u&&m===void 0)return;const E=typeof m;if(E!==s||m===null)throw new Error(`param "${o}" is invalid: expected ${s}, got ${E}`)}Object.entries(g).forEach(([o,s])=>V(o,s,!1)),Object.entries(_).forEach(([o,s])=>V(o,s,!0))}const y=()=>{throw new Error("not implemented")};t.notImplemented=y;function M(v){const g=new WeakMap;return(_,...V)=>{const o=g.get(_);if(o!==void 0)return o;const s=v(_,...V);return g.set(_,s),s}}})(Ve)),Ve}var xt={},jn;function Qt(){if(jn)return xt;jn=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.isNegativeLE=void 0,xt.mod=b,xt.pow=k,xt.pow2=B,xt.invert=p,xt.tonelliShanks=W,xt.FpSqrt=et,xt.validateField=Y,xt.FpPow=J,xt.FpInvertBatch=Z,xt.FpDiv=$,xt.FpLegendre=tt,xt.FpIsSquare=nt,xt.nLength=X,xt.Field=z,xt.FpSqrtOdd=y,xt.FpSqrtEven=M,xt.hashToPrivateScalar=v,xt.getFieldBytesLength=g,xt.getMinHashLength=_,xt.mapHashToField=V;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yt(),e=BigInt(0),r=BigInt(1),c=BigInt(2),l=BigInt(3),a=BigInt(4),h=BigInt(5),d=BigInt(7),O=BigInt(8),C=BigInt(9),H=BigInt(16);function b(o,s){const u=o%s;return u>=e?u:s+u}function k(o,s,u){return J(z(u),o,s)}function B(o,s,u){let m=o;for(;s-- >e;)m*=m,m%=u;return m}function p(o,s){if(o===e)throw new Error("invert: expected non-zero number");if(s<=e)throw new Error("invert: expected positive modulus, got "+s);let u=b(o,s),m=s,E=e,T=r;for(;u!==e;){const x=m/u,A=m%u,R=E-T*x;m=u,u=A,E=T,T=R}if(m!==r)throw new Error("invert: does not exist");return b(E,s)}function S(o,s,u){if(!o.eql(o.sqr(s),u))throw new Error("Cannot find square root")}function L(o,s){const u=(o.ORDER+r)/a,m=o.pow(s,u);return S(o,m,s),m}function U(o,s){const u=(o.ORDER-h)/O,m=o.mul(s,c),E=o.pow(m,u),T=o.mul(s,E),G=o.mul(o.mul(T,c),E),x=o.mul(T,o.sub(G,o.ONE));return S(o,x,s),x}function K(o){const s=z(o),u=W(o),m=u(s,s.neg(s.ONE)),E=u(s,m),T=u(s,s.neg(m)),G=(o+d)/H;return(x,A)=>{let R=x.pow(A,G),F=x.mul(R,m);const q=x.mul(R,E),I=x.mul(R,T),j=x.eql(x.sqr(F),A),it=x.eql(x.sqr(q),A);R=x.cmov(R,F,j),F=x.cmov(I,q,it);const ot=x.eql(x.sqr(F),A),ut=x.cmov(R,F,ot);return S(x,ut,A),ut}}function W(o){if(o<l)throw new Error("sqrt is not defined for small field");let s=o-r,u=0;for(;s%c===e;)s/=c,u++;let m=c;const E=z(o);for(;tt(E,m)===1;)if(m++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(u===1)return L;let T=E.pow(m,s);const G=(s+r)/c;return function(A,R){if(A.is0(R))return R;if(tt(A,R)!==1)throw new Error("Cannot find square root");let F=u,q=A.mul(A.ONE,T),I=A.pow(R,s),j=A.pow(R,G);for(;!A.eql(I,A.ONE);){if(A.is0(I))return A.ZERO;let it=1,ot=A.sqr(I);for(;!A.eql(ot,A.ONE);)if(it++,ot=A.sqr(ot),it===F)throw new Error("Cannot find square root");const ut=r<<BigInt(F-it-1),ft=A.pow(q,ut);F=it,q=A.sqr(ft),I=A.mul(I,q),j=A.mul(j,ft)}return j}}function et(o){return o%a===l?L:o%O===h?U:o%H===C?K(o):W(o)}const D=(o,s)=>(b(o,s)&r)===r;xt.isNegativeLE=D;const P=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Y(o){const s={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},u=P.reduce((m,E)=>(m[E]="function",m),s);return(0,t._validateObject)(o,u),o}function J(o,s,u){if(u<e)throw new Error("invalid exponent, negatives unsupported");if(u===e)return o.ONE;if(u===r)return s;let m=o.ONE,E=s;for(;u>e;)u&r&&(m=o.mul(m,E)),E=o.sqr(E),u>>=r;return m}function Z(o,s,u=!1){const m=new Array(s.length).fill(u?o.ZERO:void 0),E=s.reduce((G,x,A)=>o.is0(x)?G:(m[A]=G,o.mul(G,x)),o.ONE),T=o.inv(E);return s.reduceRight((G,x,A)=>o.is0(x)?G:(m[A]=o.mul(G,m[A]),o.mul(G,x)),T),m}function $(o,s,u){return o.mul(s,typeof u=="bigint"?p(u,o.ORDER):o.inv(u))}function tt(o,s){const u=(o.ORDER-r)/c,m=o.pow(s,u),E=o.eql(m,o.ONE),T=o.eql(m,o.ZERO),G=o.eql(m,o.neg(o.ONE));if(!E&&!T&&!G)throw new Error("invalid Legendre symbol result");return E?1:T?0:-1}function nt(o,s){return tt(o,s)===1}function X(o,s){s!==void 0&&(0,t.anumber)(s);const u=s!==void 0?s:o.toString(2).length,m=Math.ceil(u/8);return{nBitLength:u,nByteLength:m}}function z(o,s,u=!1,m={}){if(o<=e)throw new Error("invalid field: expected ORDER > 0, got "+o);let E,T,G=!1,x;if(typeof s=="object"&&s!=null){if(m.sqrt||u)throw new Error("cannot specify opts in two arguments");const I=s;I.BITS&&(E=I.BITS),I.sqrt&&(T=I.sqrt),typeof I.isLE=="boolean"&&(u=I.isLE),typeof I.modFromBytes=="boolean"&&(G=I.modFromBytes),x=I.allowedLengths}else typeof s=="number"&&(E=s),m.sqrt&&(T=m.sqrt);const{nBitLength:A,nByteLength:R}=X(o,E);if(R>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let F;const q=Object.freeze({ORDER:o,isLE:u,BITS:A,BYTES:R,MASK:(0,t.bitMask)(A),ZERO:e,ONE:r,allowedLengths:x,create:I=>b(I,o),isValid:I=>{if(typeof I!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof I);return e<=I&&I<o},is0:I=>I===e,isValidNot0:I=>!q.is0(I)&&q.isValid(I),isOdd:I=>(I&r)===r,neg:I=>b(-I,o),eql:(I,j)=>I===j,sqr:I=>b(I*I,o),add:(I,j)=>b(I+j,o),sub:(I,j)=>b(I-j,o),mul:(I,j)=>b(I*j,o),pow:(I,j)=>J(q,I,j),div:(I,j)=>b(I*p(j,o),o),sqrN:I=>I*I,addN:(I,j)=>I+j,subN:(I,j)=>I-j,mulN:(I,j)=>I*j,inv:I=>p(I,o),sqrt:T||(I=>(F||(F=et(o)),F(q,I))),toBytes:I=>u?(0,t.numberToBytesLE)(I,R):(0,t.numberToBytesBE)(I,R),fromBytes:(I,j=!0)=>{if(x){if(!x.includes(I.length)||I.length>R)throw new Error("Field.fromBytes: expected "+x+" bytes, got "+I.length);const ot=new Uint8Array(R);ot.set(I,u?0:ot.length-I.length),I=ot}if(I.length!==R)throw new Error("Field.fromBytes: expected "+R+" bytes, got "+I.length);let it=u?(0,t.bytesToNumberLE)(I):(0,t.bytesToNumberBE)(I);if(G&&(it=b(it,o)),!j&&!q.isValid(it))throw new Error("invalid field element: outside of range 0..ORDER");return it},invertBatch:I=>Z(q,I),cmov:(I,j,it)=>it?j:I});return Object.freeze(q)}function y(o,s){if(!o.isOdd)throw new Error("Field doesn't have isOdd");const u=o.sqrt(s);return o.isOdd(u)?u:o.neg(u)}function M(o,s){if(!o.isOdd)throw new Error("Field doesn't have isOdd");const u=o.sqrt(s);return o.isOdd(u)?o.neg(u):u}function v(o,s,u=!1){o=(0,t.ensureBytes)("privateHash",o);const m=o.length,E=X(s).nByteLength+8;if(E<24||m<E||m>1024)throw new Error("hashToPrivateScalar: expected "+E+"-1024 bytes of input, got "+m);const T=u?(0,t.bytesToNumberLE)(o):(0,t.bytesToNumberBE)(o);return b(T,s-r)+r}function g(o){if(typeof o!="bigint")throw new Error("field order must be bigint");const s=o.toString(2).length;return Math.ceil(s/8)}function _(o){const s=g(o);return s+Math.ceil(s/2)}function V(o,s,u=!1){const m=o.length,E=g(s),T=_(s);if(m<16||m<T||m>1024)throw new Error("expected "+T+"-1024 bytes of input, got "+m);const G=u?(0,t.bytesToNumberLE)(o):(0,t.bytesToNumberBE)(o),x=b(G,s-r)+r;return u?(0,t.numberToBytesLE)(x,E):(0,t.numberToBytesBE)(x,E)}return xt}var Gn;function an(){if(Gn)return Pt;Gn=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.wNAF=void 0,Pt.negateCt=l,Pt.normalizeZ=a,Pt.mulEndoUnsafe=L,Pt.pippenger=U,Pt.precomputeMSMUnsafe=K,Pt.validateBasic=W,Pt._createCurveFields=D;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yt(),e=Qt(),r=BigInt(0),c=BigInt(1);function l(P,Y){const J=Y.negate();return P?J:Y}function a(P,Y){const J=(0,e.FpInvertBatch)(P.Fp,Y.map(Z=>Z.Z));return Y.map((Z,$)=>P.fromAffine(Z.toAffine(J[$])))}function h(P,Y){if(!Number.isSafeInteger(P)||P<=0||P>Y)throw new Error("invalid window size, expected [1.."+Y+"], got W="+P)}function d(P,Y){h(P,Y);const J=Math.ceil(Y/P)+1,Z=2**(P-1),$=2**P,tt=(0,t.bitMask)(P),nt=BigInt(P);return{windows:J,windowSize:Z,mask:tt,maxNumber:$,shiftBy:nt}}function O(P,Y,J){const{windowSize:Z,mask:$,maxNumber:tt,shiftBy:nt}=J;let X=Number(P&$),z=P>>nt;X>Z&&(X-=tt,z+=c);const y=Y*Z,M=y+Math.abs(X)-1,v=X===0,g=X<0,_=Y%2!==0;return{nextN:z,offset:M,isZero:v,isNeg:g,isNegF:_,offsetF:y}}function C(P,Y){if(!Array.isArray(P))throw new Error("array expected");P.forEach((J,Z)=>{if(!(J instanceof Y))throw new Error("invalid point at index "+Z)})}function H(P,Y){if(!Array.isArray(P))throw new Error("array of scalars expected");P.forEach((J,Z)=>{if(!Y.isValid(J))throw new Error("invalid scalar at index "+Z)})}const b=new WeakMap,k=new WeakMap;function B(P){return k.get(P)||1}function p(P){if(P!==r)throw new Error("invalid wNAF")}class S{constructor(Y,J){this.BASE=Y.BASE,this.ZERO=Y.ZERO,this.Fn=Y.Fn,this.bits=J}_unsafeLadder(Y,J,Z=this.ZERO){let $=Y;for(;J>r;)J&c&&(Z=Z.add($)),$=$.double(),J>>=c;return Z}precomputeWindow(Y,J){const{windows:Z,windowSize:$}=d(J,this.bits),tt=[];let nt=Y,X=nt;for(let z=0;z<Z;z++){X=nt,tt.push(X);for(let y=1;y<$;y++)X=X.add(nt),tt.push(X);nt=X.double()}return tt}wNAF(Y,J,Z){if(!this.Fn.isValid(Z))throw new Error("invalid scalar");let $=this.ZERO,tt=this.BASE;const nt=d(Y,this.bits);for(let X=0;X<nt.windows;X++){const{nextN:z,offset:y,isZero:M,isNeg:v,isNegF:g,offsetF:_}=O(Z,X,nt);Z=z,M?tt=tt.add(l(g,J[_])):$=$.add(l(v,J[y]))}return p(Z),{p:$,f:tt}}wNAFUnsafe(Y,J,Z,$=this.ZERO){const tt=d(Y,this.bits);for(let nt=0;nt<tt.windows&&Z!==r;nt++){const{nextN:X,offset:z,isZero:y,isNeg:M}=O(Z,nt,tt);if(Z=X,!y){const v=J[z];$=$.add(M?v.negate():v)}}return p(Z),$}getPrecomputes(Y,J,Z){let $=b.get(J);return $||($=this.precomputeWindow(J,Y),Y!==1&&(typeof Z=="function"&&($=Z($)),b.set(J,$))),$}cached(Y,J,Z){const $=B(Y);return this.wNAF($,this.getPrecomputes($,Y,Z),J)}unsafe(Y,J,Z,$){const tt=B(Y);return tt===1?this._unsafeLadder(Y,J,$):this.wNAFUnsafe(tt,this.getPrecomputes(tt,Y,Z),J,$)}createCache(Y,J){h(J,this.bits),k.set(Y,J),b.delete(Y)}hasCache(Y){return B(Y)!==1}}Pt.wNAF=S;function L(P,Y,J,Z){let $=Y,tt=P.ZERO,nt=P.ZERO;for(;J>r||Z>r;)J&c&&(tt=tt.add($)),Z&c&&(nt=nt.add($)),$=$.double(),J>>=c,Z>>=c;return{p1:tt,p2:nt}}function U(P,Y,J,Z){C(J,P),H(Z,Y);const $=J.length,tt=Z.length;if($!==tt)throw new Error("arrays of points and scalars must have equal length");const nt=P.ZERO,X=(0,t.bitLen)(BigInt($));let z=1;X>12?z=X-3:X>4?z=X-2:X>0&&(z=2);const y=(0,t.bitMask)(z),M=new Array(Number(y)+1).fill(nt),v=Math.floor((Y.BITS-1)/z)*z;let g=nt;for(let _=v;_>=0;_-=z){M.fill(nt);for(let o=0;o<tt;o++){const s=Z[o],u=Number(s>>BigInt(_)&y);M[u]=M[u].add(J[o])}let V=nt;for(let o=M.length-1,s=nt;o>0;o--)s=s.add(M[o]),V=V.add(s);if(g=g.add(V),_!==0)for(let o=0;o<z;o++)g=g.double()}return g}function K(P,Y,J,Z){h(Z,Y.BITS),C(J,P);const $=P.ZERO,tt=2**Z-1,nt=Math.ceil(Y.BITS/Z),X=(0,t.bitMask)(Z),z=J.map(y=>{const M=[];for(let v=0,g=y;v<tt;v++)M.push(g),g=g.add(y);return M});return y=>{if(H(y,Y),y.length>J.length)throw new Error("array of scalars must be smaller than array of points");let M=$;for(let v=0;v<nt;v++){if(M!==$)for(let _=0;_<Z;_++)M=M.double();const g=BigInt(nt*Z-(v+1)*Z);for(let _=0;_<y.length;_++){const V=y[_],o=Number(V>>g&X);o&&(M=M.add(z[_][o-1]))}}return M}}function W(P){return(0,e.validateField)(P.Fp),(0,t.validateObject)(P,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(P.n,P.nBitLength),...P,p:P.Fp.ORDER})}function et(P,Y,J){if(Y){if(Y.ORDER!==P)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,e.validateField)(Y),Y}else return(0,e.Field)(P,{isLE:J})}function D(P,Y,J={},Z){if(Z===void 0&&(Z=P==="edwards"),!Y||typeof Y!="object")throw new Error(`expected valid ${P} CURVE object`);for(const z of["p","n","h"]){const y=Y[z];if(!(typeof y=="bigint"&&y>r))throw new Error(`CURVE.${z} must be positive bigint`)}const $=et(Y.p,J.Fp,Z),tt=et(Y.n,J.Fn,Z),X=["Gx","Gy","a",P==="weierstrass"?"b":"d"];for(const z of X)if(!$.isValid(Y[z]))throw new Error(`CURVE.${z} must be valid field element of CURVE.Fp`);return Y=Object.freeze(Object.assign({},Y)),{CURVE:Y,Fp:$,Fn:tt}}return Pt}var qt={},Zn;function Is(){if(Zn)return qt;Zn=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.PrimeEdwardsPoint=void 0,qt.edwards=O,qt.eddsa=H,qt.twistedEdwards=B;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yt(),e=an(),r=Qt(),c=BigInt(0),l=BigInt(1),a=BigInt(2),h=BigInt(8);function d(p,S,L,U){const K=p.sqr(L),W=p.sqr(U),et=p.add(p.mul(S.a,K),W),D=p.add(p.ONE,p.mul(S.d,p.mul(K,W)));return p.eql(et,D)}function O(p,S={}){const L=(0,e._createCurveFields)("edwards",p,S,S.FpFnLE),{Fp:U,Fn:K}=L;let W=L.CURVE;const{h:et}=W;(0,t._validateObject)(S,{},{uvRatio:"function"});const D=a<<BigInt(K.BYTES*8)-l,P=z=>U.create(z),Y=S.uvRatio||((z,y)=>{try{return{isValid:!0,value:U.sqrt(U.div(z,y))}}catch{return{isValid:!1,value:c}}});if(!d(U,W,W.Gx,W.Gy))throw new Error("bad curve params: generator point");function J(z,y,M=!1){const v=M?l:c;return(0,t.aInRange)("coordinate "+z,y,v,D),y}function Z(z){if(!(z instanceof nt))throw new Error("ExtendedPoint expected")}const $=(0,t.memoized)((z,y)=>{const{X:M,Y:v,Z:g}=z,_=z.is0();y==null&&(y=_?h:U.inv(g));const V=P(M*y),o=P(v*y),s=U.mul(g,y);if(_)return{x:c,y:l};if(s!==l)throw new Error("invZ was invalid");return{x:V,y:o}}),tt=(0,t.memoized)(z=>{const{a:y,d:M}=W;if(z.is0())throw new Error("bad point: ZERO");const{X:v,Y:g,Z:_,T:V}=z,o=P(v*v),s=P(g*g),u=P(_*_),m=P(u*u),E=P(o*y),T=P(u*P(E+s)),G=P(m+P(M*P(o*s)));if(T!==G)throw new Error("bad point: equation left != right (1)");const x=P(v*g),A=P(_*V);if(x!==A)throw new Error("bad point: equation left != right (2)");return!0});class nt{constructor(y,M,v,g){this.X=J("x",y),this.Y=J("y",M),this.Z=J("z",v,!0),this.T=J("t",g),Object.freeze(this)}static CURVE(){return W}static fromAffine(y){if(y instanceof nt)throw new Error("extended point not allowed");const{x:M,y:v}=y||{};return J("x",M),J("y",v),new nt(M,v,l,P(M*v))}static fromBytes(y,M=!1){const v=U.BYTES,{a:g,d:_}=W;y=(0,t.copyBytes)((0,t._abytes2)(y,v,"point")),(0,t._abool2)(M,"zip215");const V=(0,t.copyBytes)(y),o=y[v-1];V[v-1]=o&-129;const s=(0,t.bytesToNumberLE)(V),u=M?D:U.ORDER;(0,t.aInRange)("point.y",s,c,u);const m=P(s*s),E=P(m-l),T=P(_*m-g);let{isValid:G,value:x}=Y(E,T);if(!G)throw new Error("bad point: invalid y coordinate");const A=(x&l)===l,R=(o&128)!==0;if(!M&&x===c&&R)throw new Error("bad point: x=0 and x_0=1");return R!==A&&(x=P(-x)),nt.fromAffine({x,y:s})}static fromHex(y,M=!1){return nt.fromBytes((0,t.ensureBytes)("point",y),M)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(y=8,M=!0){return X.createCache(this,y),M||this.multiply(a),this}assertValidity(){tt(this)}equals(y){Z(y);const{X:M,Y:v,Z:g}=this,{X:_,Y:V,Z:o}=y,s=P(M*o),u=P(_*g),m=P(v*o),E=P(V*g);return s===u&&m===E}is0(){return this.equals(nt.ZERO)}negate(){return new nt(P(-this.X),this.Y,this.Z,P(-this.T))}double(){const{a:y}=W,{X:M,Y:v,Z:g}=this,_=P(M*M),V=P(v*v),o=P(a*P(g*g)),s=P(y*_),u=M+v,m=P(P(u*u)-_-V),E=s+V,T=E-o,G=s-V,x=P(m*T),A=P(E*G),R=P(m*G),F=P(T*E);return new nt(x,A,F,R)}add(y){Z(y);const{a:M,d:v}=W,{X:g,Y:_,Z:V,T:o}=this,{X:s,Y:u,Z:m,T:E}=y,T=P(g*s),G=P(_*u),x=P(o*v*E),A=P(V*m),R=P((g+_)*(s+u)-T-G),F=A-x,q=A+x,I=P(G-M*T),j=P(R*F),it=P(q*I),ot=P(R*I),ut=P(F*q);return new nt(j,it,ut,ot)}subtract(y){return this.add(y.negate())}multiply(y){if(!K.isValidNot0(y))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:M,f:v}=X.cached(this,y,g=>(0,e.normalizeZ)(nt,g));return(0,e.normalizeZ)(nt,[M,v])[0]}multiplyUnsafe(y,M=nt.ZERO){if(!K.isValid(y))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return y===c?nt.ZERO:this.is0()||y===l?this:X.unsafe(this,y,v=>(0,e.normalizeZ)(nt,v),M)}isSmallOrder(){return this.multiplyUnsafe(et).is0()}isTorsionFree(){return X.unsafe(this,W.n).is0()}toAffine(y){return $(this,y)}clearCofactor(){return et===l?this:this.multiplyUnsafe(et)}toBytes(){const{x:y,y:M}=this.toAffine(),v=U.toBytes(M);return v[v.length-1]|=y&l?128:0,v}toHex(){return(0,t.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(y){return(0,e.normalizeZ)(nt,y)}static msm(y,M){return(0,e.pippenger)(nt,K,y,M)}_setWindowSize(y){this.precompute(y)}toRawBytes(){return this.toBytes()}}nt.BASE=new nt(W.Gx,W.Gy,l,P(W.Gx*W.Gy)),nt.ZERO=new nt(c,l,l,c),nt.Fp=U,nt.Fn=K;const X=new e.wNAF(nt,K.BITS);return nt.BASE.precompute(8),nt}class C{constructor(S){this.ep=S}static fromBytes(S){(0,t.notImplemented)()}static fromHex(S){(0,t.notImplemented)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(S){return this.ep.toAffine(S)}toHex(){return(0,t.bytesToHex)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(S){return this.assertSame(S),this.init(this.ep.add(S.ep))}subtract(S){return this.assertSame(S),this.init(this.ep.subtract(S.ep))}multiply(S){return this.init(this.ep.multiply(S))}multiplyUnsafe(S){return this.init(this.ep.multiplyUnsafe(S))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(S,L){return this.init(this.ep.precompute(S,L))}toRawBytes(){return this.toBytes()}}qt.PrimeEdwardsPoint=C;function H(p,S,L={}){if(typeof S!="function")throw new Error('"hash" function param is required');(0,t._validateObject)(L,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:U}=L,{BASE:K,Fp:W,Fn:et}=p,D=L.randomBytes||t.randomBytes,P=L.adjustScalarBytes||(u=>u),Y=L.domain||((u,m,E)=>{if((0,t._abool2)(E,"phflag"),m.length||E)throw new Error("Contexts/pre-hash are not supported");return u});function J(u){return et.create((0,t.bytesToNumberLE)(u))}function Z(u){const m=v.secretKey;u=(0,t.ensureBytes)("private key",u,m);const E=(0,t.ensureBytes)("hashed private key",S(u),2*m),T=P(E.slice(0,m)),G=E.slice(m,2*m),x=J(T);return{head:T,prefix:G,scalar:x}}function $(u){const{head:m,prefix:E,scalar:T}=Z(u),G=K.multiply(T),x=G.toBytes();return{head:m,prefix:E,scalar:T,point:G,pointBytes:x}}function tt(u){return $(u).pointBytes}function nt(u=Uint8Array.of(),...m){const E=(0,t.concatBytes)(...m);return J(S(Y(E,(0,t.ensureBytes)("context",u),!!U)))}function X(u,m,E={}){u=(0,t.ensureBytes)("message",u),U&&(u=U(u));const{prefix:T,scalar:G,pointBytes:x}=$(m),A=nt(E.context,T,u),R=K.multiply(A).toBytes(),F=nt(E.context,R,x,u),q=et.create(A+F*G);if(!et.isValid(q))throw new Error("sign failed: invalid s");const I=(0,t.concatBytes)(R,et.toBytes(q));return(0,t._abytes2)(I,v.signature,"result")}const z={zip215:!0};function y(u,m,E,T=z){const{context:G,zip215:x}=T,A=v.signature;u=(0,t.ensureBytes)("signature",u,A),m=(0,t.ensureBytes)("message",m),E=(0,t.ensureBytes)("publicKey",E,v.publicKey),x!==void 0&&(0,t._abool2)(x,"zip215"),U&&(m=U(m));const R=A/2,F=u.subarray(0,R),q=(0,t.bytesToNumberLE)(u.subarray(R,A));let I,j,it;try{I=p.fromBytes(E,x),j=p.fromBytes(F,x),it=K.multiplyUnsafe(q)}catch{return!1}if(!x&&I.isSmallOrder())return!1;const ot=nt(G,j.toBytes(),I.toBytes(),m);return j.add(I.multiplyUnsafe(ot)).subtract(it).clearCofactor().is0()}const M=W.BYTES,v={secretKey:M,publicKey:M,signature:2*M,seed:M};function g(u=D(v.seed)){return(0,t._abytes2)(u,v.seed,"seed")}function _(u){const m=s.randomSecretKey(u);return{secretKey:m,publicKey:tt(m)}}function V(u){return(0,t.isBytes)(u)&&u.length===et.BYTES}function o(u,m){try{return!!p.fromBytes(u,m)}catch{return!1}}const s={getExtendedPublicKey:$,randomSecretKey:g,isValidSecretKey:V,isValidPublicKey:o,toMontgomery(u){const{y:m}=p.fromBytes(u),E=v.publicKey,T=E===32;if(!T&&E!==57)throw new Error("only defined for 25519 and 448");const G=T?W.div(l+m,l-m):W.div(m-l,m+l);return W.toBytes(G)},toMontgomerySecret(u){const m=v.secretKey;(0,t._abytes2)(u,m);const E=S(u.subarray(0,m));return P(E).subarray(0,m)},randomPrivateKey:g,precompute(u=8,m=p.BASE){return m.precompute(u,!1)}};return Object.freeze({keygen:_,getPublicKey:tt,sign:X,verify:y,utils:s,Point:p,lengths:v})}function b(p){const S={a:p.a,d:p.d,p:p.Fp.ORDER,n:p.n,h:p.h,Gx:p.Gx,Gy:p.Gy},L=p.Fp,U=(0,r.Field)(S.n,p.nBitLength,!0),K={Fp:L,Fn:U,uvRatio:p.uvRatio},W={randomBytes:p.randomBytes,adjustScalarBytes:p.adjustScalarBytes,domain:p.domain,prehash:p.prehash,mapToCurve:p.mapToCurve};return{CURVE:S,curveOpts:K,hash:p.hash,eddsaOpts:W}}function k(p,S){const L=S.Point;return Object.assign({},S,{ExtendedPoint:L,CURVE:p,nBitLength:L.Fn.BITS,nByteLength:L.Fn.BYTES})}function B(p){const{CURVE:S,curveOpts:L,hash:U,eddsaOpts:K}=b(p),W=O(S,L),et=H(W,U,K);return k(p,et)}return qt}var Fe={},qn;function jr(){return qn||(qn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._DST_scalar=void 0,t.expand_message_xmd=O,t.expand_message_xof=C,t.hash_to_field=H,t.isogenyMap=b,t.createHasher=k;const e=Yt(),r=Qt(),c=e.bytesToNumberBE;function l(B,p){if(h(B),h(p),B<0||B>=1<<8*p)throw new Error("invalid I2OSP input: "+B);const S=Array.from({length:p}).fill(0);for(let L=p-1;L>=0;L--)S[L]=B&255,B>>>=8;return new Uint8Array(S)}function a(B,p){const S=new Uint8Array(B.length);for(let L=0;L<B.length;L++)S[L]=B[L]^p[L];return S}function h(B){if(!Number.isSafeInteger(B))throw new Error("number expected")}function d(B){if(!(0,e.isBytes)(B)&&typeof B!="string")throw new Error("DST must be Uint8Array or string");return typeof B=="string"?(0,e.utf8ToBytes)(B):B}function O(B,p,S,L){(0,e.abytes)(B),h(S),p=d(p),p.length>255&&(p=L((0,e.concatBytes)((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-"),p)));const{outputLen:U,blockLen:K}=L,W=Math.ceil(S/U);if(S>65535||W>255)throw new Error("expand_message_xmd: invalid lenInBytes");const et=(0,e.concatBytes)(p,l(p.length,1)),D=l(0,K),P=l(S,2),Y=new Array(W),J=L((0,e.concatBytes)(D,B,P,l(0,1),et));Y[0]=L((0,e.concatBytes)(J,l(1,1),et));for(let $=1;$<=W;$++){const tt=[a(J,Y[$-1]),l($+1,1),et];Y[$]=L((0,e.concatBytes)(...tt))}return(0,e.concatBytes)(...Y).slice(0,S)}function C(B,p,S,L,U){if((0,e.abytes)(B),h(S),p=d(p),p.length>255){const K=Math.ceil(2*L/8);p=U.create({dkLen:K}).update((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(p).digest()}if(S>65535||p.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return U.create({dkLen:S}).update(B).update(l(S,2)).update(p).update(l(p.length,1)).digest()}function H(B,p,S){(0,e._validateObject)(S,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:L,k:U,m:K,hash:W,expand:et,DST:D}=S;if(!(0,e.isHash)(S.hash))throw new Error("expected valid hash");(0,e.abytes)(B),h(p);const P=L.toString(2).length,Y=Math.ceil((P+U)/8),J=p*K*Y;let Z;if(et==="xmd")Z=O(B,D,J,W);else if(et==="xof")Z=C(B,D,J,U,W);else if(et==="_internal_pass")Z=B;else throw new Error('expand must be "xmd" or "xof"');const $=new Array(p);for(let tt=0;tt<p;tt++){const nt=new Array(K);for(let X=0;X<K;X++){const z=Y*(X+tt*K),y=Z.subarray(z,z+Y);nt[X]=(0,r.mod)(c(y),L)}$[tt]=nt}return $}function b(B,p){const S=p.map(L=>Array.from(L).reverse());return(L,U)=>{const[K,W,et,D]=S.map(J=>J.reduce((Z,$)=>B.add(B.mul(Z,L),$))),[P,Y]=(0,r.FpInvertBatch)(B,[W,D],!0);return L=B.mul(K,P),U=B.mul(U,B.mul(et,Y)),{x:L,y:U}}}t._DST_scalar=(0,e.utf8ToBytes)("HashToScalar-");function k(B,p,S){if(typeof p!="function")throw new Error("mapToCurve() must be defined");function L(K){return B.fromAffine(p(K))}function U(K){const W=K.clearCofactor();return W.equals(B.ZERO)?B.ZERO:(W.assertValidity(),W)}return{defaults:S,hashToCurve(K,W){const et=Object.assign({},S,W),D=H(K,2,et),P=L(D[0]),Y=L(D[1]);return U(P.add(Y))},encodeToCurve(K,W){const et=S.encodeDST?{DST:S.encodeDST}:{},D=Object.assign({},S,et,W),P=H(K,1,D),Y=L(P[0]);return U(Y)},mapToCurve(K){if(!Array.isArray(K))throw new Error("expected array of bigints");for(const W of K)if(typeof W!="bigint")throw new Error("expected array of bigints");return U(L(K))},hashToScalar(K,W){const et=B.Fn.ORDER,D=Object.assign({},S,{p:et,m:1,DST:t._DST_scalar},W);return H(K,1,D)[0][0]}}}})(Fe)),Fe}var we={},Wn;function As(){if(Wn)return we;Wn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.montgomery=h;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yt(),e=Qt(),r=BigInt(0),c=BigInt(1),l=BigInt(2);function a(d){return(0,t._validateObject)(d,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...d})}function h(d){const O=a(d),{P:C,type:H,adjustScalarBytes:b,powPminus2:k,randomBytes:B}=O,p=H==="x25519";if(!p&&H!=="x448")throw new Error("invalid type");const S=B||t.randomBytes,L=p?255:448,U=p?32:56,K=BigInt(p?9:5),W=BigInt(p?121665:39081),et=p?l**BigInt(254):l**BigInt(447),D=p?BigInt(8)*l**BigInt(251)-c:BigInt(4)*l**BigInt(445)-c,P=et+D+c,Y=V=>(0,e.mod)(V,C),J=Z(K);function Z(V){return(0,t.numberToBytesLE)(Y(V),U)}function $(V){const o=(0,t.ensureBytes)("u coordinate",V,U);return p&&(o[31]&=127),Y((0,t.bytesToNumberLE)(o))}function tt(V){return(0,t.bytesToNumberLE)(b((0,t.ensureBytes)("scalar",V,U)))}function nt(V,o){const s=y($(o),tt(V));if(s===r)throw new Error("invalid private or public key received");return Z(s)}function X(V){return nt(V,J)}function z(V,o,s){const u=Y(V*(o-s));return o=Y(o-u),s=Y(s+u),{x_2:o,x_3:s}}function y(V,o){(0,t.aInRange)("u",V,r,C),(0,t.aInRange)("scalar",o,et,P);const s=o,u=V;let m=c,E=r,T=V,G=c,x=r;for(let R=BigInt(L-1);R>=r;R--){const F=s>>R&c;x^=F,{x_2:m,x_3:T}=z(x,m,T),{x_2:E,x_3:G}=z(x,E,G),x=F;const q=m+E,I=Y(q*q),j=m-E,it=Y(j*j),ot=I-it,ut=T+G,ft=T-G,dt=Y(ft*q),lt=Y(ut*j),wt=dt+lt,yt=dt-lt;T=Y(wt*wt),G=Y(u*Y(yt*yt)),m=Y(I*it),E=Y(ot*(I+Y(W*ot)))}({x_2:m,x_3:T}=z(x,m,T)),{x_2:E,x_3:G}=z(x,E,G);const A=k(E);return Y(m*A)}const M={secretKey:U,publicKey:U,seed:U},v=(V=S(U))=>((0,t.abytes)(V,M.seed),V);function g(V){const o=v(V);return{secretKey:o,publicKey:X(o)}}return{keygen:g,getSharedSecret:(V,o)=>nt(V,o),getPublicKey:V=>X(V),scalarMult:nt,scalarMultBase:X,utils:{randomSecretKey:v,randomPrivateKey:v},GuBytes:J.slice(),lengths:M}}return we}var Yn;function Ts(){return Yn||(Yn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash_to_ristretto255=t.hashToRistretto255=t.encodeToCurve=t.hashToCurve=t.RistrettoPoint=t.edwardsToMontgomery=t.ED25519_TORSION_SUBGROUP=t.ristretto255_hasher=t.ristretto255=t.ed25519_hasher=t.x25519=t.ed25519ph=t.ed25519ctx=t.ed25519=void 0,t.edwardsToMontgomeryPub=T,t.edwardsToMontgomeryPriv=G;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=cn(),r=Gt(),c=an(),l=Is(),a=jr(),h=Qt(),d=As(),O=Yt(),C=BigInt(0),H=BigInt(1),b=BigInt(2),k=BigInt(3),B=BigInt(5),p=BigInt(8),S=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),L={p:S,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:p,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function U(x){const A=BigInt(10),R=BigInt(20),F=BigInt(40),q=BigInt(80),I=S,it=x*x%I*x%I,ot=(0,h.pow2)(it,b,I)*it%I,ut=(0,h.pow2)(ot,H,I)*x%I,ft=(0,h.pow2)(ut,B,I)*ut%I,dt=(0,h.pow2)(ft,A,I)*ft%I,lt=(0,h.pow2)(dt,R,I)*dt%I,wt=(0,h.pow2)(lt,F,I)*lt%I,yt=(0,h.pow2)(wt,q,I)*wt%I,ht=(0,h.pow2)(yt,q,I)*wt%I,at=(0,h.pow2)(ht,A,I)*ft%I;return{pow_p_5_8:(0,h.pow2)(at,b,I)*x%I,b2:it}}function K(x){return x[0]&=248,x[31]&=127,x[31]|=64,x}const W=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function et(x,A){const R=S,F=(0,h.mod)(A*A*A,R),q=(0,h.mod)(F*F*A,R),I=U(x*q).pow_p_5_8;let j=(0,h.mod)(x*F*I,R);const it=(0,h.mod)(A*j*j,R),ot=j,ut=(0,h.mod)(j*W,R),ft=it===x,dt=it===(0,h.mod)(-x,R),lt=it===(0,h.mod)(-x*W,R);return ft&&(j=ot),(dt||lt)&&(j=ut),(0,h.isNegativeLE)(j,R)&&(j=(0,h.mod)(-j,R)),{isValid:ft||dt,value:j}}const D=(0,h.Field)(L.p,{isLE:!0}),P=(0,h.Field)(L.n,{isLE:!0}),Y={...L,Fp:D,hash:e.sha512,adjustScalarBytes:K,uvRatio:et};t.ed25519=(0,l.twistedEdwards)(Y);function J(x,A,R){if(A.length>255)throw new Error("Context is too big");return(0,r.concatBytes)((0,r.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([R?1:0,A.length]),A,x)}t.ed25519ctx=(0,l.twistedEdwards)({...Y,domain:J}),t.ed25519ph=(0,l.twistedEdwards)(Object.assign({},Y,{domain:J,prehash:e.sha512})),t.x25519=(()=>{const x=D.ORDER;return(0,d.montgomery)({P:x,type:"x25519",powPminus2:A=>{const{pow_p_5_8:R,b2:F}=U(A);return(0,h.mod)((0,h.pow2)(R,k,x)*F,x)},adjustScalarBytes:K})})();const Z=(S+k)/p,$=D.pow(b,Z),tt=D.sqrt(D.neg(D.ONE));function nt(x){const A=(S-B)/p,R=BigInt(486662);let F=D.sqr(x);F=D.mul(F,b);let q=D.add(F,D.ONE),I=D.neg(R),j=D.sqr(q),it=D.mul(j,q),ot=D.mul(F,R);ot=D.mul(ot,I),ot=D.add(ot,j),ot=D.mul(ot,I);let ut=D.sqr(it);j=D.sqr(ut),ut=D.mul(ut,it),ut=D.mul(ut,ot),j=D.mul(j,ut);let ft=D.pow(j,A);ft=D.mul(ft,ut);let dt=D.mul(ft,tt);j=D.sqr(ft),j=D.mul(j,it);let lt=D.eql(j,ot),wt=D.cmov(dt,ft,lt),yt=D.mul(I,F),ht=D.mul(ft,x);ht=D.mul(ht,$);let at=D.mul(ht,tt),st=D.mul(ot,F);j=D.sqr(ht),j=D.mul(j,it);let ct=D.eql(j,st),f=D.cmov(at,ht,ct);j=D.sqr(wt),j=D.mul(j,it);let n=D.eql(j,ot),i=D.cmov(yt,I,n),w=D.cmov(f,wt,n),N=D.isOdd(w);return w=D.cmov(w,D.neg(w),n!==N),{xMn:i,xMd:q,yMn:w,yMd:H}}const X=(0,h.FpSqrtEven)(D,D.neg(BigInt(486664)));function z(x){const{xMn:A,xMd:R,yMn:F,yMd:q}=nt(x);let I=D.mul(A,q);I=D.mul(I,X);let j=D.mul(R,F),it=D.sub(A,R),ot=D.add(A,R),ut=D.mul(j,ot),ft=D.eql(ut,D.ZERO);I=D.cmov(I,D.ZERO,ft),j=D.cmov(j,D.ONE,ft),it=D.cmov(it,D.ONE,ft),ot=D.cmov(ot,D.ONE,ft);const[dt,lt]=(0,h.FpInvertBatch)(D,[j,ot],!0);return{x:D.mul(I,dt),y:D.mul(it,lt)}}t.ed25519_hasher=(0,a.createHasher)(t.ed25519.Point,x=>z(x[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:S,m:1,k:128,expand:"xmd",hash:e.sha512});const y=W,M=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),v=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),g=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),_=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),V=x=>et(H,x),o=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s=x=>t.ed25519.Point.Fp.create((0,O.bytesToNumberLE)(x)&o);function u(x){const{d:A}=L,R=S,F=st=>D.create(st),q=F(y*x*x),I=F((q+H)*g);let j=BigInt(-1);const it=F((j-A*q)*F(q+A));let{isValid:ot,value:ut}=et(I,it),ft=F(ut*x);(0,h.isNegativeLE)(ft,R)||(ft=F(-ft)),ot||(ut=ft),ot||(j=q);const dt=F(j*(q-H)*_-it),lt=ut*ut,wt=F((ut+ut)*it),yt=F(dt*M),ht=F(H-lt),at=F(H+lt);return new t.ed25519.Point(F(wt*at),F(ht*yt),F(yt*at),F(wt*ht))}function m(x){(0,r.abytes)(x,64);const A=s(x.subarray(0,32)),R=u(A),F=s(x.subarray(32,64)),q=u(F);return new E(R.add(q))}class E extends l.PrimeEdwardsPoint{constructor(A){super(A)}static fromAffine(A){return new E(t.ed25519.Point.fromAffine(A))}assertSame(A){if(!(A instanceof E))throw new Error("RistrettoPoint expected")}init(A){return new E(A)}static hashToCurve(A){return m((0,O.ensureBytes)("ristrettoHash",A,64))}static fromBytes(A){(0,r.abytes)(A,32);const{a:R,d:F}=L,q=S,I=n=>D.create(n),j=s(A);if(!(0,O.equalBytes)(D.toBytes(j),A)||(0,h.isNegativeLE)(j,q))throw new Error("invalid ristretto255 encoding 1");const it=I(j*j),ot=I(H+R*it),ut=I(H-R*it),ft=I(ot*ot),dt=I(ut*ut),lt=I(R*F*ft-dt),{isValid:wt,value:yt}=V(I(lt*dt)),ht=I(yt*ut),at=I(yt*ht*lt);let st=I((j+j)*ht);(0,h.isNegativeLE)(st,q)&&(st=I(-st));const ct=I(ot*at),f=I(st*ct);if(!wt||(0,h.isNegativeLE)(f,q)||ct===C)throw new Error("invalid ristretto255 encoding 2");return new E(new t.ed25519.Point(st,ct,H,f))}static fromHex(A){return E.fromBytes((0,O.ensureBytes)("ristrettoHex",A,32))}static msm(A,R){return(0,c.pippenger)(E,t.ed25519.Point.Fn,A,R)}toBytes(){let{X:A,Y:R,Z:F,T:q}=this.ep;const I=S,j=at=>D.create(at),it=j(j(F+R)*j(F-R)),ot=j(A*R),ut=j(ot*ot),{value:ft}=V(j(it*ut)),dt=j(ft*it),lt=j(ft*ot),wt=j(dt*lt*q);let yt;if((0,h.isNegativeLE)(q*wt,I)){let at=j(R*y),st=j(A*y);A=at,R=st,yt=j(dt*v)}else yt=lt;(0,h.isNegativeLE)(A*wt,I)&&(R=j(-R));let ht=j((F-R)*yt);return(0,h.isNegativeLE)(ht,I)&&(ht=j(-ht)),D.toBytes(ht)}equals(A){this.assertSame(A);const{X:R,Y:F}=this.ep,{X:q,Y:I}=A.ep,j=ut=>D.create(ut),it=j(R*I)===j(F*q),ot=j(F*I)===j(R*q);return it||ot}is0(){return this.equals(E.ZERO)}}E.BASE=new E(t.ed25519.Point.BASE),E.ZERO=new E(t.ed25519.Point.ZERO),E.Fp=D,E.Fn=P,t.ristretto255={Point:E},t.ristretto255_hasher={hashToCurve(x,A){const R=A?.DST||"ristretto255_XMD:SHA-512_R255MAP_RO_",F=(0,a.expand_message_xmd)(x,R,64,e.sha512);return m(F)},hashToScalar(x,A={DST:a._DST_scalar}){const R=(0,a.expand_message_xmd)(x,A.DST,64,e.sha512);return P.create((0,O.bytesToNumberLE)(R))}},t.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];function T(x){return t.ed25519.utils.toMontgomery((0,O.ensureBytes)("pub",x))}t.edwardsToMontgomery=T;function G(x){return t.ed25519.utils.toMontgomerySecret((0,O.ensureBytes)("pub",x))}t.RistrettoPoint=E,t.hashToCurve=t.ed25519_hasher.hashToCurve,t.encodeToCurve=t.ed25519_hasher.encodeToCurve,t.hashToRistretto255=t.ristretto255_hasher.hashToCurve,t.hash_to_ristretto255=t.ristretto255_hasher.hashToCurve})(ke)),ke}var De={},ae={},Ke={},je={},zn;function Gr(){return zn||(zn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=Gt();class r extends e.Hash{constructor(a,h){super(),this.finished=!1,this.destroyed=!1,(0,e.ahash)(a);const d=(0,e.toBytes)(h);if(this.iHash=a.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const O=this.blockLen,C=new Uint8Array(O);C.set(d.length>O?a.create().update(d).digest():d);for(let H=0;H<C.length;H++)C[H]^=54;this.iHash.update(C),this.oHash=a.create();for(let H=0;H<C.length;H++)C[H]^=106;this.oHash.update(C),(0,e.clean)(C)}update(a){return(0,e.aexists)(this),this.iHash.update(a),this}digestInto(a){(0,e.aexists)(this),(0,e.abytes)(a,this.outputLen),this.finished=!0,this.iHash.digestInto(a),this.oHash.update(a),this.oHash.digestInto(a),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||(a=Object.create(Object.getPrototypeOf(this),{}));const{oHash:h,iHash:d,finished:O,destroyed:C,blockLen:H,outputLen:b}=this;return a=a,a.finished=O,a.destroyed=C,a.blockLen=H,a.outputLen=b,a.oHash=h._cloneInto(a.oHash),a.iHash=d._cloneInto(a.iHash),a}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=r;const c=(l,a,h)=>new r(l,a).update(h).digest();t.hmac=c,t.hmac.create=(l,a)=>new r(l,a)})(je)),je}var Xn;function Zr(){return Xn||(Xn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t._splitEndoScalar=d,t._normFnElement=L,t.weierstrassN=U,t.SWUFpSqrtRatio=W,t.mapToCurveSimpleSWU=et,t.ecdh=P,t.ecdsa=Y,t.weierstrassPoints=J,t._legacyHelperEquat=tt,t.weierstrass=z;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=Gr(),r=Gt(),c=Yt(),l=an(),a=Qt(),h=(y,M)=>(y+(y>=0?M:-M)/B)/M;function d(y,M,v){const[[g,_],[V,o]]=M,s=h(o*y,v),u=h(-_*y,v);let m=y-s*g-u*V,E=-s*_-u*o;const T=m<b,G=E<b;T&&(m=-m),G&&(E=-E);const x=(0,c.bitMask)(Math.ceil((0,c.bitLen)(v)/2))+k;if(m<b||m>=x||E<b||E>=x)throw new Error("splitScalar (endomorphism): failed, k="+y);return{k1neg:T,k1:m,k2neg:G,k2:E}}function O(y){if(!["compact","recovered","der"].includes(y))throw new Error('Signature format must be "compact", "recovered", or "der"');return y}function C(y,M){const v={};for(let g of Object.keys(M))v[g]=y[g]===void 0?M[g]:y[g];return(0,c._abool2)(v.lowS,"lowS"),(0,c._abool2)(v.prehash,"prehash"),v.format!==void 0&&O(v.format),v}class H extends Error{constructor(M=""){super(M)}}t.DERErr=H,t.DER={Err:H,_tlv:{encode:(y,M)=>{const{Err:v}=t.DER;if(y<0||y>256)throw new v("tlv.encode: wrong tag");if(M.length&1)throw new v("tlv.encode: unpadded data");const g=M.length/2,_=(0,c.numberToHexUnpadded)(g);if(_.length/2&128)throw new v("tlv.encode: long form length too big");const V=g>127?(0,c.numberToHexUnpadded)(_.length/2|128):"";return(0,c.numberToHexUnpadded)(y)+V+_+M},decode(y,M){const{Err:v}=t.DER;let g=0;if(y<0||y>256)throw new v("tlv.encode: wrong tag");if(M.length<2||M[g++]!==y)throw new v("tlv.decode: wrong tlv");const _=M[g++],V=!!(_&128);let o=0;if(!V)o=_;else{const u=_&127;if(!u)throw new v("tlv.decode(long): indefinite length not supported");if(u>4)throw new v("tlv.decode(long): byte length is too big");const m=M.subarray(g,g+u);if(m.length!==u)throw new v("tlv.decode: length bytes not complete");if(m[0]===0)throw new v("tlv.decode(long): zero leftmost byte");for(const E of m)o=o<<8|E;if(g+=u,o<128)throw new v("tlv.decode(long): not minimal encoding")}const s=M.subarray(g,g+o);if(s.length!==o)throw new v("tlv.decode: wrong value length");return{v:s,l:M.subarray(g+o)}}},_int:{encode(y){const{Err:M}=t.DER;if(y<b)throw new M("integer: negative integers are not allowed");let v=(0,c.numberToHexUnpadded)(y);if(Number.parseInt(v[0],16)&8&&(v="00"+v),v.length&1)throw new M("unexpected DER parsing assertion: unpadded hex");return v},decode(y){const{Err:M}=t.DER;if(y[0]&128)throw new M("invalid signature integer: negative");if(y[0]===0&&!(y[1]&128))throw new M("invalid signature integer: unnecessary leading zero");return(0,c.bytesToNumberBE)(y)}},toSig(y){const{Err:M,_int:v,_tlv:g}=t.DER,_=(0,c.ensureBytes)("signature",y),{v:V,l:o}=g.decode(48,_);if(o.length)throw new M("invalid signature: left bytes after parsing");const{v:s,l:u}=g.decode(2,V),{v:m,l:E}=g.decode(2,u);if(E.length)throw new M("invalid signature: left bytes after parsing");return{r:v.decode(s),s:v.decode(m)}},hexFromSig(y){const{_tlv:M,_int:v}=t.DER,g=M.encode(2,v.encode(y.r)),_=M.encode(2,v.encode(y.s)),V=g+_;return M.encode(48,V)}};const b=BigInt(0),k=BigInt(1),B=BigInt(2),p=BigInt(3),S=BigInt(4);function L(y,M){const{BYTES:v}=y;let g;if(typeof M=="bigint")g=M;else{let _=(0,c.ensureBytes)("private key",M);try{g=y.fromBytes(_)}catch{throw new Error(`invalid private key: expected ui8a of size ${v}, got ${typeof M}`)}}if(!y.isValidNot0(g))throw new Error("invalid private key: out of range [1..N-1]");return g}function U(y,M={}){const v=(0,l._createCurveFields)("weierstrass",y,M),{Fp:g,Fn:_}=v;let V=v.CURVE;const{h:o,n:s}=V;(0,c._validateObject)(M,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:u}=M;if(u&&(!g.is0(V.a)||typeof u.beta!="bigint"||!Array.isArray(u.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const m=D(g,_);function E(){if(!g.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function T(ht,at,st){const{x:ct,y:f}=at.toAffine(),n=g.toBytes(ct);if((0,c._abool2)(st,"isCompressed"),st){E();const i=!g.isOdd(f);return(0,c.concatBytes)(K(i),n)}else return(0,c.concatBytes)(Uint8Array.of(4),n,g.toBytes(f))}function G(ht){(0,c._abytes2)(ht,void 0,"Point");const{publicKey:at,publicKeyUncompressed:st}=m,ct=ht.length,f=ht[0],n=ht.subarray(1);if(ct===at&&(f===2||f===3)){const i=g.fromBytes(n);if(!g.isValid(i))throw new Error("bad point: is not on curve, wrong x");const w=R(i);let N;try{N=g.sqrt(w)}catch(mt){const pt=mt instanceof Error?": "+mt.message:"";throw new Error("bad point: is not on curve, sqrt error"+pt)}E();const Q=g.isOdd(N);return(f&1)===1!==Q&&(N=g.neg(N)),{x:i,y:N}}else if(ct===st&&f===4){const i=g.BYTES,w=g.fromBytes(n.subarray(0,i)),N=g.fromBytes(n.subarray(i,i*2));if(!F(w,N))throw new Error("bad point: is not on curve");return{x:w,y:N}}else throw new Error(`bad point: got length ${ct}, expected compressed=${at} or uncompressed=${st}`)}const x=M.toBytes||T,A=M.fromBytes||G;function R(ht){const at=g.sqr(ht),st=g.mul(at,ht);return g.add(g.add(st,g.mul(ht,V.a)),V.b)}function F(ht,at){const st=g.sqr(at),ct=R(ht);return g.eql(st,ct)}if(!F(V.Gx,V.Gy))throw new Error("bad curve params: generator point");const q=g.mul(g.pow(V.a,p),S),I=g.mul(g.sqr(V.b),BigInt(27));if(g.is0(g.add(q,I)))throw new Error("bad curve params: a or b");function j(ht,at,st=!1){if(!g.isValid(at)||st&&g.is0(at))throw new Error(`bad point coordinate ${ht}`);return at}function it(ht){if(!(ht instanceof lt))throw new Error("ProjectivePoint expected")}function ot(ht){if(!u||!u.basises)throw new Error("no endo");return d(ht,u.basises,_.ORDER)}const ut=(0,c.memoized)((ht,at)=>{const{X:st,Y:ct,Z:f}=ht;if(g.eql(f,g.ONE))return{x:st,y:ct};const n=ht.is0();at==null&&(at=n?g.ONE:g.inv(f));const i=g.mul(st,at),w=g.mul(ct,at),N=g.mul(f,at);if(n)return{x:g.ZERO,y:g.ZERO};if(!g.eql(N,g.ONE))throw new Error("invZ was invalid");return{x:i,y:w}}),ft=(0,c.memoized)(ht=>{if(ht.is0()){if(M.allowInfinityPoint&&!g.is0(ht.Y))return;throw new Error("bad point: ZERO")}const{x:at,y:st}=ht.toAffine();if(!g.isValid(at)||!g.isValid(st))throw new Error("bad point: x or y not field elements");if(!F(at,st))throw new Error("bad point: equation left != right");if(!ht.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function dt(ht,at,st,ct,f){return st=new lt(g.mul(st.X,ht),st.Y,st.Z),at=(0,l.negateCt)(ct,at),st=(0,l.negateCt)(f,st),at.add(st)}class lt{constructor(at,st,ct){this.X=j("x",at),this.Y=j("y",st,!0),this.Z=j("z",ct),Object.freeze(this)}static CURVE(){return V}static fromAffine(at){const{x:st,y:ct}=at||{};if(!at||!g.isValid(st)||!g.isValid(ct))throw new Error("invalid affine point");if(at instanceof lt)throw new Error("projective point not allowed");return g.is0(st)&&g.is0(ct)?lt.ZERO:new lt(st,ct,g.ONE)}static fromBytes(at){const st=lt.fromAffine(A((0,c._abytes2)(at,void 0,"point")));return st.assertValidity(),st}static fromHex(at){return lt.fromBytes((0,c.ensureBytes)("pointHex",at))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(at=8,st=!0){return yt.createCache(this,at),st||this.multiply(p),this}assertValidity(){ft(this)}hasEvenY(){const{y:at}=this.toAffine();if(!g.isOdd)throw new Error("Field doesn't support isOdd");return!g.isOdd(at)}equals(at){it(at);const{X:st,Y:ct,Z:f}=this,{X:n,Y:i,Z:w}=at,N=g.eql(g.mul(st,w),g.mul(n,f)),Q=g.eql(g.mul(ct,w),g.mul(i,f));return N&&Q}negate(){return new lt(this.X,g.neg(this.Y),this.Z)}double(){const{a:at,b:st}=V,ct=g.mul(st,p),{X:f,Y:n,Z:i}=this;let w=g.ZERO,N=g.ZERO,Q=g.ZERO,rt=g.mul(f,f),mt=g.mul(n,n),pt=g.mul(i,i),gt=g.mul(f,n);return gt=g.add(gt,gt),Q=g.mul(f,i),Q=g.add(Q,Q),w=g.mul(at,Q),N=g.mul(ct,pt),N=g.add(w,N),w=g.sub(mt,N),N=g.add(mt,N),N=g.mul(w,N),w=g.mul(gt,w),Q=g.mul(ct,Q),pt=g.mul(at,pt),gt=g.sub(rt,pt),gt=g.mul(at,gt),gt=g.add(gt,Q),Q=g.add(rt,rt),rt=g.add(Q,rt),rt=g.add(rt,pt),rt=g.mul(rt,gt),N=g.add(N,rt),pt=g.mul(n,i),pt=g.add(pt,pt),rt=g.mul(pt,gt),w=g.sub(w,rt),Q=g.mul(pt,mt),Q=g.add(Q,Q),Q=g.add(Q,Q),new lt(w,N,Q)}add(at){it(at);const{X:st,Y:ct,Z:f}=this,{X:n,Y:i,Z:w}=at;let N=g.ZERO,Q=g.ZERO,rt=g.ZERO;const mt=V.a,pt=g.mul(V.b,p);let gt=g.mul(st,n),vt=g.mul(ct,i),bt=g.mul(f,w),Ht=g.add(st,ct),It=g.add(n,i);Ht=g.mul(Ht,It),It=g.add(gt,vt),Ht=g.sub(Ht,It),It=g.add(st,f);let Tt=g.add(n,w);return It=g.mul(It,Tt),Tt=g.add(gt,bt),It=g.sub(It,Tt),Tt=g.add(ct,f),N=g.add(i,w),Tt=g.mul(Tt,N),N=g.add(vt,bt),Tt=g.sub(Tt,N),rt=g.mul(mt,It),N=g.mul(pt,bt),rt=g.add(N,rt),N=g.sub(vt,rt),rt=g.add(vt,rt),Q=g.mul(N,rt),vt=g.add(gt,gt),vt=g.add(vt,gt),bt=g.mul(mt,bt),It=g.mul(pt,It),vt=g.add(vt,bt),bt=g.sub(gt,bt),bt=g.mul(mt,bt),It=g.add(It,bt),gt=g.mul(vt,It),Q=g.add(Q,gt),gt=g.mul(Tt,It),N=g.mul(Ht,N),N=g.sub(N,gt),gt=g.mul(Ht,vt),rt=g.mul(Tt,rt),rt=g.add(rt,gt),new lt(N,Q,rt)}subtract(at){return this.add(at.negate())}is0(){return this.equals(lt.ZERO)}multiply(at){const{endo:st}=M;if(!_.isValidNot0(at))throw new Error("invalid scalar: out of range");let ct,f;const n=i=>yt.cached(this,i,w=>(0,l.normalizeZ)(lt,w));if(st){const{k1neg:i,k1:w,k2neg:N,k2:Q}=ot(at),{p:rt,f:mt}=n(w),{p:pt,f:gt}=n(Q);f=mt.add(gt),ct=dt(st.beta,rt,pt,i,N)}else{const{p:i,f:w}=n(at);ct=i,f=w}return(0,l.normalizeZ)(lt,[ct,f])[0]}multiplyUnsafe(at){const{endo:st}=M,ct=this;if(!_.isValid(at))throw new Error("invalid scalar: out of range");if(at===b||ct.is0())return lt.ZERO;if(at===k)return ct;if(yt.hasCache(this))return this.multiply(at);if(st){const{k1neg:f,k1:n,k2neg:i,k2:w}=ot(at),{p1:N,p2:Q}=(0,l.mulEndoUnsafe)(lt,ct,n,w);return dt(st.beta,N,Q,f,i)}else return yt.unsafe(ct,at)}multiplyAndAddUnsafe(at,st,ct){const f=this.multiplyUnsafe(st).add(at.multiplyUnsafe(ct));return f.is0()?void 0:f}toAffine(at){return ut(this,at)}isTorsionFree(){const{isTorsionFree:at}=M;return o===k?!0:at?at(lt,this):yt.unsafe(this,s).is0()}clearCofactor(){const{clearCofactor:at}=M;return o===k?this:at?at(lt,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(at=!0){return(0,c._abool2)(at,"isCompressed"),this.assertValidity(),x(lt,this,at)}toHex(at=!0){return(0,c.bytesToHex)(this.toBytes(at))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(at=!0){return this.toBytes(at)}_setWindowSize(at){this.precompute(at)}static normalizeZ(at){return(0,l.normalizeZ)(lt,at)}static msm(at,st){return(0,l.pippenger)(lt,_,at,st)}static fromPrivateKey(at){return lt.BASE.multiply(L(_,at))}}lt.BASE=new lt(V.Gx,V.Gy,g.ONE),lt.ZERO=new lt(g.ZERO,g.ONE,g.ZERO),lt.Fp=g,lt.Fn=_;const wt=_.BITS,yt=new l.wNAF(lt,M.endo?Math.ceil(wt/2):wt);return lt.BASE.precompute(8),lt}function K(y){return Uint8Array.of(y?2:3)}function W(y,M){const v=y.ORDER;let g=b;for(let A=v-k;A%B===b;A/=B)g+=k;const _=g,V=B<<_-k-k,o=V*B,s=(v-k)/o,u=(s-k)/B,m=o-k,E=V,T=y.pow(M,s),G=y.pow(M,(s+k)/B);let x=(A,R)=>{let F=T,q=y.pow(R,m),I=y.sqr(q);I=y.mul(I,R);let j=y.mul(A,I);j=y.pow(j,u),j=y.mul(j,q),q=y.mul(j,R),I=y.mul(j,A);let it=y.mul(I,q);j=y.pow(it,E);let ot=y.eql(j,y.ONE);q=y.mul(I,G),j=y.mul(it,F),I=y.cmov(q,I,ot),it=y.cmov(j,it,ot);for(let ut=_;ut>k;ut--){let ft=ut-B;ft=B<<ft-k;let dt=y.pow(it,ft);const lt=y.eql(dt,y.ONE);q=y.mul(I,F),F=y.mul(F,F),dt=y.mul(it,F),I=y.cmov(q,I,lt),it=y.cmov(dt,it,lt)}return{isValid:ot,value:I}};if(y.ORDER%S===p){const A=(y.ORDER-p)/S,R=y.sqrt(y.neg(M));x=(F,q)=>{let I=y.sqr(q);const j=y.mul(F,q);I=y.mul(I,j);let it=y.pow(I,A);it=y.mul(it,j);const ot=y.mul(it,R),ut=y.mul(y.sqr(it),q),ft=y.eql(ut,F);let dt=y.cmov(ot,it,ft);return{isValid:ft,value:dt}}}return x}function et(y,M){(0,a.validateField)(y);const{A:v,B:g,Z:_}=M;if(!y.isValid(v)||!y.isValid(g)||!y.isValid(_))throw new Error("mapToCurveSimpleSWU: invalid opts");const V=W(y,_);if(!y.isOdd)throw new Error("Field does not have .isOdd()");return o=>{let s,u,m,E,T,G,x,A;s=y.sqr(o),s=y.mul(s,_),u=y.sqr(s),u=y.add(u,s),m=y.add(u,y.ONE),m=y.mul(m,g),E=y.cmov(_,y.neg(u),!y.eql(u,y.ZERO)),E=y.mul(E,v),u=y.sqr(m),G=y.sqr(E),T=y.mul(G,v),u=y.add(u,T),u=y.mul(u,m),G=y.mul(G,E),T=y.mul(G,g),u=y.add(u,T),x=y.mul(s,m);const{isValid:R,value:F}=V(u,G);A=y.mul(s,o),A=y.mul(A,F),x=y.cmov(x,m,R),A=y.cmov(A,F,R);const q=y.isOdd(o)===y.isOdd(A);A=y.cmov(y.neg(A),A,q);const I=(0,a.FpInvertBatch)(y,[E],!0)[0];return x=y.mul(x,I),{x,y:A}}}function D(y,M){return{secretKey:M.BYTES,publicKey:1+y.BYTES,publicKeyUncompressed:1+2*y.BYTES,publicKeyHasPrefix:!0,signature:2*M.BYTES}}function P(y,M={}){const{Fn:v}=y,g=M.randomBytes||c.randomBytes,_=Object.assign(D(y.Fp,v),{seed:(0,a.getMinHashLength)(v.ORDER)});function V(x){try{return!!L(v,x)}catch{return!1}}function o(x,A){const{publicKey:R,publicKeyUncompressed:F}=_;try{const q=x.length;return A===!0&&q!==R||A===!1&&q!==F?!1:!!y.fromBytes(x)}catch{return!1}}function s(x=g(_.seed)){return(0,a.mapHashToField)((0,c._abytes2)(x,_.seed,"seed"),v.ORDER)}function u(x,A=!0){return y.BASE.multiply(L(v,x)).toBytes(A)}function m(x){const A=s(x);return{secretKey:A,publicKey:u(A)}}function E(x){if(typeof x=="bigint")return!1;if(x instanceof y)return!0;const{secretKey:A,publicKey:R,publicKeyUncompressed:F}=_;if(v.allowedLengths||A===R)return;const q=(0,c.ensureBytes)("key",x).length;return q===R||q===F}function T(x,A,R=!0){if(E(x)===!0)throw new Error("first arg must be private key");if(E(A)===!1)throw new Error("second arg must be public key");const F=L(v,x);return y.fromHex(A).multiply(F).toBytes(R)}return Object.freeze({getPublicKey:u,getSharedSecret:T,keygen:m,Point:y,utils:{isValidSecretKey:V,isValidPublicKey:o,randomSecretKey:s,isValidPrivateKey:V,randomPrivateKey:s,normPrivateKeyToScalar:x=>L(v,x),precompute(x=8,A=y.BASE){return A.precompute(x,!1)}},lengths:_})}function Y(y,M,v={}){(0,r.ahash)(M),(0,c._validateObject)(v,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const g=v.randomBytes||c.randomBytes,_=v.hmac||((st,...ct)=>(0,e.hmac)(M,st,(0,c.concatBytes)(...ct))),{Fp:V,Fn:o}=y,{ORDER:s,BITS:u}=o,{keygen:m,getPublicKey:E,getSharedSecret:T,utils:G,lengths:x}=P(y,v),A={prehash:!1,lowS:typeof v.lowS=="boolean"?v.lowS:!1,format:void 0,extraEntropy:!1},R="compact";function F(st){const ct=s>>k;return st>ct}function q(st,ct){if(!o.isValidNot0(ct))throw new Error(`invalid signature ${st}: out of range 1..Point.Fn.ORDER`);return ct}function I(st,ct){O(ct);const f=x.signature,n=ct==="compact"?f:ct==="recovered"?f+1:void 0;return(0,c._abytes2)(st,n,`${ct} signature`)}class j{constructor(ct,f,n){this.r=q("r",ct),this.s=q("s",f),n!=null&&(this.recovery=n),Object.freeze(this)}static fromBytes(ct,f=R){I(ct,f);let n;if(f==="der"){const{r:Q,s:rt}=t.DER.toSig((0,c._abytes2)(ct));return new j(Q,rt)}f==="recovered"&&(n=ct[0],f="compact",ct=ct.subarray(1));const i=o.BYTES,w=ct.subarray(0,i),N=ct.subarray(i,i*2);return new j(o.fromBytes(w),o.fromBytes(N),n)}static fromHex(ct,f){return this.fromBytes((0,c.hexToBytes)(ct),f)}addRecoveryBit(ct){return new j(this.r,this.s,ct)}recoverPublicKey(ct){const f=V.ORDER,{r:n,s:i,recovery:w}=this;if(w==null||![0,1,2,3].includes(w))throw new Error("recovery id invalid");if(s*B<f&&w>1)throw new Error("recovery id is ambiguous for h>1 curve");const Q=w===2||w===3?n+s:n;if(!V.isValid(Q))throw new Error("recovery id 2 or 3 invalid");const rt=V.toBytes(Q),mt=y.fromBytes((0,c.concatBytes)(K((w&1)===0),rt)),pt=o.inv(Q),gt=ot((0,c.ensureBytes)("msgHash",ct)),vt=o.create(-gt*pt),bt=o.create(i*pt),Ht=y.BASE.multiplyUnsafe(vt).add(mt.multiplyUnsafe(bt));if(Ht.is0())throw new Error("point at infinify");return Ht.assertValidity(),Ht}hasHighS(){return F(this.s)}toBytes(ct=R){if(O(ct),ct==="der")return(0,c.hexToBytes)(t.DER.hexFromSig(this));const f=o.toBytes(this.r),n=o.toBytes(this.s);if(ct==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return(0,c.concatBytes)(Uint8Array.of(this.recovery),f,n)}return(0,c.concatBytes)(f,n)}toHex(ct){return(0,c.bytesToHex)(this.toBytes(ct))}assertValidity(){}static fromCompact(ct){return j.fromBytes((0,c.ensureBytes)("sig",ct),"compact")}static fromDER(ct){return j.fromBytes((0,c.ensureBytes)("sig",ct),"der")}normalizeS(){return this.hasHighS()?new j(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,c.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,c.bytesToHex)(this.toBytes("compact"))}}const it=v.bits2int||function(ct){if(ct.length>8192)throw new Error("input is too large");const f=(0,c.bytesToNumberBE)(ct),n=ct.length*8-u;return n>0?f>>BigInt(n):f},ot=v.bits2int_modN||function(ct){return o.create(it(ct))},ut=(0,c.bitMask)(u);function ft(st){return(0,c.aInRange)("num < 2^"+u,st,b,ut),o.toBytes(st)}function dt(st,ct){return(0,c._abytes2)(st,void 0,"message"),ct?(0,c._abytes2)(M(st),void 0,"prehashed message"):st}function lt(st,ct,f){if(["recovered","canonical"].some(vt=>vt in f))throw new Error("sign() legacy options not supported");const{lowS:n,prehash:i,extraEntropy:w}=C(f,A);st=dt(st,i);const N=ot(st),Q=L(o,ct),rt=[ft(Q),ft(N)];if(w!=null&&w!==!1){const vt=w===!0?g(x.secretKey):w;rt.push((0,c.ensureBytes)("extraEntropy",vt))}const mt=(0,c.concatBytes)(...rt),pt=N;function gt(vt){const bt=it(vt);if(!o.isValidNot0(bt))return;const Ht=o.inv(bt),It=y.BASE.multiply(bt).toAffine(),Tt=o.create(It.x);if(Tt===b)return;const me=o.create(Ht*o.create(pt+Tt*Q));if(me===b)return;let hn=(It.x===Tt?0:2)|Number(It.y&k),yn=me;return n&&F(me)&&(yn=o.neg(me),hn^=1),new j(Tt,yn,hn)}return{seed:mt,k2sig:gt}}function wt(st,ct,f={}){st=(0,c.ensureBytes)("message",st);const{seed:n,k2sig:i}=lt(st,ct,f);return(0,c.createHmacDrbg)(M.outputLen,o.BYTES,_)(n,i)}function yt(st){let ct;const f=typeof st=="string"||(0,c.isBytes)(st),n=!f&&st!==null&&typeof st=="object"&&typeof st.r=="bigint"&&typeof st.s=="bigint";if(!f&&!n)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)ct=new j(st.r,st.s);else if(f){try{ct=j.fromBytes((0,c.ensureBytes)("sig",st),"der")}catch(i){if(!(i instanceof t.DER.Err))throw i}if(!ct)try{ct=j.fromBytes((0,c.ensureBytes)("sig",st),"compact")}catch{return!1}}return ct||!1}function ht(st,ct,f,n={}){const{lowS:i,prehash:w,format:N}=C(n,A);if(f=(0,c.ensureBytes)("publicKey",f),ct=dt((0,c.ensureBytes)("message",ct),w),"strict"in n)throw new Error("options.strict was renamed to lowS");const Q=N===void 0?yt(st):j.fromBytes((0,c.ensureBytes)("sig",st),N);if(Q===!1)return!1;try{const rt=y.fromBytes(f);if(i&&Q.hasHighS())return!1;const{r:mt,s:pt}=Q,gt=ot(ct),vt=o.inv(pt),bt=o.create(gt*vt),Ht=o.create(mt*vt),It=y.BASE.multiplyUnsafe(bt).add(rt.multiplyUnsafe(Ht));return It.is0()?!1:o.create(It.x)===mt}catch{return!1}}function at(st,ct,f={}){const{prehash:n}=C(f,A);return ct=dt(ct,n),j.fromBytes(st,"recovered").recoverPublicKey(ct).toBytes()}return Object.freeze({keygen:m,getPublicKey:E,getSharedSecret:T,utils:G,lengths:x,Point:y,sign:wt,verify:ht,recoverPublicKey:at,Signature:j,hash:M})}function J(y){const{CURVE:M,curveOpts:v}=Z(y),g=U(M,v);return nt(y,g)}function Z(y){const M={a:y.a,b:y.b,p:y.Fp.ORDER,n:y.n,h:y.h,Gx:y.Gx,Gy:y.Gy},v=y.Fp;let g=y.allowedPrivateKeyLengths?Array.from(new Set(y.allowedPrivateKeyLengths.map(o=>Math.ceil(o/2)))):void 0;const _=(0,a.Field)(M.n,{BITS:y.nBitLength,allowedLengths:g,modFromBytes:y.wrapPrivateKey}),V={Fp:v,Fn:_,allowInfinityPoint:y.allowInfinityPoint,endo:y.endo,isTorsionFree:y.isTorsionFree,clearCofactor:y.clearCofactor,fromBytes:y.fromBytes,toBytes:y.toBytes};return{CURVE:M,curveOpts:V}}function $(y){const{CURVE:M,curveOpts:v}=Z(y),g={hmac:y.hmac,randomBytes:y.randomBytes,lowS:y.lowS,bits2int:y.bits2int,bits2int_modN:y.bits2int_modN};return{CURVE:M,curveOpts:v,hash:y.hash,ecdsaOpts:g}}function tt(y,M,v){function g(_){const V=y.sqr(_),o=y.mul(V,_);return y.add(y.add(o,y.mul(_,M)),v)}return g}function nt(y,M){const{Fp:v,Fn:g}=M;function _(o){return(0,c.inRange)(o,k,g.ORDER)}const V=tt(v,y.a,y.b);return Object.assign({},{CURVE:y,Point:M,ProjectivePoint:M,normPrivateKeyToScalar:o=>L(g,o),weierstrassEquation:V,isWithinCurveOrder:_})}function X(y,M){const v=M.Point;return Object.assign({},M,{ProjectivePoint:v,CURVE:Object.assign({},y,(0,a.nLength)(v.Fn.ORDER,v.Fn.BITS))})}function z(y){const{CURVE:M,curveOpts:v,hash:g,ecdsaOpts:_}=$(y),V=U(M,v),o=Y(V,g,_);return X(y,o)}})(Ke)),Ke}var $n;function Ls(){if($n)return ae;$n=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getHash=e,ae.createCurve=r;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Zr();function e(c){return{hash:c}}function r(c,l){const a=h=>(0,t.weierstrass)({...c,hash:h});return{...a(l),create:a}}return ae}var Jn;function Cs(){return Jn||(Jn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.secp256k1_hasher=t.schnorr=t.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=cn(),r=Gt(),c=Ls(),l=jr(),a=Qt(),h=Zr(),d=Yt(),O={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},C={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},H=BigInt(0),b=BigInt(1),k=BigInt(2);function B(X){const z=O.p,y=BigInt(3),M=BigInt(6),v=BigInt(11),g=BigInt(22),_=BigInt(23),V=BigInt(44),o=BigInt(88),s=X*X*X%z,u=s*s*X%z,m=(0,a.pow2)(u,y,z)*u%z,E=(0,a.pow2)(m,y,z)*u%z,T=(0,a.pow2)(E,k,z)*s%z,G=(0,a.pow2)(T,v,z)*T%z,x=(0,a.pow2)(G,g,z)*G%z,A=(0,a.pow2)(x,V,z)*x%z,R=(0,a.pow2)(A,o,z)*A%z,F=(0,a.pow2)(R,V,z)*x%z,q=(0,a.pow2)(F,y,z)*u%z,I=(0,a.pow2)(q,_,z)*G%z,j=(0,a.pow2)(I,M,z)*s%z,it=(0,a.pow2)(j,k,z);if(!p.eql(p.sqr(it),X))throw new Error("Cannot find square root");return it}const p=(0,a.Field)(O.p,{sqrt:B});t.secp256k1=(0,c.createCurve)({...O,Fp:p,lowS:!0,endo:C},e.sha256);const S={};function L(X,...z){let y=S[X];if(y===void 0){const M=(0,e.sha256)((0,d.utf8ToBytes)(X));y=(0,d.concatBytes)(M,M),S[X]=y}return(0,e.sha256)((0,d.concatBytes)(y,...z))}const U=X=>X.toBytes(!0).slice(1),K=t.secp256k1.Point,W=X=>X%k===H;function et(X){const{Fn:z,BASE:y}=K,M=(0,h._normFnElement)(z,X),v=y.multiply(M);return{scalar:W(v.y)?M:z.neg(M),bytes:U(v)}}function D(X){const z=p;if(!z.isValidNot0(X))throw new Error("invalid x: Fail if x ≥ p");const y=z.create(X*X),M=z.create(y*X+BigInt(7));let v=z.sqrt(M);W(v)||(v=z.neg(v));const g=K.fromAffine({x:X,y:v});return g.assertValidity(),g}const P=d.bytesToNumberBE;function Y(...X){return K.Fn.create(P(L("BIP0340/challenge",...X)))}function J(X){return et(X).bytes}function Z(X,z,y=(0,r.randomBytes)(32)){const{Fn:M}=K,v=(0,d.ensureBytes)("message",X),{bytes:g,scalar:_}=et(z),V=(0,d.ensureBytes)("auxRand",y,32),o=M.toBytes(_^P(L("BIP0340/aux",V))),s=L("BIP0340/nonce",o,g,v),{bytes:u,scalar:m}=et(s),E=Y(u,g,v),T=new Uint8Array(64);if(T.set(u,0),T.set(M.toBytes(M.create(m+E*_)),32),!$(T,v,g))throw new Error("sign: Invalid signature produced");return T}function $(X,z,y){const{Fn:M,BASE:v}=K,g=(0,d.ensureBytes)("signature",X,64),_=(0,d.ensureBytes)("message",z),V=(0,d.ensureBytes)("publicKey",y,32);try{const o=D(P(V)),s=P(g.subarray(0,32));if(!(0,d.inRange)(s,b,O.p))return!1;const u=P(g.subarray(32,64));if(!(0,d.inRange)(u,b,O.n))return!1;const m=Y(M.toBytes(s),U(o),_),E=v.multiplyUnsafe(u).add(o.multiplyUnsafe(M.neg(m))),{x:T,y:G}=E.toAffine();return!(E.is0()||!W(G)||T!==s)}catch{return!1}}t.schnorr=(()=>{const y=(v=(0,r.randomBytes)(48))=>(0,a.mapHashToField)(v,O.n);t.secp256k1.utils.randomSecretKey;function M(v){const g=y(v);return{secretKey:g,publicKey:J(g)}}return{keygen:M,getPublicKey:J,sign:Z,verify:$,Point:K,utils:{randomSecretKey:y,randomPrivateKey:y,taggedHash:L,lift_x:D,pointToBytes:U,numberToBytesBE:d.numberToBytesBE,bytesToNumberBE:d.bytesToNumberBE,mod:a.mod},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();const tt=(0,l.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(X=>X.map(z=>BigInt(z)))),nt=(0,h.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))});t.secp256k1_hasher=(0,l.createHasher)(t.secp256k1.Point,X=>{const{x:z,y}=nt(p.create(X[0]));return tt(z,y)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:e.sha256}),t.hashToCurve=t.secp256k1_hasher.hashToCurve,t.encodeToCurve=t.secp256k1_hasher.encodeToCurve})(De)),De}var Ge={},Qn;function qr(){return Qn||(Qn=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeHex=t.remove0x=void 0;var e=kt(),r=function(l){return l.startsWith("0x")||l.startsWith("0X")?l.slice(2):l};t.remove0x=r;var c=function(l){return(0,e.hexToBytes)((0,t.remove0x)(l))};t.decodeHex=c})(Ge)),Ge}var tr;function Rs(){return tr||(tr=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hexToPublicKey=t.convertPublicKeyFormat=t.getSharedPoint=t.getPublicKey=t.isValidPrivateKey=t.getValidSecret=void 0;var e=Kr(),r=Ts(),c=Cs(),l=Ie(),a=sn(),h=qr(),d=function(L){var U;do U=(0,e.randomBytes)(a.SECRET_KEY_LENGTH);while(!(0,t.isValidPrivateKey)(U,L));return U};t.getValidSecret=d;var O=function(L,U){return B(U||(0,l.ellipticCurve)(),function(K){return K.utils.isValidPrivateKey(L)},function(){return!0},function(){return!0})};t.isValidPrivateKey=O;var C=function(L,U){return B(U||(0,l.ellipticCurve)(),function(K){return K.getPublicKey(L)},function(K){return K.getPublicKey(L)},function(K){return K.getPublicKey(L)})};t.getPublicKey=C;var H=function(L,U,K,W){return B(W||(0,l.ellipticCurve)(),function(et){return et.getSharedSecret(L,U,K)},function(et){return et.getSharedSecret(L,U)},function(et){return S(et,L,U)})};t.getSharedPoint=H;var b=function(L,U,K){return B(K||(0,l.ellipticCurve)(),function(W){return W.getSharedSecret(BigInt(1),L,U)},function(){return L},function(){return L})};t.convertPublicKeyFormat=b;var k=function(L,U){var K=(0,h.decodeHex)(L);return B(U||(0,l.ellipticCurve)(),function(){return p(K)},function(){return K},function(){return K})};t.hexToPublicKey=k;function B(L,U,K,W){if(L==="secp256k1")return U(c.secp256k1);if(L==="x25519")return K(r.x25519);if(L==="ed25519")return W(r.ed25519);throw new Error("Not implemented")}var p=function(L){if(L.length===a.ETH_PUBLIC_KEY_SIZE){var U=new Uint8Array(1+L.length);return U.set([4]),U.set(L,1),U}return L},S=function(L,U,K){var W=L.utils.getExtendedPublicKey(U).scalar,et=L.ExtendedPoint.fromHex(K).multiply(W);return et.toRawBytes()}})(Pe)),Pe}var Ze={},Xt={},er;function Hs(){if(er)return Xt;er=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.hkdf=void 0,Xt.extract=r,Xt.expand=a;const t=Gr(),e=Gt();function r(d,O,C){return(0,e.ahash)(d),C===void 0&&(C=new Uint8Array(d.outputLen)),(0,t.hmac)(d,(0,e.toBytes)(C),(0,e.toBytes)(O))}const c=Uint8Array.from([0]),l=Uint8Array.of();function a(d,O,C,H=32){(0,e.ahash)(d),(0,e.anumber)(H);const b=d.outputLen;if(H>255*b)throw new Error("Length should be <= 255*HashLen");const k=Math.ceil(H/b);C===void 0&&(C=l);const B=new Uint8Array(k*b),p=t.hmac.create(d,O),S=p._cloneInto(),L=new Uint8Array(p.outputLen);for(let U=0;U<k;U++)c[0]=U+1,S.update(U===0?l:L).update(C).update(c).digestInto(L),B.set(L,b*U),p._cloneInto(S);return p.destroy(),S.destroy(),(0,e.clean)(L,c),B.slice(0,H)}const h=(d,O,C,H,b)=>a(d,r(d,O,C),H,b);return Xt.hkdf=h,Xt}var nr;function Os(){return nr||(nr=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getSharedKey=t.deriveKey=void 0;var e=kt(),r=Hs(),c=cn(),l=function(h,d,O){return(0,r.hkdf)(c.sha256,h,d,O,32)};t.deriveKey=l;var a=function(){for(var h=[],d=0;d<arguments.length;d++)h[d]=arguments[d];return(0,t.deriveKey)(e.concatBytes.apply(void 0,h))};t.getSharedKey=a})(Ze)),Ze}var qe={},$t={},We={},Wt={},rr;function Us(){if(rr)return Wt;rr=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.polyval=Wt.ghash=void 0,Wt._toGHASHKey=d;const t=kt(),e=16,r=new Uint8Array(16),c=(0,t.u32)(r),l=225,a=(k,B,p,S)=>{const L=S&1;return{s3:p<<31|S>>>1,s2:B<<31|p>>>1,s1:k<<31|B>>>1,s0:k>>>1^l<<24&-(L&1)}},h=k=>(k>>>0&255)<<24|(k>>>8&255)<<16|(k>>>16&255)<<8|k>>>24&255|0;function d(k){k.reverse();const B=k[15]&1;let p=0;for(let S=0;S<k.length;S++){const L=k[S];k[S]=L>>>1|p,p=(L&1)<<7}return k[0]^=-B&225,k}const O=k=>k>64*1024?8:k>1024?4:2;class C{constructor(B,p){this.blockLen=e,this.outputLen=e,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,B=(0,t.toBytes)(B),(0,t.abytes)(B,16);const S=(0,t.createView)(B);let L=S.getUint32(0,!1),U=S.getUint32(4,!1),K=S.getUint32(8,!1),W=S.getUint32(12,!1);const et=[];for(let $=0;$<128;$++)et.push({s0:h(L),s1:h(U),s2:h(K),s3:h(W)}),{s0:L,s1:U,s2:K,s3:W}=a(L,U,K,W);const D=O(p||1024);if(![1,2,4,8].includes(D))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=D;const Y=128/D,J=this.windowSize=2**D,Z=[];for(let $=0;$<Y;$++)for(let tt=0;tt<J;tt++){let nt=0,X=0,z=0,y=0;for(let M=0;M<D;M++){if(!(tt>>>D-M-1&1))continue;const{s0:g,s1:_,s2:V,s3:o}=et[D*$+M];nt^=g,X^=_,z^=V,y^=o}Z.push({s0:nt,s1:X,s2:z,s3:y})}this.t=Z}_updateBlock(B,p,S,L){B^=this.s0,p^=this.s1,S^=this.s2,L^=this.s3;const{W:U,t:K,windowSize:W}=this;let et=0,D=0,P=0,Y=0;const J=(1<<U)-1;let Z=0;for(const $ of[B,p,S,L])for(let tt=0;tt<4;tt++){const nt=$>>>8*tt&255;for(let X=8/U-1;X>=0;X--){const z=nt>>>U*X&J,{s0:y,s1:M,s2:v,s3:g}=K[Z*W+z];et^=y,D^=M,P^=v,Y^=g,Z+=1}}this.s0=et,this.s1=D,this.s2=P,this.s3=Y}update(B){(0,t.aexists)(this),B=(0,t.toBytes)(B),(0,t.abytes)(B);const p=(0,t.u32)(B),S=Math.floor(B.length/e),L=B.length%e;for(let U=0;U<S;U++)this._updateBlock(p[U*4+0],p[U*4+1],p[U*4+2],p[U*4+3]);return L&&(r.set(B.subarray(S*e)),this._updateBlock(c[0],c[1],c[2],c[3]),(0,t.clean)(c)),this}destroy(){const{t:B}=this;for(const p of B)p.s0=0,p.s1=0,p.s2=0,p.s3=0}digestInto(B){(0,t.aexists)(this),(0,t.aoutput)(B,this),this.finished=!0;const{s0:p,s1:S,s2:L,s3:U}=this,K=(0,t.u32)(B);return K[0]=p,K[1]=S,K[2]=L,K[3]=U,B}digest(){const B=new Uint8Array(e);return this.digestInto(B),this.destroy(),B}}class H extends C{constructor(B,p){B=(0,t.toBytes)(B),(0,t.abytes)(B);const S=d((0,t.copyBytes)(B));super(S,p),(0,t.clean)(S)}update(B){B=(0,t.toBytes)(B),(0,t.aexists)(this);const p=(0,t.u32)(B),S=B.length%e,L=Math.floor(B.length/e);for(let U=0;U<L;U++)this._updateBlock(h(p[U*4+3]),h(p[U*4+2]),h(p[U*4+1]),h(p[U*4+0]));return S&&(r.set(B.subarray(L*e)),this._updateBlock(h(c[3]),h(c[2]),h(c[1]),h(c[0])),(0,t.clean)(c)),this}digestInto(B){(0,t.aexists)(this),(0,t.aoutput)(B,this),this.finished=!0;const{s0:p,s1:S,s2:L,s3:U}=this,K=(0,t.u32)(B);return K[0]=p,K[1]=S,K[2]=L,K[3]=U,B.reverse()}}function b(k){const B=(S,L)=>k(L,S.length).update((0,t.toBytes)(S)).digest(),p=k(new Uint8Array(16),0);return B.outputLen=p.outputLen,B.blockLen=p.blockLen,B.create=(S,L)=>k(S,L),B}return Wt.ghash=b((k,B)=>new C(k,B)),Wt.polyval=b((k,B)=>new H(k,B)),Wt}var ir;function Ps(){return ir||(ir=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.unsafe=t.aeskwp=t.aeskw=t.siv=t.gcmsiv=t.gcm=t.cfb=t.cbc=t.ecb=t.ctr=void 0;const e=Us(),r=kt(),c=16,l=4,a=new Uint8Array(c),h=283;function d(s){return s<<1^h&-(s>>7)}function O(s,u){let m=0;for(;u>0;u>>=1)m^=s&-(u&1),s=d(s);return m}const C=(()=>{const s=new Uint8Array(256);for(let m=0,E=1;m<256;m++,E^=d(E))s[m]=E;const u=new Uint8Array(256);u[0]=99;for(let m=0;m<255;m++){let E=s[255-m];E|=E<<8,u[s[m]]=(E^E>>4^E>>5^E>>6^E>>7^99)&255}return(0,r.clean)(s),u})(),H=C.map((s,u)=>C.indexOf(u)),b=s=>s<<24|s>>>8,k=s=>s<<8|s>>>24,B=s=>s<<24&4278190080|s<<8&16711680|s>>>8&65280|s>>>24&255;function p(s,u){if(s.length!==256)throw new Error("Wrong sbox length");const m=new Uint32Array(256).map((F,q)=>u(s[q])),E=m.map(k),T=E.map(k),G=T.map(k),x=new Uint32Array(256*256),A=new Uint32Array(256*256),R=new Uint16Array(256*256);for(let F=0;F<256;F++)for(let q=0;q<256;q++){const I=F*256+q;x[I]=m[F]^E[q],A[I]=T[F]^G[q],R[I]=s[F]<<8|s[q]}return{sbox:s,sbox2:R,T0:m,T1:E,T2:T,T3:G,T01:x,T23:A}}const S=p(C,s=>O(s,3)<<24|s<<16|s<<8|O(s,2)),L=p(H,s=>O(s,11)<<24|O(s,13)<<16|O(s,9)<<8|O(s,14)),U=(()=>{const s=new Uint8Array(16);for(let u=0,m=1;u<16;u++,m=d(m))s[u]=m;return s})();function K(s){(0,r.abytes)(s);const u=s.length;if(![16,24,32].includes(u))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+u);const{sbox2:m}=S,E=[];(0,r.isAligned32)(s)||E.push(s=(0,r.copyBytes)(s));const T=(0,r.u32)(s),G=T.length,x=R=>D(m,R,R,R,R),A=new Uint32Array(u+28);A.set(T);for(let R=G;R<A.length;R++){let F=A[R-1];R%G===0?F=x(b(F))^U[R/G-1]:G>6&&R%G===4&&(F=x(F)),A[R]=A[R-G]^F}return(0,r.clean)(...E),A}function W(s){const u=K(s),m=u.slice(),E=u.length,{sbox2:T}=S,{T0:G,T1:x,T2:A,T3:R}=L;for(let F=0;F<E;F+=4)for(let q=0;q<4;q++)m[F+q]=u[E-F-4+q];(0,r.clean)(u);for(let F=4;F<E-4;F++){const q=m[F],I=D(T,q,q,q,q);m[F]=G[I&255]^x[I>>>8&255]^A[I>>>16&255]^R[I>>>24]}return m}function et(s,u,m,E,T,G){return s[m<<8&65280|E>>>8&255]^u[T>>>8&65280|G>>>24&255]}function D(s,u,m,E,T){return s[u&255|m&65280]|s[E>>>16&255|T>>>16&65280]<<16}function P(s,u,m,E,T){const{sbox2:G,T01:x,T23:A}=S;let R=0;u^=s[R++],m^=s[R++],E^=s[R++],T^=s[R++];const F=s.length/4-2;for(let ot=0;ot<F;ot++){const ut=s[R++]^et(x,A,u,m,E,T),ft=s[R++]^et(x,A,m,E,T,u),dt=s[R++]^et(x,A,E,T,u,m),lt=s[R++]^et(x,A,T,u,m,E);u=ut,m=ft,E=dt,T=lt}const q=s[R++]^D(G,u,m,E,T),I=s[R++]^D(G,m,E,T,u),j=s[R++]^D(G,E,T,u,m),it=s[R++]^D(G,T,u,m,E);return{s0:q,s1:I,s2:j,s3:it}}function Y(s,u,m,E,T){const{sbox2:G,T01:x,T23:A}=L;let R=0;u^=s[R++],m^=s[R++],E^=s[R++],T^=s[R++];const F=s.length/4-2;for(let ot=0;ot<F;ot++){const ut=s[R++]^et(x,A,u,T,E,m),ft=s[R++]^et(x,A,m,u,T,E),dt=s[R++]^et(x,A,E,m,u,T),lt=s[R++]^et(x,A,T,E,m,u);u=ut,m=ft,E=dt,T=lt}const q=s[R++]^D(G,u,T,E,m),I=s[R++]^D(G,m,u,T,E),j=s[R++]^D(G,E,m,u,T),it=s[R++]^D(G,T,E,m,u);return{s0:q,s1:I,s2:j,s3:it}}function J(s,u,m,E){(0,r.abytes)(u,c),(0,r.abytes)(m);const T=m.length;E=(0,r.getOutput)(T,E),(0,r.complexOverlapBytes)(m,E);const G=u,x=(0,r.u32)(G);let{s0:A,s1:R,s2:F,s3:q}=P(s,x[0],x[1],x[2],x[3]);const I=(0,r.u32)(m),j=(0,r.u32)(E);for(let ot=0;ot+4<=I.length;ot+=4){j[ot+0]=I[ot+0]^A,j[ot+1]=I[ot+1]^R,j[ot+2]=I[ot+2]^F,j[ot+3]=I[ot+3]^q;let ut=1;for(let ft=G.length-1;ft>=0;ft--)ut=ut+(G[ft]&255)|0,G[ft]=ut&255,ut>>>=8;({s0:A,s1:R,s2:F,s3:q}=P(s,x[0],x[1],x[2],x[3]))}const it=c*Math.floor(I.length/l);if(it<T){const ot=new Uint32Array([A,R,F,q]),ut=(0,r.u8)(ot);for(let ft=it,dt=0;ft<T;ft++,dt++)E[ft]=m[ft]^ut[dt];(0,r.clean)(ot)}return E}function Z(s,u,m,E,T){(0,r.abytes)(m,c),(0,r.abytes)(E),T=(0,r.getOutput)(E.length,T);const G=m,x=(0,r.u32)(G),A=(0,r.createView)(G),R=(0,r.u32)(E),F=(0,r.u32)(T),q=u?0:12,I=E.length;let j=A.getUint32(q,u),{s0:it,s1:ot,s2:ut,s3:ft}=P(s,x[0],x[1],x[2],x[3]);for(let lt=0;lt+4<=R.length;lt+=4)F[lt+0]=R[lt+0]^it,F[lt+1]=R[lt+1]^ot,F[lt+2]=R[lt+2]^ut,F[lt+3]=R[lt+3]^ft,j=j+1>>>0,A.setUint32(q,j,u),{s0:it,s1:ot,s2:ut,s3:ft}=P(s,x[0],x[1],x[2],x[3]);const dt=c*Math.floor(R.length/l);if(dt<I){const lt=new Uint32Array([it,ot,ut,ft]),wt=(0,r.u8)(lt);for(let yt=dt,ht=0;yt<I;yt++,ht++)T[yt]=E[yt]^wt[ht];(0,r.clean)(lt)}return T}t.ctr=(0,r.wrapCipher)({blockSize:16,nonceLength:16},function(u,m){function E(T,G){if((0,r.abytes)(T),G!==void 0&&((0,r.abytes)(G),!(0,r.isAligned32)(G)))throw new Error("unaligned destination");const x=K(u),A=(0,r.copyBytes)(m),R=[x,A];(0,r.isAligned32)(T)||R.push(T=(0,r.copyBytes)(T));const F=J(x,A,T,G);return(0,r.clean)(...R),F}return{encrypt:(T,G)=>E(T,G),decrypt:(T,G)=>E(T,G)}});function $(s){if((0,r.abytes)(s),s.length%c!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+c)}function tt(s,u,m){(0,r.abytes)(s);let E=s.length;const T=E%c;if(!u&&T!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,r.isAligned32)(s)||(s=(0,r.copyBytes)(s));const G=(0,r.u32)(s);if(u){let A=c-T;A||(A=c),E=E+A}m=(0,r.getOutput)(E,m),(0,r.complexOverlapBytes)(s,m);const x=(0,r.u32)(m);return{b:G,o:x,out:m}}function nt(s,u){if(!u)return s;const m=s.length;if(!m)throw new Error("aes/pcks5: empty ciphertext not allowed");const E=s[m-1];if(E<=0||E>16)throw new Error("aes/pcks5: wrong padding");const T=s.subarray(0,-E);for(let G=0;G<E;G++)if(s[m-G-1]!==E)throw new Error("aes/pcks5: wrong padding");return T}function X(s){const u=new Uint8Array(16),m=(0,r.u32)(u);u.set(s);const E=c-s.length;for(let T=c-E;T<c;T++)u[T]=E;return m}t.ecb=(0,r.wrapCipher)({blockSize:16},function(u,m={}){const E=!m.disablePadding;return{encrypt(T,G){const{b:x,o:A,out:R}=tt(T,E,G),F=K(u);let q=0;for(;q+4<=x.length;){const{s0:I,s1:j,s2:it,s3:ot}=P(F,x[q+0],x[q+1],x[q+2],x[q+3]);A[q++]=I,A[q++]=j,A[q++]=it,A[q++]=ot}if(E){const I=X(T.subarray(q*4)),{s0:j,s1:it,s2:ot,s3:ut}=P(F,I[0],I[1],I[2],I[3]);A[q++]=j,A[q++]=it,A[q++]=ot,A[q++]=ut}return(0,r.clean)(F),R},decrypt(T,G){$(T);const x=W(u);G=(0,r.getOutput)(T.length,G);const A=[x];(0,r.isAligned32)(T)||A.push(T=(0,r.copyBytes)(T)),(0,r.complexOverlapBytes)(T,G);const R=(0,r.u32)(T),F=(0,r.u32)(G);for(let q=0;q+4<=R.length;){const{s0:I,s1:j,s2:it,s3:ot}=Y(x,R[q+0],R[q+1],R[q+2],R[q+3]);F[q++]=I,F[q++]=j,F[q++]=it,F[q++]=ot}return(0,r.clean)(...A),nt(G,E)}}}),t.cbc=(0,r.wrapCipher)({blockSize:16,nonceLength:16},function(u,m,E={}){const T=!E.disablePadding;return{encrypt(G,x){const A=K(u),{b:R,o:F,out:q}=tt(G,T,x);let I=m;const j=[A];(0,r.isAligned32)(I)||j.push(I=(0,r.copyBytes)(I));const it=(0,r.u32)(I);let ot=it[0],ut=it[1],ft=it[2],dt=it[3],lt=0;for(;lt+4<=R.length;)ot^=R[lt+0],ut^=R[lt+1],ft^=R[lt+2],dt^=R[lt+3],{s0:ot,s1:ut,s2:ft,s3:dt}=P(A,ot,ut,ft,dt),F[lt++]=ot,F[lt++]=ut,F[lt++]=ft,F[lt++]=dt;if(T){const wt=X(G.subarray(lt*4));ot^=wt[0],ut^=wt[1],ft^=wt[2],dt^=wt[3],{s0:ot,s1:ut,s2:ft,s3:dt}=P(A,ot,ut,ft,dt),F[lt++]=ot,F[lt++]=ut,F[lt++]=ft,F[lt++]=dt}return(0,r.clean)(...j),q},decrypt(G,x){$(G);const A=W(u);let R=m;const F=[A];(0,r.isAligned32)(R)||F.push(R=(0,r.copyBytes)(R));const q=(0,r.u32)(R);x=(0,r.getOutput)(G.length,x),(0,r.isAligned32)(G)||F.push(G=(0,r.copyBytes)(G)),(0,r.complexOverlapBytes)(G,x);const I=(0,r.u32)(G),j=(0,r.u32)(x);let it=q[0],ot=q[1],ut=q[2],ft=q[3];for(let dt=0;dt+4<=I.length;){const lt=it,wt=ot,yt=ut,ht=ft;it=I[dt+0],ot=I[dt+1],ut=I[dt+2],ft=I[dt+3];const{s0:at,s1:st,s2:ct,s3:f}=Y(A,it,ot,ut,ft);j[dt++]=at^lt,j[dt++]=st^wt,j[dt++]=ct^yt,j[dt++]=f^ht}return(0,r.clean)(...F),nt(x,T)}}}),t.cfb=(0,r.wrapCipher)({blockSize:16,nonceLength:16},function(u,m){function E(T,G,x){(0,r.abytes)(T);const A=T.length;if(x=(0,r.getOutput)(A,x),(0,r.overlapBytes)(T,x))throw new Error("overlapping src and dst not supported.");const R=K(u);let F=m;const q=[R];(0,r.isAligned32)(F)||q.push(F=(0,r.copyBytes)(F)),(0,r.isAligned32)(T)||q.push(T=(0,r.copyBytes)(T));const I=(0,r.u32)(T),j=(0,r.u32)(x),it=G?j:I,ot=(0,r.u32)(F);let ut=ot[0],ft=ot[1],dt=ot[2],lt=ot[3];for(let yt=0;yt+4<=I.length;){const{s0:ht,s1:at,s2:st,s3:ct}=P(R,ut,ft,dt,lt);j[yt+0]=I[yt+0]^ht,j[yt+1]=I[yt+1]^at,j[yt+2]=I[yt+2]^st,j[yt+3]=I[yt+3]^ct,ut=it[yt++],ft=it[yt++],dt=it[yt++],lt=it[yt++]}const wt=c*Math.floor(I.length/l);if(wt<A){({s0:ut,s1:ft,s2:dt,s3:lt}=P(R,ut,ft,dt,lt));const yt=(0,r.u8)(new Uint32Array([ut,ft,dt,lt]));for(let ht=wt,at=0;ht<A;ht++,at++)x[ht]=T[ht]^yt[at];(0,r.clean)(yt)}return(0,r.clean)(...q),x}return{encrypt:(T,G)=>E(T,!0,G),decrypt:(T,G)=>E(T,!1,G)}});function z(s,u,m,E,T){const G=T?T.length:0,x=s.create(m,E.length+G);T&&x.update(T);const A=(0,r.u64Lengths)(8*E.length,8*G,u);x.update(E),x.update(A);const R=x.digest();return(0,r.clean)(A),R}t.gcm=(0,r.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(u,m,E){if(m.length<8)throw new Error("aes/gcm: invalid nonce length");const T=16;function G(A,R,F){const q=z(e.ghash,!1,A,F,E);for(let I=0;I<R.length;I++)q[I]^=R[I];return q}function x(){const A=K(u),R=a.slice(),F=a.slice();if(Z(A,!1,F,F,R),m.length===12)F.set(m);else{const I=a.slice(),j=(0,r.createView)(I);(0,r.setBigUint64)(j,8,BigInt(m.length*8),!1);const it=e.ghash.create(R).update(m).update(I);it.digestInto(F),it.destroy()}const q=Z(A,!1,F,a);return{xk:A,authKey:R,counter:F,tagMask:q}}return{encrypt(A){const{xk:R,authKey:F,counter:q,tagMask:I}=x(),j=new Uint8Array(A.length+T),it=[R,F,q,I];(0,r.isAligned32)(A)||it.push(A=(0,r.copyBytes)(A)),Z(R,!1,q,A,j.subarray(0,A.length));const ot=G(F,I,j.subarray(0,j.length-T));return it.push(ot),j.set(ot,A.length),(0,r.clean)(...it),j},decrypt(A){const{xk:R,authKey:F,counter:q,tagMask:I}=x(),j=[R,F,I,q];(0,r.isAligned32)(A)||j.push(A=(0,r.copyBytes)(A));const it=A.subarray(0,-T),ot=A.subarray(-T),ut=G(F,I,it);if(j.push(ut),!(0,r.equalBytes)(ut,ot))throw new Error("aes/gcm: invalid ghash tag");const ft=Z(R,!1,q,it);return(0,r.clean)(...j),ft}}});const y=(s,u,m)=>E=>{if(!Number.isSafeInteger(E)||u>E||E>m){const T="["+u+".."+m+"]";throw new Error(""+s+": expected value in range "+T+", got "+E)}};t.gcmsiv=(0,r.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(u,m,E){const G=y("AAD",0,68719476736),x=y("plaintext",0,2**36),A=y("nonce",12,12),R=y("ciphertext",16,2**36+16);(0,r.abytes)(u,16,24,32),A(m.length),E!==void 0&&G(E.length);function F(){const j=K(u),it=new Uint8Array(u.length),ot=new Uint8Array(16),ut=[j,it];let ft=m;(0,r.isAligned32)(ft)||ut.push(ft=(0,r.copyBytes)(ft));const dt=(0,r.u32)(ft);let lt=0,wt=dt[0],yt=dt[1],ht=dt[2],at=0;for(const ct of[ot,it].map(r.u32)){const f=(0,r.u32)(ct);for(let n=0;n<f.length;n+=2){const{s0:i,s1:w}=P(j,lt,wt,yt,ht);f[n+0]=i,f[n+1]=w,lt=++at}}const st={authKey:ot,encKey:K(it)};return(0,r.clean)(...ut),st}function q(j,it,ot){const ut=z(e.polyval,!0,it,ot,E);for(let ht=0;ht<12;ht++)ut[ht]^=m[ht];ut[15]&=127;const ft=(0,r.u32)(ut);let dt=ft[0],lt=ft[1],wt=ft[2],yt=ft[3];return{s0:dt,s1:lt,s2:wt,s3:yt}=P(j,dt,lt,wt,yt),ft[0]=dt,ft[1]=lt,ft[2]=wt,ft[3]=yt,ut}function I(j,it,ot){let ut=(0,r.copyBytes)(it);ut[15]|=128;const ft=Z(j,!0,ut,ot);return(0,r.clean)(ut),ft}return{encrypt(j){x(j.length);const{encKey:it,authKey:ot}=F(),ut=q(it,ot,j),ft=[it,ot,ut];(0,r.isAligned32)(j)||ft.push(j=(0,r.copyBytes)(j));const dt=new Uint8Array(j.length+16);return dt.set(ut,j.length),dt.set(I(it,ut,j)),(0,r.clean)(...ft),dt},decrypt(j){R(j.length);const it=j.subarray(-16),{encKey:ot,authKey:ut}=F(),ft=[ot,ut];(0,r.isAligned32)(j)||ft.push(j=(0,r.copyBytes)(j));const dt=I(ot,it,j.subarray(0,-16)),lt=q(ot,ut,dt);if(ft.push(lt),!(0,r.equalBytes)(it,lt))throw(0,r.clean)(...ft),new Error("invalid polyval tag");return(0,r.clean)(...ft),dt}}}),t.siv=t.gcmsiv;function M(s){return s instanceof Uint32Array||ArrayBuffer.isView(s)&&s.constructor.name==="Uint32Array"}function v(s,u){if((0,r.abytes)(u,16),!M(s))throw new Error("_encryptBlock accepts result of expandKeyLE");const m=(0,r.u32)(u);let{s0:E,s1:T,s2:G,s3:x}=P(s,m[0],m[1],m[2],m[3]);return m[0]=E,m[1]=T,m[2]=G,m[3]=x,u}function g(s,u){if((0,r.abytes)(u,16),!M(s))throw new Error("_decryptBlock accepts result of expandKeyLE");const m=(0,r.u32)(u);let{s0:E,s1:T,s2:G,s3:x}=Y(s,m[0],m[1],m[2],m[3]);return m[0]=E,m[1]=T,m[2]=G,m[3]=x,u}const _={encrypt(s,u){if(u.length>=2**32)throw new Error("plaintext should be less than 4gb");const m=K(s);if(u.length===16)v(m,u);else{const E=(0,r.u32)(u);let T=E[0],G=E[1];for(let x=0,A=1;x<6;x++)for(let R=2;R<E.length;R+=2,A++){const{s0:F,s1:q,s2:I,s3:j}=P(m,T,G,E[R],E[R+1]);T=F,G=q^B(A),E[R]=I,E[R+1]=j}E[0]=T,E[1]=G}m.fill(0)},decrypt(s,u){if(u.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");const m=W(s),E=u.length/8-1;if(E===1)g(m,u);else{const T=(0,r.u32)(u);let G=T[0],x=T[1];for(let A=0,R=E*6;A<6;A++)for(let F=E*2;F>=1;F-=2,R--){x^=B(R);const{s0:q,s1:I,s2:j,s3:it}=Y(m,G,x,T[F],T[F+1]);G=q,x=I,T[F]=j,T[F+1]=it}T[0]=G,T[1]=x}m.fill(0)}},V=new Uint8Array(8).fill(166);t.aeskw=(0,r.wrapCipher)({blockSize:8},s=>({encrypt(u){if(!u.length||u.length%8!==0)throw new Error("invalid plaintext length");if(u.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const m=(0,r.concatBytes)(V,u);return _.encrypt(s,m),m},decrypt(u){if(u.length%8!==0||u.length<24)throw new Error("invalid ciphertext length");const m=(0,r.copyBytes)(u);if(_.decrypt(s,m),!(0,r.equalBytes)(m.subarray(0,8),V))throw new Error("integrity check failed");return m.subarray(0,8).fill(0),m.subarray(8)}}));const o=2790873510;t.aeskwp=(0,r.wrapCipher)({blockSize:8},s=>({encrypt(u){if(!u.length)throw new Error("invalid plaintext length");const m=Math.ceil(u.length/8)*8,E=new Uint8Array(8+m);E.set(u,8);const T=(0,r.u32)(E);return T[0]=o,T[1]=B(u.length),_.encrypt(s,E),E},decrypt(u){if(u.length<16)throw new Error("invalid ciphertext length");const m=(0,r.copyBytes)(u),E=(0,r.u32)(m);_.decrypt(s,m);const T=B(E[1])>>>0,G=Math.ceil(T/8)*8;if(E[0]!==o||m.length-8!==G)throw new Error("integrity check failed");for(let x=T;x<G;x++)if(m[8+x]!==0)throw new Error("integrity check failed");return m.subarray(0,8).fill(0),m.subarray(8,8+T)}})),t.unsafe={expandKeyLE:K,expandKeyDecLE:W,encrypt:P,decrypt:Y,encryptBlock:v,decryptBlock:g,ctrCounter:J,ctr32:Z}})(We)),We}var or;function Ns(){if(or)return $t;or=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.aes256cbc=$t.aes256gcm=void 0;var t=Ps(),e=function(c,l,a){return(0,t.gcm)(c,l,a)};$t.aes256gcm=e;var r=function(c,l,a){return(0,t.cbc)(c,l)};return $t.aes256cbc=r,$t}var Jt={},Ye={},ue={},sr;function ks(){if(sr)return ue;sr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.rotl=h,ue.createCipher=B;const t=kt(),e=p=>Uint8Array.from(p.split("").map(S=>S.charCodeAt(0))),r=e("expand 16-byte k"),c=e("expand 32-byte k"),l=(0,t.u32)(r),a=(0,t.u32)(c);function h(p,S){return p<<S|p>>>32-S}function d(p){return p.byteOffset%4===0}const O=64,C=16,H=2**32-1,b=new Uint32Array;function k(p,S,L,U,K,W,et,D){const P=K.length,Y=new Uint8Array(O),J=(0,t.u32)(Y),Z=d(K)&&d(W),$=Z?(0,t.u32)(K):b,tt=Z?(0,t.u32)(W):b;for(let nt=0;nt<P;et++){if(p(S,L,U,J,et,D),et>=H)throw new Error("arx: counter overflow");const X=Math.min(O,P-nt);if(Z&&X===O){const z=nt/4;if(nt%4!==0)throw new Error("arx: invalid block position");for(let y=0,M;y<C;y++)M=z+y,tt[M]=$[M]^J[y];nt+=O;continue}for(let z=0,y;z<X;z++)y=nt+z,W[y]=K[y]^Y[z];nt+=X}}function B(p,S){const{allowShortKeys:L,extendNonceFn:U,counterLength:K,counterRight:W,rounds:et}=(0,t.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},S);if(typeof p!="function")throw new Error("core must be a function");return(0,t.anumber)(K),(0,t.anumber)(et),(0,t.abool)(W),(0,t.abool)(L),(D,P,Y,J,Z=0)=>{(0,t.abytes)(D),(0,t.abytes)(P),(0,t.abytes)(Y);const $=Y.length;if(J===void 0&&(J=new Uint8Array($)),(0,t.abytes)(J),(0,t.anumber)(Z),Z<0||Z>=H)throw new Error("arx: counter overflow");if(J.length<$)throw new Error(`arx: output (${J.length}) is shorter than data (${$})`);const tt=[];let nt=D.length,X,z;if(nt===32)tt.push(X=(0,t.copyBytes)(D)),z=a;else if(nt===16&&L)X=new Uint8Array(32),X.set(D),X.set(D,16),z=l,tt.push(X);else throw new Error(`arx: invalid 32-byte key, got length=${nt}`);d(P)||tt.push(P=(0,t.copyBytes)(P));const y=(0,t.u32)(X);if(U){if(P.length!==24)throw new Error("arx: extended nonce must be 24 bytes");U(z,y,(0,t.u32)(P.subarray(0,16)),y),P=P.subarray(16)}const M=16-K;if(M!==P.length)throw new Error(`arx: nonce must be ${M} or 16 bytes`);if(M!==12){const g=new Uint8Array(12);g.set(P,W?0:12-P.length),P=g,tt.push(P)}const v=(0,t.u32)(P);return k(p,z,y,v,Y,J,Z,et),(0,t.clean)(...tt),J}}return ue}var re={},cr;function Ms(){if(cr)return re;cr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.poly1305=void 0,re.wrapConstructorWithKey=c;const t=kt(),e=(l,a)=>l[a++]&255|(l[a++]&255)<<8;class r{constructor(a){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,a=(0,t.toBytes)(a),(0,t.abytes)(a,32);const h=e(a,0),d=e(a,2),O=e(a,4),C=e(a,6),H=e(a,8),b=e(a,10),k=e(a,12),B=e(a,14);this.r[0]=h&8191,this.r[1]=(h>>>13|d<<3)&8191,this.r[2]=(d>>>10|O<<6)&7939,this.r[3]=(O>>>7|C<<9)&8191,this.r[4]=(C>>>4|H<<12)&255,this.r[5]=H>>>1&8190,this.r[6]=(H>>>14|b<<2)&8191,this.r[7]=(b>>>11|k<<5)&8065,this.r[8]=(k>>>8|B<<8)&8191,this.r[9]=B>>>5&127;for(let p=0;p<8;p++)this.pad[p]=e(a,16+2*p)}process(a,h,d=!1){const O=d?0:2048,{h:C,r:H}=this,b=H[0],k=H[1],B=H[2],p=H[3],S=H[4],L=H[5],U=H[6],K=H[7],W=H[8],et=H[9],D=e(a,h+0),P=e(a,h+2),Y=e(a,h+4),J=e(a,h+6),Z=e(a,h+8),$=e(a,h+10),tt=e(a,h+12),nt=e(a,h+14);let X=C[0]+(D&8191),z=C[1]+((D>>>13|P<<3)&8191),y=C[2]+((P>>>10|Y<<6)&8191),M=C[3]+((Y>>>7|J<<9)&8191),v=C[4]+((J>>>4|Z<<12)&8191),g=C[5]+(Z>>>1&8191),_=C[6]+((Z>>>14|$<<2)&8191),V=C[7]+(($>>>11|tt<<5)&8191),o=C[8]+((tt>>>8|nt<<8)&8191),s=C[9]+(nt>>>5|O),u=0,m=u+X*b+z*(5*et)+y*(5*W)+M*(5*K)+v*(5*U);u=m>>>13,m&=8191,m+=g*(5*L)+_*(5*S)+V*(5*p)+o*(5*B)+s*(5*k),u+=m>>>13,m&=8191;let E=u+X*k+z*b+y*(5*et)+M*(5*W)+v*(5*K);u=E>>>13,E&=8191,E+=g*(5*U)+_*(5*L)+V*(5*S)+o*(5*p)+s*(5*B),u+=E>>>13,E&=8191;let T=u+X*B+z*k+y*b+M*(5*et)+v*(5*W);u=T>>>13,T&=8191,T+=g*(5*K)+_*(5*U)+V*(5*L)+o*(5*S)+s*(5*p),u+=T>>>13,T&=8191;let G=u+X*p+z*B+y*k+M*b+v*(5*et);u=G>>>13,G&=8191,G+=g*(5*W)+_*(5*K)+V*(5*U)+o*(5*L)+s*(5*S),u+=G>>>13,G&=8191;let x=u+X*S+z*p+y*B+M*k+v*b;u=x>>>13,x&=8191,x+=g*(5*et)+_*(5*W)+V*(5*K)+o*(5*U)+s*(5*L),u+=x>>>13,x&=8191;let A=u+X*L+z*S+y*p+M*B+v*k;u=A>>>13,A&=8191,A+=g*b+_*(5*et)+V*(5*W)+o*(5*K)+s*(5*U),u+=A>>>13,A&=8191;let R=u+X*U+z*L+y*S+M*p+v*B;u=R>>>13,R&=8191,R+=g*k+_*b+V*(5*et)+o*(5*W)+s*(5*K),u+=R>>>13,R&=8191;let F=u+X*K+z*U+y*L+M*S+v*p;u=F>>>13,F&=8191,F+=g*B+_*k+V*b+o*(5*et)+s*(5*W),u+=F>>>13,F&=8191;let q=u+X*W+z*K+y*U+M*L+v*S;u=q>>>13,q&=8191,q+=g*p+_*B+V*k+o*b+s*(5*et),u+=q>>>13,q&=8191;let I=u+X*et+z*W+y*K+M*U+v*L;u=I>>>13,I&=8191,I+=g*S+_*p+V*B+o*k+s*b,u+=I>>>13,I&=8191,u=(u<<2)+u|0,u=u+m|0,m=u&8191,u=u>>>13,E+=u,C[0]=m,C[1]=E,C[2]=T,C[3]=G,C[4]=x,C[5]=A,C[6]=R,C[7]=F,C[8]=q,C[9]=I}finalize(){const{h:a,pad:h}=this,d=new Uint16Array(10);let O=a[1]>>>13;a[1]&=8191;for(let b=2;b<10;b++)a[b]+=O,O=a[b]>>>13,a[b]&=8191;a[0]+=O*5,O=a[0]>>>13,a[0]&=8191,a[1]+=O,O=a[1]>>>13,a[1]&=8191,a[2]+=O,d[0]=a[0]+5,O=d[0]>>>13,d[0]&=8191;for(let b=1;b<10;b++)d[b]=a[b]+O,O=d[b]>>>13,d[b]&=8191;d[9]-=8192;let C=(O^1)-1;for(let b=0;b<10;b++)d[b]&=C;C=~C;for(let b=0;b<10;b++)a[b]=a[b]&C|d[b];a[0]=(a[0]|a[1]<<13)&65535,a[1]=(a[1]>>>3|a[2]<<10)&65535,a[2]=(a[2]>>>6|a[3]<<7)&65535,a[3]=(a[3]>>>9|a[4]<<4)&65535,a[4]=(a[4]>>>12|a[5]<<1|a[6]<<14)&65535,a[5]=(a[6]>>>2|a[7]<<11)&65535,a[6]=(a[7]>>>5|a[8]<<8)&65535,a[7]=(a[8]>>>8|a[9]<<5)&65535;let H=a[0]+h[0];a[0]=H&65535;for(let b=1;b<8;b++)H=(a[b]+h[b]|0)+(H>>>16)|0,a[b]=H&65535;(0,t.clean)(d)}update(a){(0,t.aexists)(this),a=(0,t.toBytes)(a),(0,t.abytes)(a);const{buffer:h,blockLen:d}=this,O=a.length;for(let C=0;C<O;){const H=Math.min(d-this.pos,O-C);if(H===d){for(;d<=O-C;C+=d)this.process(a,C);continue}h.set(a.subarray(C,C+H),this.pos),this.pos+=H,C+=H,this.pos===d&&(this.process(h,0,!1),this.pos=0)}return this}destroy(){(0,t.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(a){(0,t.aexists)(this),(0,t.aoutput)(a,this),this.finished=!0;const{buffer:h,h:d}=this;let{pos:O}=this;if(O){for(h[O++]=1;O<16;O++)h[O]=0;this.process(h,0,!0)}this.finalize();let C=0;for(let H=0;H<8;H++)a[C++]=d[H]>>>0,a[C++]=d[H]>>>8;return a}digest(){const{buffer:a,outputLen:h}=this;this.digestInto(a);const d=a.slice(0,h);return this.destroy(),d}}function c(l){const a=(d,O)=>l(O).update((0,t.toBytes)(d)).digest(),h=l(new Uint8Array(32));return a.outputLen=h.outputLen,a.blockLen=h.blockLen,a.create=d=>l(d),a}return re.poly1305=c(l=>new r(l)),re}var ar;function Vs(){return ar||(ar=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.xchacha20poly1305=t.chacha20poly1305=t._poly1305_aead=t.chacha12=t.chacha8=t.xchacha20=t.chacha20=t.chacha20orig=void 0,t.hchacha=a;const e=ks(),r=Ms(),c=kt();function l(b,k,B,p,S,L=20){let U=b[0],K=b[1],W=b[2],et=b[3],D=k[0],P=k[1],Y=k[2],J=k[3],Z=k[4],$=k[5],tt=k[6],nt=k[7],X=S,z=B[0],y=B[1],M=B[2],v=U,g=K,_=W,V=et,o=D,s=P,u=Y,m=J,E=Z,T=$,G=tt,x=nt,A=X,R=z,F=y,q=M;for(let j=0;j<L;j+=2)v=v+o|0,A=(0,e.rotl)(A^v,16),E=E+A|0,o=(0,e.rotl)(o^E,12),v=v+o|0,A=(0,e.rotl)(A^v,8),E=E+A|0,o=(0,e.rotl)(o^E,7),g=g+s|0,R=(0,e.rotl)(R^g,16),T=T+R|0,s=(0,e.rotl)(s^T,12),g=g+s|0,R=(0,e.rotl)(R^g,8),T=T+R|0,s=(0,e.rotl)(s^T,7),_=_+u|0,F=(0,e.rotl)(F^_,16),G=G+F|0,u=(0,e.rotl)(u^G,12),_=_+u|0,F=(0,e.rotl)(F^_,8),G=G+F|0,u=(0,e.rotl)(u^G,7),V=V+m|0,q=(0,e.rotl)(q^V,16),x=x+q|0,m=(0,e.rotl)(m^x,12),V=V+m|0,q=(0,e.rotl)(q^V,8),x=x+q|0,m=(0,e.rotl)(m^x,7),v=v+s|0,q=(0,e.rotl)(q^v,16),G=G+q|0,s=(0,e.rotl)(s^G,12),v=v+s|0,q=(0,e.rotl)(q^v,8),G=G+q|0,s=(0,e.rotl)(s^G,7),g=g+u|0,A=(0,e.rotl)(A^g,16),x=x+A|0,u=(0,e.rotl)(u^x,12),g=g+u|0,A=(0,e.rotl)(A^g,8),x=x+A|0,u=(0,e.rotl)(u^x,7),_=_+m|0,R=(0,e.rotl)(R^_,16),E=E+R|0,m=(0,e.rotl)(m^E,12),_=_+m|0,R=(0,e.rotl)(R^_,8),E=E+R|0,m=(0,e.rotl)(m^E,7),V=V+o|0,F=(0,e.rotl)(F^V,16),T=T+F|0,o=(0,e.rotl)(o^T,12),V=V+o|0,F=(0,e.rotl)(F^V,8),T=T+F|0,o=(0,e.rotl)(o^T,7);let I=0;p[I++]=U+v|0,p[I++]=K+g|0,p[I++]=W+_|0,p[I++]=et+V|0,p[I++]=D+o|0,p[I++]=P+s|0,p[I++]=Y+u|0,p[I++]=J+m|0,p[I++]=Z+E|0,p[I++]=$+T|0,p[I++]=tt+G|0,p[I++]=nt+x|0,p[I++]=X+A|0,p[I++]=z+R|0,p[I++]=y+F|0,p[I++]=M+q|0}function a(b,k,B,p){let S=b[0],L=b[1],U=b[2],K=b[3],W=k[0],et=k[1],D=k[2],P=k[3],Y=k[4],J=k[5],Z=k[6],$=k[7],tt=B[0],nt=B[1],X=B[2],z=B[3];for(let M=0;M<20;M+=2)S=S+W|0,tt=(0,e.rotl)(tt^S,16),Y=Y+tt|0,W=(0,e.rotl)(W^Y,12),S=S+W|0,tt=(0,e.rotl)(tt^S,8),Y=Y+tt|0,W=(0,e.rotl)(W^Y,7),L=L+et|0,nt=(0,e.rotl)(nt^L,16),J=J+nt|0,et=(0,e.rotl)(et^J,12),L=L+et|0,nt=(0,e.rotl)(nt^L,8),J=J+nt|0,et=(0,e.rotl)(et^J,7),U=U+D|0,X=(0,e.rotl)(X^U,16),Z=Z+X|0,D=(0,e.rotl)(D^Z,12),U=U+D|0,X=(0,e.rotl)(X^U,8),Z=Z+X|0,D=(0,e.rotl)(D^Z,7),K=K+P|0,z=(0,e.rotl)(z^K,16),$=$+z|0,P=(0,e.rotl)(P^$,12),K=K+P|0,z=(0,e.rotl)(z^K,8),$=$+z|0,P=(0,e.rotl)(P^$,7),S=S+et|0,z=(0,e.rotl)(z^S,16),Z=Z+z|0,et=(0,e.rotl)(et^Z,12),S=S+et|0,z=(0,e.rotl)(z^S,8),Z=Z+z|0,et=(0,e.rotl)(et^Z,7),L=L+D|0,tt=(0,e.rotl)(tt^L,16),$=$+tt|0,D=(0,e.rotl)(D^$,12),L=L+D|0,tt=(0,e.rotl)(tt^L,8),$=$+tt|0,D=(0,e.rotl)(D^$,7),U=U+P|0,nt=(0,e.rotl)(nt^U,16),Y=Y+nt|0,P=(0,e.rotl)(P^Y,12),U=U+P|0,nt=(0,e.rotl)(nt^U,8),Y=Y+nt|0,P=(0,e.rotl)(P^Y,7),K=K+W|0,X=(0,e.rotl)(X^K,16),J=J+X|0,W=(0,e.rotl)(W^J,12),K=K+W|0,X=(0,e.rotl)(X^K,8),J=J+X|0,W=(0,e.rotl)(W^J,7);let y=0;p[y++]=S,p[y++]=L,p[y++]=U,p[y++]=K,p[y++]=tt,p[y++]=nt,p[y++]=X,p[y++]=z}t.chacha20orig=(0,e.createCipher)(l,{counterRight:!1,counterLength:8,allowShortKeys:!0}),t.chacha20=(0,e.createCipher)(l,{counterRight:!1,counterLength:4,allowShortKeys:!1}),t.xchacha20=(0,e.createCipher)(l,{counterRight:!1,counterLength:8,extendNonceFn:a,allowShortKeys:!1}),t.chacha8=(0,e.createCipher)(l,{counterRight:!1,counterLength:4,rounds:8}),t.chacha12=(0,e.createCipher)(l,{counterRight:!1,counterLength:4,rounds:12});const h=new Uint8Array(16),d=(b,k)=>{b.update(k);const B=k.length%16;B&&b.update(h.subarray(B))},O=new Uint8Array(32);function C(b,k,B,p,S){const L=b(k,B,O),U=r.poly1305.create(L);S&&d(U,S),d(U,p);const K=(0,c.u64Lengths)(p.length,S?S.length:0,!0);U.update(K);const W=U.digest();return(0,c.clean)(L,K),W}const H=b=>(k,B,p)=>({encrypt(L,U){const K=L.length;U=(0,c.getOutput)(K+16,U,!1),U.set(L);const W=U.subarray(0,-16);b(k,B,W,W,1);const et=C(b,k,B,W,p);return U.set(et,K),(0,c.clean)(et),U},decrypt(L,U){U=(0,c.getOutput)(L.length-16,U,!1);const K=L.subarray(0,-16),W=L.subarray(-16),et=C(b,k,B,K,p);if(!(0,c.equalBytes)(W,et))throw new Error("invalid tag");return U.set(L.subarray(0,-16)),b(k,B,U,U,1),(0,c.clean)(et),U}});t._poly1305_aead=H,t.chacha20poly1305=(0,c.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,t._poly1305_aead)(t.chacha20)),t.xchacha20poly1305=(0,c.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,t._poly1305_aead)(t.xchacha20))})(Ye)),Ye}var ur;function Fs(){if(ur)return Jt;ur=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.chacha20=Jt.xchacha20=void 0;var t=Vs(),e=function(c,l,a){return(0,t.xchacha20poly1305)(c,l,a)};Jt.xchacha20=e;var r=function(c,l,a){return(0,t.chacha20poly1305)(c,l,a)};return Jt.chacha20=r,Jt}var fr;function Ds(){return fr||(fr=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.aesDecrypt=t.aesEncrypt=t.symDecrypt=t.symEncrypt=void 0;var e=kt(),r=Kr(),c=Ns(),l=Fs(),a=Ie(),h=sn(),d=function(k,B,p){return C(H,k,B,p)};t.symEncrypt=d;var O=function(k,B,p){return C(b,k,B,p)};t.symDecrypt=O,t.aesEncrypt=t.symEncrypt,t.aesDecrypt=t.symDecrypt;function C(k,B,p,S){var L=(0,a.symmetricAlgorithm)();if(L==="aes-256-gcm")return k(c.aes256gcm,B,p,(0,a.symmetricNonceLength)(),h.AEAD_TAG_LENGTH,S);if(L==="xchacha20")return k(l.xchacha20,B,p,h.XCHACHA20_NONCE_LENGTH,h.AEAD_TAG_LENGTH,S);if(L==="aes-256-cbc")return k(c.aes256cbc,B,p,16,0);throw new Error("Not implemented")}function H(k,B,p,S,L,U){var K=(0,r.randomBytes)(S),W=k(B,K,U),et=W.encrypt(p);if(L===0)return(0,e.concatBytes)(K,et);var D=et.length-L,P=et.subarray(0,D),Y=et.subarray(D);return(0,e.concatBytes)(K,Y,P)}function b(k,B,p,S,L,U){var K=p.subarray(0,S),W=k(B,Uint8Array.from(K),U),et=p.subarray(S);if(L===0)return W.decrypt(et);var D=et.subarray(0,L),P=et.subarray(L);return W.decrypt((0,e.concatBytes)(P,D))}})(qe)),qe}var lr;function un(){return lr||(lr=1,(function(t){var e=zt&&zt.__createBinding||(Object.create?(function(c,l,a,h){h===void 0&&(h=a);var d=Object.getOwnPropertyDescriptor(l,a);(!d||("get"in d?!l.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(c,h,d)}):(function(c,l,a,h){h===void 0&&(h=a),c[h]=l[a]})),r=zt&&zt.__exportStar||function(c,l){for(var a in c)a!=="default"&&!Object.prototype.hasOwnProperty.call(l,a)&&e(l,c,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Rs(),t),r(Os(),t),r(qr(),t),r(Ds(),t)})(zt)),zt}var fe={},dr;function Wr(){if(dr)return fe;dr=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.PublicKey=void 0;var t=kt(),e=un(),r=(function(){function c(l,a){var h=(0,e.convertPublicKeyFormat)(l,!0,a),d=(0,e.convertPublicKeyFormat)(l,!1,a);this.data=h,this.dataUncompressed=h.length!==d.length?d:null}return c.fromHex=function(l,a){return new c((0,e.hexToPublicKey)(l,a),a)},Object.defineProperty(c.prototype,"_uncompressed",{get:function(){return this.dataUncompressed!==null?this.dataUncompressed:this.data},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"uncompressed",{get:function(){return Buffer.from(this._uncompressed)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"compressed",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),c.prototype.toBytes=function(l){return l===void 0&&(l=!0),l?this.data:this._uncompressed},c.prototype.toHex=function(l){return l===void 0&&(l=!0),(0,t.bytesToHex)(this.toBytes(l))},c.prototype.decapsulate=function(l,a){a===void 0&&(a=!1);var h=this.toBytes(a),d=l.multiply(this,a);return(0,e.getSharedKey)(h,d)},c.prototype.equals=function(l){return(0,t.equalBytes)(this.data,l.data)},c})();return fe.PublicKey=r,fe}var hr;function Ks(){if(hr)return oe;hr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.PrivateKey=void 0;var t=kt(),e=un(),r=Wr(),c=(function(){function l(a,h){if(this.curve=h,a===void 0)this.data=(0,e.getValidSecret)(h);else if((0,e.isValidPrivateKey)(a,h))this.data=a;else throw new Error("Invalid private key");this.publicKey=new r.PublicKey((0,e.getPublicKey)(this.data,h),h)}return l.fromHex=function(a,h){return new l((0,e.decodeHex)(a),h)},Object.defineProperty(l.prototype,"secret",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),l.prototype.toHex=function(){return(0,t.bytesToHex)(this.data)},l.prototype.encapsulate=function(a,h){h===void 0&&(h=!1);var d=this.publicKey.toBytes(h),O=this.multiply(a,h);return(0,e.getSharedKey)(d,O)},l.prototype.multiply=function(a,h){return h===void 0&&(h=!1),(0,e.getSharedPoint)(this.data,a.toBytes(!0),h,this.curve)},l.prototype.equals=function(a){return(0,t.equalBytes)(this.data,a.data)},l})();return oe.PrivateKey=c,oe}var yr;function mr(){return yr||(yr=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.PrivateKey=void 0;var e=Ks();Object.defineProperty(t,"PrivateKey",{enumerable:!0,get:function(){return e.PrivateKey}});var r=Wr();Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return r.PublicKey}})})(Ue)),Ue}var gr;function js(){return gr||(gr=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.PublicKey=t.PrivateKey=t.ECIES_CONFIG=void 0,t.encrypt=a,t.decrypt=d;var e=kt(),r=Ie(),c=mr(),l=un();function a(b,k){return Buffer.from(h(b,k))}function h(b,k){var B=(0,r.ellipticCurve)(),p=new c.PrivateKey(void 0,B),S=b instanceof Uint8Array?new c.PublicKey(b,B):c.PublicKey.fromHex(b,B),L=p.encapsulate(S,(0,r.isHkdfKeyCompressed)()),U=p.publicKey.toBytes((0,r.isEphemeralKeyCompressed)()),K=(0,l.symEncrypt)(L,k);return(0,e.concatBytes)(U,K)}function d(b,k){return Buffer.from(O(b,k))}function O(b,k){var B=(0,r.ellipticCurve)(),p=b instanceof Uint8Array?new c.PrivateKey(b,B):c.PrivateKey.fromHex(b,B),S=(0,r.ephemeralKeySize)(),L=new c.PublicKey(k.subarray(0,S),B),U=k.subarray(S),K=L.decapsulate(p,(0,r.isHkdfKeyCompressed)());return(0,l.symDecrypt)(K,U)}var C=Ie();Object.defineProperty(t,"ECIES_CONFIG",{enumerable:!0,get:function(){return C.ECIES_CONFIG}});var H=mr();Object.defineProperty(t,"PrivateKey",{enumerable:!0,get:function(){return H.PrivateKey}}),Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return H.PublicKey}}),t.utils={aesEncrypt:l.aesEncrypt,aesDecrypt:l.aesDecrypt,symEncrypt:l.symEncrypt,symDecrypt:l.symDecrypt,decodeHex:l.decodeHex,getValidSecret:l.getValidSecret,remove0x:l.remove0x}})(Re)),Re}var fn=js();typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Es.Buffer);fn.ECIES_CONFIG.ellipticCurve="secp256k1";fn.ECIES_CONFIG.symmetricAlgorithm="aes-256-gcm";const Gs=new TextEncoder;function Zs(t,e){return fn.encrypt(t,Gs.encode(e)).toString("hex")}const qs=["CORE_SDK",...ms()];async function ln(t,e,r,c){if(!t||!e)throw new Error("appId and secret are required");try{const l=await gs(),a=await Ys(r,c),{identifier:h,sdkVersion:d,...O}=a,C={"Content-Type":"text/plain",sdkVersion:d},H=Xs(l,{appId:t,secret:e,identifier:h,timestamp:Date.now(),products:qs,...O}),b=await fetch(Jr,{method:"POST",body:H,headers:C});if(!b.ok){const L=await b.json(),{code:U,message:K}=L;throw b.status===401&&U===7001005?(Mr(),new Error(K)):new Error(K||`HTTP error! status: ${b.status}`)}const k=await b.json(),{accessToken:B,expiresIn:p}=k,S=Date.now()+(p-90)*1e3;return{accessToken:B,expiredTime:S}}catch(l){throw l instanceof Error?new Error(`Failed to get access token: ${l.message}`,{cause:l}):new Error(`Failed to get access token: ${String(l)}`)}}const Ws=typeof window<"u"&&window.location?.hostname?window.location.hostname:"restriction.test.example.com";async function Ys(t,e=Ws){return t??zs(e)}async function zs(t){return{identifier:await on(),origin:t,keyPlatform:"WEB",sdkVersion:_e.version}}function Xs(t,e){return Zs(t,JSON.stringify(e))}const pr="tokenUpdated",$s={maxRetries:3,initialDelay:500};class jt{static instance;_appId="";_secret="";_platform;_accessToken="";_expiredTime=0;_version="";_identifier="";_webIdentifier="";_tokenGetter;_tokenPending=null;_dispatch=tn(pr);_globalDispatcher;constructor(){}static getInstance(){return jt.instance||(jt.instance=new jt),jt.instance}async setAccessByAppKey(e){this._tokenGetter=this._fetchToken.bind(this);const{appId:r,secret:c,platform:l}=e;this._appId=r,this._secret=c,this._platform=l,this._version=l?.sdkVersion||_e.version,this._identifier=l?.identifier||await this.getWebIdentifier()}setTokenGetter(e){this._tokenGetter=e}async setupTokenManager(){if(!this._tokenGetter)throw new Error("getTokenAsync() is not set!");const{maxRetries:e,initialDelay:r}=$s;let c=0;for(;c<=e;)try{const l=await this._tokenGetter();if(l){this._updateContext(l);return}}catch(l){if(c++,c>e)throw this._globalDispatcher.call("unauthorized"),l;await this._retryDelay(c,r)}}getSdkVersion(){return this._version||_e.version}async getIdentifier(){return this._identifier||await this.getWebIdentifier()}async getAccessToken(){if(this._accessToken&&!this._isTokenExpired)return this._accessToken;if(this._tokenPending)return this._tokenPending;if(!this._tokenGetter)throw new Error("Token getter not configured. Call setGetTokenAsync() first.");return this._tokenPending=this._tokenGetter().then(e=>(this._updateContext(e),this._dispatch.call(pr,null,e.accessToken),e.accessToken)).catch(e=>{throw this._tokenPending=null,e}).finally(()=>{this._tokenPending=null}),this._tokenPending}async getWebIdentifier(){if(!this._webIdentifier){const r=await(await ys.load()).get();this._webIdentifier=r.visitorId}return this._webIdentifier}on(e,r){return this._dispatch.on(e,r),{off:()=>this._dispatch.on(e,null)}}setGlobalDispatcher(e){this._globalDispatcher=e}getGlobalDispatcher(){return this._globalDispatcher}clearState(){this._appId="",this._secret="",this._platform=void 0,this._webIdentifier="",this._tokenPending=null,this._tokenGetter=void 0,this._accessToken="",this._expiredTime=0,this._version="",this._identifier=""}get _isTokenExpired(){return this._expiredTime<=Date.now()}_updateContext(e){const{accessToken:r,expiredTime:c,identifier:l,sdkVersion:a}=e;this._accessToken=r,this._expiredTime=c,l!==void 0&&(this._identifier=l),a!==void 0&&(this._version=a)}_fetchToken(){return ln(this._appId,this._secret,this._platform)}async _retryDelay(e,r){const c=r*Math.pow(2,e-1);return console.warn(`Retrying in ${c} ms... (Attempt ${e})`),new Promise(l=>setTimeout(l,c))}}const dn=["unauthorized","initError"],Je=globalThis,Qe=tn(...dn);jt.getInstance().setGlobalDispatcher(Qe);Je.MapxusMapEvents=Je.MapxusMapEvents||{};Je.MapxusMapEvents.on=function(t,e){return Qe.on(t,e),{off:()=>Qe.on(t,null)}};var Ut=(t=>(t.ENGLISH="en",t.CHINESE_SIMPLIFIED="zh-Hans",t.CHINESE_TRADITIONAL="zh-Hant",t.CHINESE_TRADITIONAL_TW="zh-Hant-TW",t.JAPANESE="ja",t.KOREAN="ko",t.FILIPINO="fil",t.INDONESIAN="id",t.PORTUGUESE="pt",t.THAI="th",t.VIETNAMESE="vi",t.ARABIC="ar",t))(Ut||{});function Yr(t){let e=null;return Js(t)?e=Ut.ENGLISH:Qs(t)?e=Ut.CHINESE_SIMPLIFIED:tc(t)?e=Ut.CHINESE_TRADITIONAL:ec(t)?e=Ut.CHINESE_TRADITIONAL_TW:nc(t)?e=Ut.JAPANESE:rc(t)?e=Ut.KOREAN:ic(t)?e=Ut.FILIPINO:oc(t)?e=Ut.INDONESIAN:sc(t)?e=Ut.PORTUGUESE:cc(t)?e=Ut.THAI:ac(t)?e=Ut.VIETNAMESE:uc(t)&&(e=Ut.ARABIC),e}function Js(t){return/^en(-(US|GB|AU))?$/.test(t)}function Qs(t){return/^zh(-(Hans|CN))?$/.test(t)}function tc(t){return/^zh-(Hant|HK|MO)$/.test(t)}function ec(t){return t==="zh-TW"}function nc(t){return/^ja(-JP)?$/.test(t)}function rc(t){return/^ko(-KR)?$/.test(t)}function ic(t){return/^(fil|tl)(-PH)?$/.test(t)}function oc(t){return/^id(-ID)?$/.test(t)}function sc(t){return/^pt(-(BR|PT))?$/.test(t)}function cc(t){return/^th(-TH)?$/.test(t)}function ac(t){return/^vi(-VN)?$/.test(t)}function uc(t){return/^ar(-(DZ|BH|EG|IQ|JO|KW|LB|LY|MA|OM|QA|SA|SY|TN|AE|YE))?$/.test(t)}const zr="reserve_mapxus-level-fill",Xr="reserve_mapxus-shared-level-fill",fc={convertBrowserLangToPresetLang:Yr,getAccessToken:ln,getIdentifier:on,setGetTokenAsync:Fr,setupTokenManager:Dr,VERSION:br,OFFSET:wr,PAGE:vr,ERRORS:dn,ASSISTANT_LAYER_INDOOR_FLOORS:zr,ASSISTANT_LAYER_SHARED_FLOORS:Xr,__internal:kr};exports.ASSISTANT_LAYER_INDOOR_FLOORS=zr;exports.ASSISTANT_LAYER_SHARED_FLOORS=Xr;exports.ERRORS=dn;exports.OFFSET=wr;exports.PAGE=vr;exports.VERSION=br;exports.__internal=kr;exports.convertBrowserLangToPresetLang=Yr;exports.default=fc;exports.getAccessToken=ln;exports.getIdentifier=on;exports.setGetTokenAsync=Fr;exports.setupTokenManager=Dr;
|