cppay-sdk 0.0.2-beta.23 → 0.0.2-beta.25
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/AlertController-BPGQ5PgH.js +12787 -0
- package/dist/AlertController-CjTbf-Vd.cjs +10 -0
- package/dist/ApiController-Crww70p3.js +5652 -0
- package/dist/ApiController-DB43iwF1.cjs +4 -0
- package/dist/CaipNetworkUtil-Bd4HeTLY.js +204 -0
- package/dist/CaipNetworkUtil-Bg22uavB.cjs +1 -0
- package/dist/HelpersUtil-CeTmhhZv.js +1415 -0
- package/dist/HelpersUtil-L0eeYoE2.cjs +225 -0
- package/dist/PhArrowCircleDown-BBy_VuPx.js +46 -0
- package/dist/PhArrowCircleDown-BU4QSsA3.cjs +14 -0
- package/dist/PhArrowClockwise-D8C24T6J.js +46 -0
- package/dist/PhArrowClockwise-DWqhijc2.cjs +14 -0
- package/dist/PhArrowDown-Qm1T2ueY.cjs +14 -0
- package/dist/PhArrowDown-p9Tekztm.js +46 -0
- package/dist/PhArrowLeft-CEtyMFdq.cjs +14 -0
- package/dist/PhArrowLeft-CgSKs9Xe.js +46 -0
- package/dist/PhArrowRight-ZatyoD6R.cjs +14 -0
- package/dist/PhArrowRight-dMdzUgrx.js +46 -0
- package/dist/PhArrowSquareOut-CbP71Gny.js +46 -0
- package/dist/PhArrowSquareOut-HyssV9za.cjs +14 -0
- package/dist/PhArrowUp-Cz127u8b.cjs +14 -0
- package/dist/PhArrowUp-DNn-RQ7v.js +46 -0
- package/dist/PhArrowUpRight-BX6LlOL0.cjs +14 -0
- package/dist/PhArrowUpRight-OyGUhoGi.js +46 -0
- package/dist/PhArrowsClockwise-B6w_d2Gy.cjs +14 -0
- package/dist/PhArrowsClockwise-BWITTwAP.js +46 -0
- package/dist/PhArrowsDownUp-CHHtczH8.js +46 -0
- package/dist/PhArrowsDownUp-WYzjhvmQ.cjs +14 -0
- package/dist/PhArrowsLeftRight-BA0fjcLn.js +46 -0
- package/dist/PhArrowsLeftRight-bgyrYWLt.cjs +14 -0
- package/dist/PhBank-BInxTxLw.js +46 -0
- package/dist/PhBank-CZ_uTsAN.cjs +14 -0
- package/dist/PhBrowser--6CxS13p.js +46 -0
- package/dist/PhBrowser-BzOw0W8k.cjs +14 -0
- package/dist/PhCaretDown-D-zrPZN9.js +46 -0
- package/dist/PhCaretDown-DvF3M2iu.cjs +14 -0
- package/dist/PhCaretLeft-DND0SNkF.cjs +14 -0
- package/dist/PhCaretLeft-Dm6NsnIS.js +46 -0
- package/dist/PhCaretRight-BkRzbZ5m.js +46 -0
- package/dist/PhCaretRight-xQkT3bmO.cjs +14 -0
- package/dist/PhCaretUp-BEk_5jnn.cjs +14 -0
- package/dist/PhCaretUp-DZRZQ-T1.js +46 -0
- package/dist/PhCheck-BmwCUZuW.js +46 -0
- package/dist/PhCheck-C-u2QP3y.cjs +14 -0
- package/dist/PhCircleHalf--TfGDEAT.js +46 -0
- package/dist/PhCircleHalf-keQfI7pU.cjs +14 -0
- package/dist/PhClock-BvmbjmRx.cjs +14 -0
- package/dist/PhClock-DNCf5CVD.js +46 -0
- package/dist/PhCompass-B6tcbOFZ.js +46 -0
- package/dist/PhCompass-rWCQ_cR8.cjs +14 -0
- package/dist/PhCopy-CzC1olDO.cjs +14 -0
- package/dist/PhCopy-rbBTM6ME.js +46 -0
- package/dist/PhCreditCard-DOpOB0Pl.js +46 -0
- package/dist/PhCreditCard-D_qRVKuY.cjs +14 -0
- package/dist/PhCurrencyDollar-4EASQkjs.js +46 -0
- package/dist/PhCurrencyDollar-RVJJ6bQ3.cjs +14 -0
- package/dist/PhDesktop-CPaC-lRj.cjs +14 -0
- package/dist/PhDesktop-DZPux6RD.js +46 -0
- package/dist/PhDeviceMobile-BnXs4f3Q.cjs +14 -0
- package/dist/PhDeviceMobile-CcdKzyah.js +46 -0
- package/dist/PhDotsThree-19bbXQaM.js +46 -0
- package/dist/PhDotsThree-DSmFeW6i.cjs +14 -0
- package/dist/PhEnvelope-F7RF6h58.js +46 -0
- package/dist/PhEnvelope-QuTMQbE9.cjs +14 -0
- package/dist/PhFunnelSimple-B_FRP21W.js +46 -0
- package/dist/PhFunnelSimple-D4Ztu4ri.cjs +14 -0
- package/dist/PhGlobe-B8GrTk4S.cjs +14 -0
- package/dist/PhGlobe-BSPoRqTV.js +46 -0
- package/dist/PhIdentificationCard-fGDBGII0.cjs +14 -0
- package/dist/PhIdentificationCard-giQnti3K.js +46 -0
- package/dist/PhImage-BpUk8j27.cjs +14 -0
- package/dist/PhImage-PtBaftbW.js +46 -0
- package/dist/PhInfo-DQEDS02h.js +46 -0
- package/dist/PhInfo-V5wKJJoK.cjs +14 -0
- package/dist/PhLightbulb-Cisg0Myw.js +46 -0
- package/dist/PhLightbulb-xP9kaUlD.cjs +14 -0
- package/dist/PhMagnifyingGlass-C1cVSYf2.cjs +14 -0
- package/dist/PhMagnifyingGlass-DlkOfQXn.js +46 -0
- package/dist/PhPaperPlaneRight-C7Jp2jl_.js +46 -0
- package/dist/PhPaperPlaneRight-Kh3uxxIy.cjs +14 -0
- package/dist/PhPlus-BgHn57eW.js +46 -0
- package/dist/PhPlus-hJ6DZNjc.cjs +14 -0
- package/dist/PhPower-C369g1jk.js +46 -0
- package/dist/PhPower-DZ-SpUrD.cjs +14 -0
- package/dist/PhPuzzlePiece-B0oABcWl.js +46 -0
- package/dist/PhPuzzlePiece-DLtOLrcw.cjs +14 -0
- package/dist/PhQrCode-BT_hyeEa.js +46 -0
- package/dist/PhQrCode-yI6bLoYY.cjs +14 -0
- package/dist/PhQuestion-B1UeE96D.js +46 -0
- package/dist/PhQuestion-icSeWABx.cjs +14 -0
- package/dist/PhQuestionMark-CBVW9Awo.js +46 -0
- package/dist/PhQuestionMark-Cmhqu81E.cjs +14 -0
- package/dist/PhSealCheck-DTKS5QAx.cjs +14 -0
- package/dist/PhSealCheck-Dm2I2X7k.js +46 -0
- package/dist/PhSignOut-25xp33w2.cjs +14 -0
- package/dist/PhSignOut-BTTDADPY.js +46 -0
- package/dist/PhSpinner-Dbua7p0Y.js +46 -0
- package/dist/PhSpinner-DtpwblyA.cjs +14 -0
- package/dist/PhTrash-B3wUg10m.cjs +14 -0
- package/dist/PhTrash-gZghJkGX.js +46 -0
- package/dist/PhUser-Bvcv05IM.js +46 -0
- package/dist/PhUser-COPP3N-M.cjs +14 -0
- package/dist/PhVault-CFa5lrPU.cjs +14 -0
- package/dist/PhVault-DvlBF0VI.js +46 -0
- package/dist/PhWallet-CzJcybaO.cjs +14 -0
- package/dist/PhWallet-Do_lf9BX.js +46 -0
- package/dist/PhWarning-BrbSc7gQ.cjs +14 -0
- package/dist/PhWarning-DiIpJVsx.js +46 -0
- package/dist/PhWarningCircle-DE9BlEIc.js +46 -0
- package/dist/PhWarningCircle-F5Piypme.cjs +14 -0
- package/dist/PhX-BK3VZT8X.cjs +14 -0
- package/dist/PhX-CNlXuiat.js +46 -0
- package/dist/basic-C16-Uba1.js +3796 -0
- package/dist/basic-ChiCOE6E.cjs +1329 -0
- package/dist/chunk-2qRSBEuq.js +18 -0
- package/dist/chunk-DT80SxnK.cjs +1 -0
- package/dist/core-DKXmyfMB.js +2337 -0
- package/dist/core-PuDBroil.cjs +1 -0
- package/dist/dijkstra-CNhLvnjU.cjs +1 -0
- package/dist/dijkstra-kFl0HtsI.js +56 -0
- package/dist/features-BYfQH2hG.cjs +2 -0
- package/dist/features-_5Pi-gXV.js +245 -0
- package/dist/index.cjs +1 -1
- package/dist/index.es-DDV8bPq_.js +8311 -0
- package/dist/index.es-fgFnvPDP.cjs +19 -0
- package/dist/property-Dil4gG0H.cjs +3 -0
- package/dist/property-JsW5AM1M.js +578 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +133 -131
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +107 -105
- package/dist/w3m-modal-BBvmkTyb.cjs +2416 -0
- package/dist/w3m-modal-CFhImDZN.js +5286 -0
- package/dist/walletconnect-B0zXLUON.cjs +17 -0
- package/dist/walletconnect-Bb4rv9-G.js +11314 -0
- package/dist/wui-list-item-BGvfYb1W.cjs +1452 -0
- package/dist/wui-list-item-C4wJpGBn.js +2123 -0
- package/package.json +2 -3
- package/dist/walletconnect-B0L70Mgc.js +0 -1239
- package/dist/walletconnect-B_n5YF-h.cjs +0 -8
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const e=require(`./chunk-DT80SxnK.cjs`);var t=e.t(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),n=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},r=function(){function e(e,t,n){this.name=e,this.version=t,this.os=n,this.type=`browser`}return e}(),i=function(){function e(e){this.version=e,this.type=`node`,this.name=`node`,this.os=process.platform}return e}(),a=function(){function e(e,t,n,r){this.name=e,this.version=t,this.os=n,this.bot=r,this.type=`bot-device`}return e}(),o=function(){function e(){this.type=`bot`,this.bot=!0,this.name=`bot`,this.version=null,this.os=null}return e}(),s=function(){function e(){this.type=`react-native`,this.name=`react-native`,this.version=null,this.os=null}return e}(),c=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,l=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,u=3,d=[[`aol`,/AOLShield\/([0-9\._]+)/],[`edge`,/Edge\/([0-9\._]+)/],[`edge-ios`,/EdgiOS\/([0-9\._]+)/],[`yandexbrowser`,/YaBrowser\/([0-9\._]+)/],[`kakaotalk`,/KAKAOTALK\s([0-9\.]+)/],[`samsung`,/SamsungBrowser\/([0-9\.]+)/],[`silk`,/\bSilk\/([0-9._-]+)\b/],[`miui`,/MiuiBrowser\/([0-9\.]+)$/],[`beaker`,/BeakerBrowser\/([0-9\.]+)/],[`edge-chromium`,/EdgA?\/([0-9\.]+)/],[`chromium-webview`,/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],[`chrome`,/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],[`phantomjs`,/PhantomJS\/([0-9\.]+)(:?\s|$)/],[`crios`,/CriOS\/([0-9\.]+)(:?\s|$)/],[`firefox`,/Firefox\/([0-9\.]+)(?:\s|$)/],[`fxios`,/FxiOS\/([0-9\.]+)/],[`opera-mini`,/Opera Mini.*Version\/([0-9\.]+)/],[`opera`,/Opera\/([0-9\.]+)(?:\s|$)/],[`opera`,/OPR\/([0-9\.]+)(:?\s|$)/],[`pie`,/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],[`pie`,/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],[`netfront`,/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],[`ie`,/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],[`ie`,/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],[`ie`,/MSIE\s(7\.0)/],[`bb10`,/BB10;\sTouch.*Version\/([0-9\.]+)/],[`android`,/Android\s([0-9\.]+)/],[`ios`,/Version\/([0-9\._]+).*Mobile.*Safari.*/],[`safari`,/Version\/([0-9\._]+).*Safari/],[`facebook`,/FB[AS]V\/([0-9\.]+)/],[`instagram`,/Instagram\s([0-9\.]+)/],[`ios-webview`,/AppleWebKit\/([0-9\.]+).*Mobile/],[`ios-webview`,/AppleWebKit\/([0-9\.]+).*Gecko\)$/],[`curl`,/^curl\/([0-9\.]+)$/],[`searchbot`,c]],f=[[`iOS`,/iP(hone|od|ad)/],[`Android OS`,/Android/],[`BlackBerry OS`,/BlackBerry|BB10/],[`Windows Mobile`,/IEMobile/],[`Amazon OS`,/Kindle/],[`Windows 3.11`,/Win16/],[`Windows 95`,/(Windows 95)|(Win95)|(Windows_95)/],[`Windows 98`,/(Windows 98)|(Win98)/],[`Windows 2000`,/(Windows NT 5.0)|(Windows 2000)/],[`Windows XP`,/(Windows NT 5.1)|(Windows XP)/],[`Windows Server 2003`,/(Windows NT 5.2)/],[`Windows Vista`,/(Windows NT 6.0)/],[`Windows 7`,/(Windows NT 6.1)/],[`Windows 8`,/(Windows NT 6.2)/],[`Windows 8.1`,/(Windows NT 6.3)/],[`Windows 10`,/(Windows NT 10.0)/],[`Windows ME`,/Windows ME/],[`Windows CE`,/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],[`Open BSD`,/OpenBSD/],[`Sun OS`,/SunOS/],[`Chrome OS`,/CrOS/],[`Linux`,/(Linux)|(X11)/],[`Mac OS`,/(Mac_PowerPC)|(Macintosh)/],[`QNX`,/QNX/],[`BeOS`,/BeOS/],[`OS/2`,/OS\/2/]];function p(e){return e?h(e):typeof document>`u`&&typeof navigator<`u`&&navigator.product===`ReactNative`?new s:typeof navigator<`u`?h(navigator.userAgent):_()}function m(e){return e!==``&&d.reduce(function(t,n){var r=n[0],i=n[1];if(t)return t;var a=i.exec(e);return!!a&&[r,a]},!1)}function h(e){var t=m(e);if(!t)return null;var i=t[0],s=t[1];if(i===`searchbot`)return new o;var c=s[1]&&s[1].split(`.`).join(`_`).split(`_`).slice(0,3);c?c.length<u&&(c=n(n([],c,!0),v(u-c.length),!0)):c=[];var d=c.join(`.`),f=g(e),p=l.exec(e);return p&&p[1]?new a(i,d,f,p[1]):new r(i,d,f)}function g(e){for(var t=0,n=f.length;t<n;t++){var r=f[t],i=r[0];if(r[1].exec(e))return i}return null}function _(){return typeof process<`u`&&process.version?new i(process.version.slice(1)):null}function v(e){for(var t=[],n=0;n<e;n++)t.push(`0`);return t}var y=e.r({__assign:()=>_e,__asyncDelegator:()=>le,__asyncGenerator:()=>ce,__asyncValues:()=>ue,__await:()=>se,__awaiter:()=>T,__classPrivateFieldGet:()=>me,__classPrivateFieldSet:()=>he,__createBinding:()=>te,__decorate:()=>S,__exportStar:()=>ne,__extends:()=>b,__generator:()=>ee,__importDefault:()=>pe,__importStar:()=>fe,__makeTemplateObject:()=>de,__metadata:()=>w,__param:()=>C,__read:()=>ie,__rest:()=>x,__spread:()=>ae,__spreadArrays:()=>oe,__values:()=>re});function b(e,t){ge(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function x(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function S(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function C(e,t){return function(n,r){t(n,r,e)}}function w(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function T(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function ee(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function te(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}function ne(e,t){for(var n in e)n!==`default`&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function re(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ie(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ae(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ie(arguments[t]));return e}function oe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function se(e){return this instanceof se?(this.v=e,this):new se(e)}function ce(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i={},o(`next`),o(`throw`),o(`return`),i[Symbol.asyncIterator]=function(){return this},i;function o(e){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{c(r[e](t))}catch(e){d(a[0][3],e)}}function c(e){e.value instanceof se?Promise.resolve(e.value.v).then(l,u):d(a[0][2],e)}function l(e){s(`next`,e)}function u(e){s(`throw`,e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function le(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:se(e[r](t)),done:r===`return`}:i?i(t):t}:i}}function ue(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof re==`function`?re(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function de(e,t){return Object.defineProperty?Object.defineProperty(e,`raw`,{value:t}):e.raw=t,e}function fe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function pe(e){return e&&e.__esModule?e:{default:e}}function me(e,t){if(!t.has(e))throw TypeError(`attempted to get private field on non-instance`);return t.get(e)}function he(e,t,n){if(!t.has(e))throw TypeError(`attempted to set private field on non-instance`);return t.set(e,n),n}var ge,_e,ve=e.n((()=>{ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ge(e,t)},_e=function(){return _e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_e.apply(this,arguments)}})),ye=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.delay=void 0;function t(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}e.delay=t})),be=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ONE_THOUSAND=e.ONE_HUNDRED=void 0,e.ONE_HUNDRED=100,e.ONE_THOUSAND=1e3})),xe=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365})),Se=e.t((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(ve(),e.a(y));n.__exportStar(be(),t),n.__exportStar(xe(),t)})),Ce=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromMiliseconds=e.toMiliseconds=void 0;var t=Se();function n(e){return e*t.ONE_THOUSAND}e.toMiliseconds=n;function r(e){return Math.floor(e/t.ONE_THOUSAND)}e.fromMiliseconds=r})),we=e.t((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(ve(),e.a(y));n.__exportStar(ye(),t),n.__exportStar(Ce(),t)})),Te=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Watch=void 0;var t=class{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(t.elapsed!==void 0)throw Error(`Watch already stopped for label: ${e}`);let n=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:n})}get(e){let t=this.timestamps.get(e);if(t===void 0)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}};e.Watch=t,e.default=t})),Ee=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IWatch=void 0,e.IWatch=class{}})),De=e.t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),(ve(),e.a(y)).__exportStar(Ee(),t)})),Oe=e.t((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(ve(),e.a(y));n.__exportStar(we(),t),n.__exportStar(Te(),t),n.__exportStar(De(),t),n.__exportStar(Se(),t)})),ke=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0;function t(e){let t;return typeof window<`u`&&window[e]!==void 0&&(t=window[e]),t}e.getFromWindow=t;function n(e){let n=t(e);if(!n)throw Error(`${e} is not defined in Window`);return n}e.getFromWindowOrThrow=n;function r(){return n(`document`)}e.getDocumentOrThrow=r;function i(){return t(`document`)}e.getDocument=i;function a(){return n(`navigator`)}e.getNavigatorOrThrow=a;function o(){return t(`navigator`)}e.getNavigator=o;function s(){return n(`location`)}e.getLocationOrThrow=s;function c(){return t(`location`)}e.getLocation=c;function l(){return n(`crypto`)}e.getCryptoOrThrow=l;function u(){return t(`crypto`)}e.getCrypto=u;function d(){return n(`localStorage`)}e.getLocalStorageOrThrow=d;function f(){return t(`localStorage`)}e.getLocalStorage=f})),Ae=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getWindowMetadata=void 0;var t=ke();function n(){let e,n;try{e=t.getDocumentOrThrow(),n=t.getLocationOrThrow()}catch{return null}function r(){let t=e.getElementsByTagName(`link`),r=[];for(let e=0;e<t.length;e++){let i=t[e],a=i.getAttribute(`rel`);if(a&&a.toLowerCase().indexOf(`icon`)>-1){let e=i.getAttribute(`href`);if(e)if(e.toLowerCase().indexOf(`https:`)===-1&&e.toLowerCase().indexOf(`http:`)===-1&&e.indexOf(`//`)!==0){let t=n.protocol+`//`+n.host;if(e.indexOf(`/`)===0)t+=e;else{let r=n.pathname.split(`/`);r.pop();let i=r.join(`/`);t+=i+`/`+e}r.push(t)}else if(e.indexOf(`//`)===0){let t=n.protocol+e;r.push(t)}else r.push(e)}}return r}function i(...t){let n=e.getElementsByTagName(`meta`);for(let e=0;e<n.length;e++){let r=n[e],i=[`itemprop`,`property`,`name`].map(e=>r.getAttribute(e)).filter(e=>e?t.includes(e):!1);if(i.length&&i){let e=r.getAttribute(`content`);if(e)return e}}return``}function a(){let t=i(`name`,`og:site_name`,`og:title`,`twitter:title`);return t||=e.title,t}function o(){return i(`description`,`og:description`,`twitter:description`,`keywords`)}let s=a();return{description:o(),url:n.origin,icons:r(),name:s}}e.getWindowMetadata=n}));const je=`0.1.1`;function Me(){return`0.1.1`}var E=class e extends Error{constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&`details`in n.cause&&typeof n.cause.details==`string`?n.cause.details:n.cause?.message?n.cause.message:n.details})(),i=(()=>n.cause instanceof e&&n.cause.docsPath||n.docsPath)(),a=`https://oxlib.sh${i??``}`,o=[t||`An error occurred.`,...n.metaMessages?[``,...n.metaMessages]:[],...r||i?[``,r?`Details: ${r}`:void 0,i?`See: ${a}`:void 0]:[]].filter(e=>typeof e==`string`).join(`
|
|
2
|
+
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,`details`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`docs`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`docsPath`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`shortMessage`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`cause`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`BaseError`}),Object.defineProperty(this,`version`,{enumerable:!0,configurable:!0,writable:!0,value:`ox@${Me()}`}),this.cause=n.cause,this.details=r,this.docs=a,this.docsPath=i,this.shortMessage=t}walk(e){return Ne(this,e)}};function Ne(e,t){return t?.(e)?e:e&&typeof e==`object`&&`cause`in e&&e.cause?Ne(e.cause,t):t?null:e}const Pe=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0;function Fe(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function Ie(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function Le(e,...t){if(!Fe(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function Re(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);Ie(e.outputLen),Ie(e.blockLen)}function ze(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Be(e,t){Le(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function Ve(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function He(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ue(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function D(e,t){return e<<32-t|e>>>t}const We=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function Ge(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Ke(e){for(let t=0;t<e.length;t++)e[t]=Ge(e[t]);return e}const qe=We?e=>e:Ke;function Je(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function Ye(e){return typeof e==`string`&&(e=Je(e)),Le(e),e}function Xe(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];Le(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var Ze=class{};function Qe(e){let t=t=>e().update(Ye(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function $e(e=32){if(Pe&&typeof Pe.getRandomValues==`function`)return Pe.getRandomValues(new Uint8Array(e));if(Pe&&typeof Pe.randomBytes==`function`)return Uint8Array.from(Pe.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}function et(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function tt(e,t,n){return e&t^~e&n}function nt(e,t,n){return e&t^e&n^t&n}var rt=class extends Ze{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Ue(this.buffer)}update(e){ze(this),e=Ye(e),Le(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Ue(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ze(this),Be(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,He(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;et(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Ue(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const it=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var at=BigInt(2**32-1),ot=BigInt(32);function st(e,t=!1){return t?{h:Number(e&at),l:Number(e>>ot&at)}:{h:Number(e>>ot&at)|0,l:Number(e&at)|0}}function ct(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=st(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var lt=(e,t,n)=>e<<n|t>>>32-n,ut=(e,t,n)=>t<<n|e>>>32-n,dt=(e,t,n)=>t<<n-32|e>>>64-n,ft=(e,t,n)=>e<<n-32|t>>>64-n,pt=BigInt(0),mt=BigInt(1),ht=BigInt(2),gt=BigInt(7),_t=BigInt(256),vt=BigInt(113),yt=[],bt=[],xt=[];for(let e=0,t=mt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],yt.push(2*(5*r+n)),bt.push((e+1)*(e+2)/2%64);let i=pt;for(let e=0;e<7;e++)t=(t<<mt^(t>>gt)*vt)%_t,t&ht&&(i^=mt<<(mt<<BigInt(e))-mt);xt.push(i)}var St=ct(xt,!0),Ct=St[0],wt=St[1],Tt=(e,t,n)=>n>32?dt(e,t,n):lt(e,t,n),Et=(e,t,n)=>n>32?ft(e,t,n):ut(e,t,n);function Dt(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=Tt(a,o,1)^n[r],c=Et(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=bt[n],a=Tt(t,i,r),o=Et(t,i,r),s=yt[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=Ct[r],e[1]^=wt[r]}He(n)}var Ot=class e extends Ze{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,Ie(n),!(0<e&&e<200))throw Error(`only keccak-f1600 function is supported`);this.state=new Uint8Array(200),this.state32=Ve(this.state)}clone(){return this._cloneInto()}keccak(){qe(this.state32),Dt(this.state32,this.rounds),qe(this.state32),this.posOut=0,this.pos=0}update(e){ze(this),e=Ye(e),Le(e);let{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){ze(this,!1),Le(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return Ie(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Be(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,He(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},kt=(e,t,n)=>Qe(()=>new Ot(t,e,n));const At=(()=>kt(1,136,256/8))();var jt=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]),Mt=new Uint32Array(64),Nt=class extends rt{constructor(e=32){super(64,e,8,!1),this.A=it[0]|0,this.B=it[1]|0,this.C=it[2]|0,this.D=it[3]|0,this.E=it[4]|0,this.F=it[5]|0,this.G=it[6]|0,this.H=it[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Mt[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Mt[e-15],n=Mt[e-2],r=D(t,7)^D(t,18)^t>>>3;Mt[e]=(D(n,17)^D(n,19)^n>>>10)+Mt[e-7]+r+Mt[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=D(o,6)^D(o,11)^D(o,25),u=l+t+tt(o,s,c)+jt[e]+Mt[e]|0,d=(D(n,2)^D(n,13)^D(n,22))+nt(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){He(Mt)}destroy(){this.set(0,0,0,0,0,0,0,0),He(this.buffer)}};const Pt=Qe(()=>new Nt);var Ft=BigInt(0),It=BigInt(1);function Lt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function Rt(e){if(!Lt(e))throw Error(`Uint8Array expected`)}function zt(e,t){if(typeof t!=`boolean`)throw Error(e+` boolean expected, got `+t)}function Bt(e){let t=e.toString(16);return t.length&1?`0`+t:t}function Vt(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?Ft:BigInt(`0x`+e)}var Ht=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Ut=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Wt(e){if(Rt(e),Ht)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Ut[e[n]];return t}var O={_0:48,_9:57,A:65,F:70,a:97,f:102};function Gt(e){if(e>=O._0&&e<=O._9)return e-O._0;if(e>=O.A&&e<=O.F)return e-(O.A-10);if(e>=O.a&&e<=O.f)return e-(O.a-10)}function Kt(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(Ht)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Gt(e.charCodeAt(i)),a=Gt(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function qt(e){return Vt(Wt(e))}function Jt(e){return Rt(e),Vt(Wt(Uint8Array.from(e).reverse()))}function Yt(e,t){return Kt(e.toString(16).padStart(t*2,`0`))}function Xt(e,t){return Yt(e,t).reverse()}function k(e,t,n){let r;if(typeof t==`string`)try{r=Kt(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(Lt(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function Zt(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];Rt(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var Qt=e=>typeof e==`bigint`&&Ft<=e;function $t(e,t,n){return Qt(e)&&Qt(t)&&Qt(n)&&t<=e&&e<n}function en(e,t,n,r){if(!$t(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function tn(e){let t;for(t=0;e>Ft;e>>=It,t+=1);return t}const nn=e=>(It<<BigInt(e))-It;var rn=e=>new Uint8Array(e),an=e=>Uint8Array.from(e);function on(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=rn(e),i=rn(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),c=(e=rn(0))=>{i=s(an([0]),e),r=s(),e.length!==0&&(i=s(an([1]),e),r=s())},l=()=>{if(a++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){r=s();let t=r.slice();n.push(t),e+=r.length}return Zt(...n)};return(e,t)=>{o(),c(e);let n;for(;!(n=t(l()));)c();return o(),n}}var sn={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||Lt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function cn(e,t,n={}){let r=(t,n,r)=>{let i=sn[n];if(typeof i!=`function`)throw Error(`invalid validator function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`param `+String(t)+` is invalid. Expected `+n+`, got `+a)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}function ln(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}function un(e,t){if(Un(e)>t)throw new Kn({givenSize:Un(e),maxSize:t})}const A={zero:48,nine:57,A:65,F:70,a:97,f:102};function dn(e){if(e>=A.zero&&e<=A.nine)return e-A.zero;if(e>=A.A&&e<=A.F)return e-(A.A-10);if(e>=A.a&&e<=A.f)return e-(A.a-10)}function fn(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new qn({size:e.length,targetSize:r,type:`Bytes`});let i=new Uint8Array(r);for(let t=0;t<r;t++){let a=n===`right`;i[a?t:r-t-1]=e[a?t:e.length-t-1]}return i}function pn(e,t){if(On(e)>t)throw new Nn({givenSize:On(e),maxSize:t})}function mn(e,t){if(typeof t==`number`&&t>0&&t>On(e)-1)throw new Pn({offset:t,position:`start`,size:On(e)})}function hn(e,t,n){if(typeof t==`number`&&typeof n==`number`&&On(e)!==n-t)throw new Pn({offset:n,position:`end`,size:On(e)})}function gn(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;let i=e.replace(`0x`,``);if(i.length>r*2)throw new Fn({size:Math.ceil(i.length/2),targetSize:r,type:`Hex`});return`0x${i[n===`right`?`padEnd`:`padStart`](r*2,`0`)}`}var _n=`#__bigint`;function vn(e,t,n){return JSON.stringify(e,(e,n)=>typeof t==`function`?t(e,n):typeof n==`bigint`?n.toString()+_n:n,n)}var yn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function bn(e,t={}){let{strict:n=!1}=t;if(!e||typeof e!=`string`)throw new jn(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith(`0x`))throw new Mn(e)}function xn(...e){return`0x${e.reduce((e,t)=>e+t.replace(`0x`,``),``)}`}function Sn(e){return e instanceof Uint8Array?Cn(e):Array.isArray(e)?Cn(new Uint8Array(e)):e}function Cn(e,t={}){let n=``;for(let t=0;t<e.length;t++)n+=yn[e[t]];let r=`0x${n}`;return typeof t.size==`number`?(pn(r,t.size),En(r,t.size)):r}function wn(e,t={}){let{signed:n,size:r}=t,i=BigInt(e),a;r?a=n?(1n<<BigInt(r)*8n-1n)-1n:2n**(BigInt(r)*8n)-1n:typeof e==`number`&&(a=BigInt(2**53-1));let o=typeof a==`bigint`&&n?-a-1n:0;if(a&&i>a||i<o){let t=typeof e==`bigint`?`n`:``;throw new An({max:a?`${a}${t}`:void 0,min:`${o}${t}`,signed:n,size:r,value:`${e}${t}`})}let s=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?Tn(s,r):s}function Tn(e,t){return gn(e,{dir:`left`,size:t})}function En(e,t){return gn(e,{dir:`right`,size:t})}function Dn(e,t,n,r={}){let{strict:i}=r;mn(e,t);let a=`0x${e.replace(`0x`,``).slice((t??0)*2,(n??e.length)*2)}`;return i&&hn(a,t,n),a}function On(e){return Math.ceil((e.length-2)/2)}function kn(e,t={}){let{strict:n=!1}=t;try{return bn(e,{strict:n}),!0}catch{return!1}}var An=class extends E{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number \`${i}\` is not in safe${r?` ${r*8}-bit`:``}${n?` signed`:` unsigned`} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Hex.IntegerOutOfRangeError`})}},jn=class extends E{constructor(e){super(`Value \`${typeof e==`object`?vn(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Hex.InvalidHexTypeError`})}},Mn=class extends E{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Hex.InvalidHexValueError`})}},Nn=class extends E{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Hex.SizeOverflowError`})}},Pn=class extends E{constructor({offset:e,position:t,size:n}){super(`Slice ${t===`start`?`starting`:`ending`} at offset \`${e}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Hex.SliceOffsetOutOfBoundsError`})}},Fn=class extends E{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Hex.SizeExceedsPaddingSizeError`})}},In=new TextEncoder;function Ln(e){if(!(e instanceof Uint8Array)&&(!e||typeof e!=`object`||!(`BYTES_PER_ELEMENT`in e)||e.BYTES_PER_ELEMENT!==1||e.constructor.name!==`Uint8Array`))throw new Gn(e)}function Rn(e){return e instanceof Uint8Array?e:typeof e==`string`?Bn(e):zn(e)}function zn(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Bn(e,t={}){let{size:n}=t,r=e;n&&(pn(e,n),r=En(e,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,o=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let n=dn(i.charCodeAt(t++)),r=dn(i.charCodeAt(t++));if(n===void 0||r===void 0)throw new E(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);o[e]=n*16+r}return o}function Vn(e,t={}){let{size:n}=t,r=In.encode(e);return typeof n==`number`?(un(r,n),Hn(r,n)):r}function Hn(e,t){return fn(e,{dir:`right`,size:t})}function Un(e){return e.length}function Wn(e){try{return Ln(e),!0}catch{return!1}}var Gn=class extends E{constructor(e){super(`Value \`${typeof e==`object`?vn(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.InvalidBytesTypeError`})}},Kn=class extends E{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeOverflowError`})}},qn=class extends E{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Bytes.SizeExceedsPaddingSizeError`})}};function Jn(e,t={}){let{as:n=typeof e==`string`?`Hex`:`Bytes`}=t,r=At(Rn(e));return n===`Bytes`?r:Cn(r)}var Yn=class extends Map{constructor(e){super(),Object.defineProperty(this,`maxSize`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}},Xn={checksum:new Yn(8192)};const Zn=Xn.checksum;function Qn(e,t={}){let{compressed:n}=t,{prefix:r,x:i,y:a}=e;if(n===!1||typeof i==`bigint`&&typeof a==`bigint`){if(r!==4)throw new ir({prefix:r,cause:new or});return}if(n===!0||typeof i==`bigint`&&a===void 0){if(r!==3&&r!==2)throw new ir({prefix:r,cause:new ar});return}throw new rr({publicKey:e})}function $n(e){let t=(()=>{if(kn(e))return tr(e);if(Wn(e))return er(e);let{prefix:t,x:n,y:r}=e;return typeof n==`bigint`&&typeof r==`bigint`?{prefix:t??4,x:n,y:r}:{prefix:t,x:n}})();return Qn(t),t}function er(e){return tr(Cn(e))}function tr(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new sr({publicKey:e});return e.length===130?{prefix:4,x:BigInt(Dn(e,0,32)),y:BigInt(Dn(e,32,64))}:e.length===132?{prefix:Number(Dn(e,0,1)),x:BigInt(Dn(e,1,33)),y:BigInt(Dn(e,33,65))}:{prefix:Number(Dn(e,0,1)),x:BigInt(Dn(e,1,33))}}function nr(e,t={}){Qn(e);let{prefix:n,x:r,y:i}=e,{includePrefix:a=!0}=t;return xn(a?wn(n,{size:1}):`0x`,wn(r,{size:32}),typeof i==`bigint`?wn(i,{size:32}):`0x`)}var rr=class extends E{constructor({publicKey:e}){super(`Value \`${vn(e)}\` is not a valid public key.`,{metaMessages:[`Public key must contain:`,"- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`PublicKey.InvalidError`})}},ir=class extends E{constructor({prefix:e,cause:t}){super(`Prefix "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`PublicKey.InvalidPrefixError`})}},ar=class extends E{constructor(){super(`Prefix must be 2 or 3 for compressed public keys.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`PublicKey.InvalidCompressedPrefixError`})}},or=class extends E{constructor(){super(`Prefix must be 4 for uncompressed public keys.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`PublicKey.InvalidUncompressedPrefixError`})}},sr=class extends E{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:[`Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).`,`Received ${On(Sn(e))} bytes.`]}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`PublicKey.InvalidSerializedSizeError`})}},cr=/^0x[a-fA-F0-9]{40}$/;function lr(e,t={}){let{strict:n=!0}=t;if(!cr.test(e))throw new pr({address:e,cause:new mr});if(n){if(e.toLowerCase()===e)return;if(ur(e)!==e)throw new pr({address:e,cause:new hr})}}function ur(e){if(Zn.has(e))return Zn.get(e);lr(e,{strict:!1});let t=e.substring(2).toLowerCase(),n=Jn(Vn(t),{as:`Bytes`}),r=t.split(``);for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());let i=`0x${r.join(``)}`;return Zn.set(e,i),i}function dr(e,t={}){let{checksum:n=!1}=t;return lr(e),n?ur(e):e}function fr(e,t={}){return dr(`0x${Jn(`0x${nr(e).slice(4)}`).substring(26)}`,t)}var pr=class extends E{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Address.InvalidAddressError`})}},mr=class extends E{constructor(){super(`Address is not a 20 byte (40 hexadecimal character) value.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Address.InvalidInputError`})}},hr=class extends E{constructor(){super(`Address does not match its checksum counterpart.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Address.InvalidChecksumError`})}},gr=class extends Ze{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Re(e);let n=Ye(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),He(i)}update(e){return ze(this),this.iHash.update(e),this}digestInto(e){ze(this),Le(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const _r=(e,t,n)=>new gr(e,t).update(n).digest();_r.create=(e,t)=>new gr(e,t);var j=BigInt(0),M=BigInt(1),vr=BigInt(2),yr=BigInt(3),br=BigInt(4),xr=BigInt(5),Sr=BigInt(8);function N(e,t){let n=e%t;return n>=j?n:t+n}function P(e,t,n){let r=e;for(;t-- >j;)r*=r,r%=n;return r}function Cr(e,t){if(e===j)throw Error(`invert: expected non-zero number`);if(t<=j)throw Error(`invert: expected positive modulus, got `+t);let n=N(e,t),r=t,i=j,a=M,o=M,s=j;for(;n!==j;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==M)throw Error(`invert: does not exist`);return N(i,t)}function wr(e,t){let n=(e.ORDER+M)/br,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw Error(`Cannot find square root`);return r}function Tr(e,t){let n=(e.ORDER-xr)/Sr,r=e.mul(t,vr),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,vr),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),t))throw Error(`Cannot find square root`);return s}function Er(e){if(e<BigInt(3))throw Error(`sqrt is not defined for small field`);let t=e-M,n=0;for(;t%vr===j;)t/=vr,n++;let r=vr,i=Pr(e);for(;Mr(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return wr;let a=i.pow(r,t),o=(t+M)/vr;return function(e,r){if(e.is0(r))return r;if(Mr(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=M<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function Dr(e){return e%br===yr?wr:e%Sr===xr?Tr:Er(e)}var Or=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function kr(e){return cn(e,Or.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function Ar(e,t,n){if(n<j)throw Error(`invalid exponent, negatives unsupported`);if(n===j)return e.ONE;if(n===M)return t;let r=e.ONE,i=t;for(;n>j;)n&M&&(r=e.mul(r,i)),i=e.sqr(i),n>>=M;return r}function jr(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function Mr(e,t){let n=(e.ORDER-M)/vr,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function Nr(e,t){t!==void 0&&Ie(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Pr(e,t,n=!1,r={}){if(e<=j)throw Error(`invalid field: expected ORDER > 0, got `+e);let{nBitLength:i,nByteLength:a}=Nr(e,t);if(a>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let o,s=Object.freeze({ORDER:e,isLE:n,BITS:i,BYTES:a,MASK:nn(i),ZERO:j,ONE:M,create:t=>N(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return j<=t&&t<e},is0:e=>e===j,isOdd:e=>(e&M)===M,neg:t=>N(-t,e),eql:(e,t)=>e===t,sqr:t=>N(t*t,e),add:(t,n)=>N(t+n,e),sub:(t,n)=>N(t-n,e),mul:(t,n)=>N(t*n,e),pow:(e,t)=>Ar(s,e,t),div:(t,n)=>N(t*Cr(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Cr(t,e),sqrt:r.sqrt||(t=>(o||=Dr(e),o(s,t))),toBytes:e=>n?Xt(e,a):Yt(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Field.fromBytes: expected `+a+` bytes, got `+e.length);return n?Jt(e):qt(e)},invertBatch:e=>jr(s,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(s)}function Fr(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function Ir(e){let t=Fr(e);return t+Math.ceil(t/2)}function Lr(e,t,n=!1){let r=e.length,i=Fr(t),a=Ir(t);if(r<16||r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=N(n?Jt(e):qt(e),t-M)+M;return n?Xt(o,i):Yt(o,i)}var Rr=BigInt(0),zr=BigInt(1);function Br(e,t){let n=t.negate();return e?n:t}function Vr(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function Hr(e,t){Vr(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:nn(e),maxNumber:i,shiftBy:BigInt(e)}}function Ur(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=zr);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function Wr(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function Gr(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}var Kr=new WeakMap,qr=new WeakMap;function Jr(e){return qr.get(e)||1}function Yr(e,t){return{constTimeNegate:Br,hasPrecomputes(e){return Jr(e)!==1},unsafeLadder(t,n,r=e.ZERO){let i=t;for(;n>Rr;)n&zr&&(r=r.add(i)),i=i.double(),n>>=zr;return r},precomputeWindow(e,n){let{windows:r,windowSize:i}=Hr(n,t),a=[],o=e,s=o;for(let e=0;e<r;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(n,r,i){let a=e.ZERO,o=e.BASE,s=Hr(n,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:n,isZero:c,isNeg:l,isNegF:u,offsetF:d}=Ur(i,e,s);i=t,c?o=o.add(Br(u,r[d])):a=a.add(Br(l,r[n]))}return{p:a,f:o}},wNAFUnsafe(n,r,i,a=e.ZERO){let o=Hr(n,t);for(let e=0;e<o.windows&&i!==Rr;e++){let{nextN:t,offset:n,isZero:s,isNeg:c}=Ur(i,e,o);if(i=t,!s){let e=r[n];a=a.add(c?e.negate():e)}}return a},getPrecomputes(e,t,n){let r=Kr.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&Kr.set(t,n(r))),r},wNAFCached(e,t,n){let r=Jr(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){let i=Jr(e);return i===1?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){Vr(n,t),qr.set(e,n),Kr.delete(e)}}}function Xr(e,t,n,r){Wr(n,e),Gr(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=tn(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=nn(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function Zr(e){return kr(e.Fp),cn(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Nr(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Qr(e){e.lowS!==void 0&&zt(`lowS`,e.lowS),e.prehash!==void 0&&zt(`prehash`,e.prehash)}function $r(e){let t=Zr(e);cn(t,{a:`field`,b:`field`},{allowInfinityPoint:`boolean`,allowedPrivateKeyLengths:`array`,clearCofactor:`function`,fromBytes:`function`,isTorsionFree:`function`,toBytes:`function`,wrapPrivateKey:`boolean`});let{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw Error(`invalid endo: CURVE.a must be 0`);if(typeof n!=`object`||typeof n.beta!=`bigint`||typeof n.splitScalar!=`function`)throw Error(`invalid endo: expected "beta": bigint and "splitScalar": function`)}return Object.freeze({...t})}var ei=class extends Error{constructor(e=``){super(e)}};const F={Err:ei,_tlv:{encode:(e,t)=>{let{Err:n}=F;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=Bt(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?Bt(i.length/2|128):``;return Bt(e)+a+i+t},decode(e,t){let{Err:n}=F,r=0;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=F;if(e<ni)throw new t(`integer: negative integers are not allowed`);let n=Bt(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=F;if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return qt(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=F,i=k(`signature`,e),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=F,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};function ti(e,t){return Wt(Yt(e,t))}var ni=BigInt(0),I=BigInt(1),ri=BigInt(2),ii=BigInt(3),ai=BigInt(4);function oi(e){let t=$r(e),{Fp:n}=t,r=Pr(t.n,t.nBitLength),i=t.toBytes||((e,t,r)=>{let i=t.toAffine();return Zt(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),a=t.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){let{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}function s(e,t){let r=n.sqr(t),i=o(e);return n.eql(r,i)}if(!s(t.Gx,t.Gy))throw Error(`bad curve params: generator point`);let c=n.mul(n.pow(t.a,ii),ai),l=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,l)))throw Error(`bad curve params: a or b`);function u(e){return $t(e,I,t.n)}function d(e){let{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&typeof e!=`bigint`){if(Lt(e)&&(e=Wt(e)),typeof e!=`string`||!n.includes(e.length))throw Error(`invalid private key`);e=e.padStart(r*2,`0`)}let o;try{o=typeof e==`bigint`?e:qt(k(`private key`,e,r))}catch{throw Error(`invalid private key, expected hex or `+r+` bytes, got `+typeof e)}return i&&(o=N(o,a)),en(`private key`,o,I,a),o}function f(e){if(!(e instanceof h))throw Error(`ProjectivePoint expected`)}let p=ln((e,t)=>{let{px:r,py:i,pz:a}=e;if(n.eql(a,n.ONE))return{x:r,y:i};let o=e.is0();t??=o?n.ONE:n.inv(a);let s=n.mul(r,t),c=n.mul(i,t),l=n.mul(a,t);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw Error(`invZ was invalid`);return{x:s,y:c}}),m=ln(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw Error(`bad point: ZERO`)}let{x:r,y:i}=e.toAffine();if(!n.isValid(r)||!n.isValid(i))throw Error(`bad point: x or y not FE`);if(!s(r,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);return!0});class h{constructor(e,t,r){if(e==null||!n.isValid(e))throw Error(`x required`);if(t==null||!n.isValid(t)||n.is0(t))throw Error(`y required`);if(r==null||!n.isValid(r))throw Error(`z required`);this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error(`invalid affine point`);if(e instanceof h)throw Error(`projective point not allowed`);let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?h.ZERO:new h(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=jr(n,e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(h.fromAffine)}static fromHex(e){let t=h.fromAffine(a(k(`pointHex`,e)));return t.assertValidity(),t}static fromPrivateKey(e){return h.BASE.multiply(d(e))}static msm(e,t){return Xr(h,r,e,t)}_setWindowSize(e){v.setWindowSize(this,e)}assertValidity(){m(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error(`Field doesn't support isOdd`)}equals(e){f(e);let{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(a,i)),l=n.eql(n.mul(r,s),n.mul(o,i));return c&&l}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:r}=t,i=n.mul(r,ii),{px:a,py:o,pz:s}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(a,a),f=n.mul(o,o),p=n.mul(s,s),m=n.mul(a,o);return m=n.add(m,m),u=n.mul(a,s),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,p),l=n.add(c,l),c=n.sub(f,l),l=n.add(f,l),l=n.mul(c,l),c=n.mul(m,c),u=n.mul(i,u),p=n.mul(e,p),m=n.sub(d,p),m=n.mul(e,m),m=n.add(m,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,p),d=n.mul(d,m),l=n.add(l,d),p=n.mul(o,s),p=n.add(p,p),d=n.mul(p,m),c=n.sub(c,d),u=n.mul(p,f),u=n.add(u,u),u=n.add(u,u),new h(c,l,u)}add(e){f(e);let{px:r,py:i,pz:a}=this,{px:o,py:s,pz:c}=e,l=n.ZERO,u=n.ZERO,d=n.ZERO,p=t.a,m=n.mul(t.b,ii),g=n.mul(r,o),_=n.mul(i,s),v=n.mul(a,c),y=n.add(r,i),b=n.add(o,s);y=n.mul(y,b),b=n.add(g,_),y=n.sub(y,b),b=n.add(r,a);let x=n.add(o,c);return b=n.mul(b,x),x=n.add(g,v),b=n.sub(b,x),x=n.add(i,a),l=n.add(s,c),x=n.mul(x,l),l=n.add(_,v),x=n.sub(x,l),d=n.mul(p,b),l=n.mul(m,v),d=n.add(l,d),l=n.sub(_,d),d=n.add(_,d),u=n.mul(l,d),_=n.add(g,g),_=n.add(_,g),v=n.mul(p,v),b=n.mul(m,b),_=n.add(_,v),v=n.sub(g,v),v=n.mul(p,v),b=n.add(b,v),g=n.mul(_,b),u=n.add(u,g),g=n.mul(x,b),l=n.mul(y,l),l=n.sub(l,g),g=n.mul(y,_),d=n.mul(x,d),d=n.add(d,g),new h(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(h.ZERO)}wNAF(e){return v.wNAFCached(this,e,h.normalizeZ)}multiplyUnsafe(e){let{endo:r,n:i}=t;en(`scalar`,e,ni,i);let a=h.ZERO;if(e===ni)return a;if(this.is0()||e===I)return this;if(!r||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,e,h.normalizeZ);let{k1neg:o,k1:s,k2neg:c,k2:l}=r.splitScalar(e),u=a,d=a,f=this;for(;s>ni||l>ni;)s&I&&(u=u.add(f)),l&I&&(d=d.add(f)),f=f.double(),s>>=I,l>>=I;return o&&(u=u.negate()),c&&(d=d.negate()),d=new h(n.mul(d.px,r.beta),d.py,d.pz),u.add(d)}multiply(e){let{endo:r,n:i}=t;en(`scalar`,e,I,i);let a,o;if(r){let{k1neg:t,k1:i,k2neg:s,k2:c}=r.splitScalar(e),{p:l,f:u}=this.wNAF(i),{p:d,f}=this.wNAF(c);l=v.constTimeNegate(t,l),d=v.constTimeNegate(s,d),d=new h(n.mul(d.px,r.beta),d.py,d.pz),a=l.add(d),o=u.add(f)}else{let{p:t,f:n}=this.wNAF(e);a=t,o=n}return h.normalizeZ([a,o])[0]}multiplyAndAddUnsafe(e,t,n){let r=h.BASE,i=(e,t)=>t===ni||t===I||!e.equals(r)?e.multiplyUnsafe(t):e.multiply(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){return p(this,e)}isTorsionFree(){let{h:e,isTorsionFree:n}=t;if(e===I)return!0;if(n)return n(h,this);throw Error(`isTorsionFree() has not been declared for the elliptic curve`)}clearCofactor(){let{h:e,clearCofactor:n}=t;return e===I?this:n?n(h,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return zt(`isCompressed`,e),this.assertValidity(),i(h,this,e)}toHex(e=!0){return zt(`isCompressed`,e),Wt(this.toRawBytes(e))}}h.BASE=new h(t.Gx,t.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);let{endo:g,nBitLength:_}=t,v=Yr(h,g?Math.ceil(_/2):_);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:d,weierstrassEquation:o,isWithinCurveOrder:u}}function si(e){let t=Zr(e);return cn(t,{hash:`hash`,hmac:`function`,randomBytes:`function`},{bits2int:`function`,bits2int_modN:`function`,lowS:`boolean`}),Object.freeze({lowS:!0,...t})}function ci(e){let t=si(e),{Fp:n,n:r,nByteLength:i,nBitLength:a}=t,o=n.BYTES+1,s=2*n.BYTES+1;function c(e){return N(e,r)}function l(e){return Cr(e,r)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:p}=oi({...t,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),o=Zt;return zt(`isCompressed`,r),r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],i=e.subarray(1);if(t===o&&(r===2||r===3)){let e=qt(i);if(!$t(e,I,n.ORDER))throw Error(`Point is not on curve`);let t=f(e),a;try{a=n.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`Point is not on curve`+t)}let o=(a&I)===I;return(r&1)==1!==o&&(a=n.neg(a)),{x:e,y:a}}else if(t===s&&r===4)return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))};else{let e=o,n=s;throw Error(`invalid Point, expected length of `+e+`, or uncompressed `+n+`, got `+t)}}});function m(e){return e>r>>I}function h(e){return m(e)?c(-e):e}let g=(e,t,n)=>qt(e.slice(t,n));class _{constructor(e,t,n){en(`r`,e,I,r),en(`s`,t,I,r),this.r=e,this.s=t,n!=null&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){let t=i;return e=k(`compactSignature`,e,t*2),new _(g(e,0,t),g(e,t,2*t))}static fromDER(e){let{r:t,s:n}=F.toSig(k(`DER`,e));return new _(t,n)}assertValidity(){}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){let{r,s:i,recovery:a}=this,o=C(k(`msgHash`,e));if(a==null||![0,1,2,3].includes(a))throw Error(`recovery id invalid`);let s=a===2||a===3?r+t.n:r;if(s>=n.ORDER)throw Error(`recovery id 2 or 3 invalid`);let d=a&1?`03`:`02`,f=u.fromHex(d+ti(s,n.BYTES)),p=l(s),m=c(-o*p),h=c(i*p),g=u.BASE.multiplyAndAddUnsafe(f,m,h);if(!g)throw Error(`point at infinify`);return g.assertValidity(),g}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Kt(this.toDERHex())}toDERHex(){return F.hexFromSig(this)}toCompactRawBytes(){return Kt(this.toCompactHex())}toCompactHex(){let e=i;return ti(this.r,e)+ti(this.s,e)}}let v={isValidPrivateKey(e){try{return d(e),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let e=Ir(t.n);return Lr(t.randomBytes(e),t.n)},precompute(e=8,t=u.BASE){return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function y(e,t=!0){return u.fromPrivateKey(e).toRawBytes(t)}function b(e){if(typeof e==`bigint`)return!1;if(e instanceof u)return!0;let r=k(`key`,e).length,a=n.BYTES,o=a+1,s=2*a+1;if(!(t.allowedPrivateKeyLengths||i===o))return r===o||r===s}function x(e,t,n=!0){if(b(e)===!0)throw Error(`first arg must be private key`);if(b(t)===!1)throw Error(`second arg must be public key`);return u.fromHex(t).multiply(d(e)).toRawBytes(n)}let S=t.bits2int||function(e){if(e.length>8192)throw Error(`input is too large`);let t=qt(e),n=e.length*8-a;return n>0?t>>BigInt(n):t},C=t.bits2int_modN||function(e){return c(S(e))},w=nn(a);function T(e){return en(`num < 2^`+a,e,ni,w),Yt(e,i)}function ee(e,r,i=te){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{hash:a,randomBytes:o}=t,{lowS:s,prehash:f,extraEntropy:g}=i;s??=!0,e=k(`msgHash`,e),Qr(i),f&&(e=k(`prehashed msgHash`,a(e)));let v=C(e),y=d(r),b=[T(y),T(v)];if(g!=null&&g!==!1){let e=g===!0?o(n.BYTES):g;b.push(k(`extraEntropy`,e))}let x=Zt(...b),w=v;function ee(e){let t=S(e);if(!p(t))return;let n=l(t),r=u.BASE.multiply(t).toAffine(),i=c(r.x);if(i===ni)return;let a=c(n*c(w+i*y));if(a===ni)return;let o=(r.x===i?0:2)|Number(r.y&I),d=a;return s&&m(a)&&(d=h(a),o^=1),new _(i,d,o)}return{seed:x,k2sig:ee}}let te={lowS:t.lowS,prehash:!1},ne={lowS:t.lowS,prehash:!1};function re(e,n,r=te){let{seed:i,k2sig:a}=ee(e,n,r),o=t;return on(o.hash.outputLen,o.nByteLength,o.hmac)(i,a)}u.BASE._setWindowSize(8);function ie(e,n,r,i=ne){let a=e;n=k(`msgHash`,n),r=k(`publicKey`,r);let{lowS:o,prehash:s,format:d}=i;if(Qr(i),`strict`in i)throw Error(`options.strict was renamed to lowS`);if(d!==void 0&&d!==`compact`&&d!==`der`)throw Error(`format must be compact or der`);let f=typeof a==`string`||Lt(a),p=!f&&!d&&typeof a==`object`&&!!a&&typeof a.r==`bigint`&&typeof a.s==`bigint`;if(!f&&!p)throw Error(`invalid signature, expected Uint8Array, hex string or Signature instance`);let m,h;try{if(p&&(m=new _(a.r,a.s)),f){try{d!==`compact`&&(m=_.fromDER(a))}catch(e){if(!(e instanceof F.Err))throw e}!m&&d!==`der`&&(m=_.fromCompact(a))}h=u.fromHex(r)}catch{return!1}if(!m||o&&m.hasHighS())return!1;s&&(n=t.hash(n));let{r:g,s:v}=m,y=C(n),b=l(v),x=c(y*b),S=c(g*b),w=u.BASE.multiplyAndAddUnsafe(h,x,S)?.toAffine();return w?c(w.x)===g:!1}return{CURVE:t,getPublicKey:y,getSharedSecret:x,sign:re,verify:ie,ProjectivePoint:u,Signature:_,utils:v}}function li(e){return{hash:e,hmac:(t,...n)=>_r(e,t,Xe(...n)),randomBytes:$e}}function ui(e,t){let n=t=>ci({...e,...li(t)});return{...n(t),create:n}}var di=BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),fi=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),pi=BigInt(0),mi=BigInt(1),hi=BigInt(2),gi=(e,t)=>(e+t/hi)/t;function _i(e){let t=di,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=P(P(P(u,n,t)*u%t,n,t)*u%t,hi,t)*l%t,f=P(d,i,t)*d%t,p=P(f,a,t)*f%t,m=P(p,s,t)*p%t,h=P(P(P(P(P(P(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,hi,t);if(!vi.eql(vi.sqr(h),e))throw Error(`Cannot find square root`);return h}var vi=Pr(di,void 0,void 0,{sqrt:_i});const yi=ui({a:pi,b:BigInt(7),Fp:vi,n:fi,Gx:BigInt(`55066263022277343669578718895168534326250603453777594175500187360389116729240`),Gy:BigInt(`32670510020758816978083085130507043184471273380659243275938904335757337482424`),h:BigInt(1),lowS:!0,endo:{beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),splitScalar:e=>{let t=fi,n=BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),r=-mi*BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`),i=BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),a=n,o=BigInt(`0x100000000000000000000000000000000`),s=gi(a*e,t),c=gi(-r*e,t),l=N(e-s*n-c*i,t),u=N(-s*r-c*a,t),d=l>o,f=u>o;if(d&&(l=t-l),f&&(u=t-u),l>o||u>o)throw Error(`splitScalar: Endomorphism failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},Pt);function bi(e){if(e.length!==130&&e.length!==132)throw new Si({signature:e});let t=BigInt(Dn(e,0,32)),n=BigInt(Dn(e,32,64)),r=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return xi(t)}catch{throw new Ci({value:t})}})();return r===void 0?{r:t,s:n}:{r:t,s:n,yParity:r}}function xi(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2==0?1:0;throw new wi({value:e})}var Si=class extends E{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:[`Expected: 64 bytes or 65 bytes.`,`Received ${On(Sn(e))} bytes.`]}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidSerializedSizeError`})}},Ci=class extends E{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidYParityError`})}},wi=class extends E{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:`Signature.InvalidVError`})}};function Ti(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function Ei(e,...t){if(!Ti(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function Di(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(e=>typeof e==`string`):t.every(e=>Number.isSafeInteger(e)):!1}function Oi(e){if(typeof e!=`function`)throw Error(`function expected`);return!0}function ki(e,t){if(typeof t!=`string`)throw Error(`${e}: string expected`);return!0}function Ai(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function ji(e){if(!Array.isArray(e))throw Error(`array expected`)}function Mi(e,t){if(!Di(!0,t))throw Error(`${e}: array of strings expected`)}function Ni(e,t){if(!Di(!1,t))throw Error(`${e}: array of numbers expected`)}function L(...e){let t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function R(e){let t=typeof e==`string`?e.split(``):e,n=t.length;Mi(`alphabet`,t);let r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(ji(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(ji(t),t.map(t=>{ki(`alphabet.decode`,t);let n=r.get(t);if(n===void 0)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function z(e=``){return ki(`join`,e),{encode:t=>(Mi(`join.decode`,t),t.join(e)),decode:t=>(ki(`join.decode`,t),t.split(e))}}function Pi(e,t=`=`){return Ai(e),ki(`padding`,t),{encode(n){for(Mi(`padding.encode`,n);n.length*e%8;)n.push(t);return n},decode(n){Mi(`padding.decode`,n);let r=n.length;if(r*e%8)throw Error(`padding: invalid, string should have whole number of bytes`);for(;r>0&&n[r-1]===t;r--)if((r-1)*e%8==0)throw Error(`padding: invalid, string has too much padding`);return n.slice(0,r)}}}function Fi(e){return Oi(e),{encode:e=>e,decode:t=>e(t)}}var Ii=(e,t)=>t===0?e:Ii(t,e%t),Li=(e,t)=>e+(t-Ii(e,t)),Ri=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function zi(e,t,n,r){if(ji(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw Error(`convertRadix2: wrong to=${n}`);if(Li(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${Li(t,n)}`);let i=0,a=0,o=Ri[t],s=Ri[n]-1,c=[];for(let r of e){if(Ai(r),r>=o)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)c.push((i>>a-n&s)>>>0);let e=Ri[a];if(e===void 0)throw Error(`invalid carry`);i&=e-1}if(i=i<<n-a&s,!r&&a>=t)throw Error(`Excess padding`);if(!r&&i>0)throw Error(`Non-zero padding: ${i}`);return r&&a>0&&c.push(i>>>0),c}function B(e,t=!1){if(Ai(e),e<=0||e>32)throw Error(`radix2: bits should be in (0..32]`);if(Li(8,e)>32||Li(e,8)>32)throw Error(`radix2: carry overflow`);return{encode:n=>{if(!Ti(n))throw Error(`radix2.encode input should be Uint8Array`);return zi(Array.from(n),8,e,!t)},decode:n=>(Ni(`radix2.decode`,n),Uint8Array.from(zi(n,e,8,t)))}}function Bi(e){return Oi(e),function(...t){try{return e.apply(null,t)}catch{}}}const Vi=L(B(4),R(`0123456789ABCDEF`),z(``)),Hi=L(B(5),R(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),Pi(5),z(``)),Ui=L(B(5),R(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),z(``)),Wi=L(B(5),R(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),Pi(5),z(``)),Gi=L(B(5),R(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),z(``)),Ki=L(B(5),R(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`),z(``),Fi(e=>e.toUpperCase().replace(/O/g,`0`).replace(/[IL]/g,`1`)));var qi=(()=>typeof Uint8Array.from([]).toBase64==`function`&&typeof Uint8Array.fromBase64==`function`)(),Ji=(e,t)=>{ki(`base64`,e);let n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?`base64url`:`base64`;if(e.length>0&&!n.test(e))throw Error(`invalid base64`);return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:`strict`})};const Yi=qi?{encode(e){return Ei(e),e.toBase64()},decode(e){return Ji(e,!1)}}:L(B(6),R(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),Pi(6),z(``)),Xi=L(B(6),R(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),z(``)),Zi=qi?{encode(e){return Ei(e),e.toBase64({alphabet:`base64url`})},decode(e){return Ji(e,!0)}}:L(B(6),R(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),Pi(6),z(``)),Qi=L(B(6),R(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),z(``));var $i=L(R(`qpzry9x8gf2tvdw0s3jn54khce6mua7l`),z(``)),ea=[996825010,642813549,513874426,1027748829,705979059];function ta(e){let t=e>>25,n=(e&33554431)<<5;for(let e=0;e<ea.length;e++)(t>>e&1)==1&&(n^=ea[e]);return n}function na(e,t,n=1){let r=e.length,i=1;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n<33||n>126)throw Error(`Invalid prefix (${e})`);i=ta(i)^n>>5}i=ta(i);for(let t=0;t<r;t++)i=ta(i)^e.charCodeAt(t)&31;for(let e of t)i=ta(i)^e;for(let e=0;e<6;e++)i=ta(i);return i^=n,$i.encode(zi([i%Ri[30]],30,5,!1))}function ra(e){let t=e===`bech32`?1:734539939,n=B(5),r=n.decode,i=n.encode,a=Bi(r);function o(e,n,r=90){ki(`bech32.encode prefix`,e),Ti(n)&&(n=Array.from(n)),Ni(`bech32.encode`,n);let i=e.length;if(i===0)throw TypeError(`Invalid prefix length ${i}`);let a=i+7+n.length;if(r!==!1&&a>r)throw TypeError(`Length ${a} exceeds limit ${r}`);let o=e.toLowerCase(),s=na(o,n,t);return`${o}1${$i.encode(n)}${s}`}function s(e,n=90){ki(`bech32.decode input`,e);let r=e.length;if(r<8||n!==!1&&r>n)throw TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);let i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw Error(`String must be lowercase or uppercase`);let a=i.lastIndexOf(`1`);if(a===0||a===-1)throw Error(`Letter "1" must be present between prefix and data only`);let o=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw Error(`Data must be at least 6 characters long`);let c=$i.decode(s).slice(0,-6),l=na(o,c,t);if(!s.endsWith(l))throw Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:o,words:c}}let c=Bi(s);function l(e){let{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}}function u(e,t){return o(e,i(t))}return{encode:o,decode:s,encodeFromBytes:u,decodeToBytes:l,decodeUnsafe:c,fromWords:r,fromWordsUnsafe:a,toWords:i}}const ia=ra(`bech32`),aa=ra(`bech32m`);var oa=(()=>typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`)(),sa={encode(e){return Ei(e),e.toHex()},decode(e){return ki(`hex`,e),Uint8Array.fromHex(e)}};const ca=oa?sa:L(B(4),R(`0123456789abcdef`),z(``),Fi(e=>{if(typeof e!=`string`||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));function la(e){return fr(ua(e))}function ua(e){let{payload:t,signature:n}=e,{r,s:i,yParity:a}=n;return $n(new yi.Signature(BigInt(r),BigInt(i)).addRecoveryBit(a).recoverPublicKey(Sn(t).substring(2)))}function da(e){if(e.length>=255)throw TypeError(`Alphabet too long`);let t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let n=0;n<e.length;n++){let r=e.charAt(n),i=r.charCodeAt(0);if(t[i]!==255)throw TypeError(r+` is ambiguous`);t[i]=n}let n=e.length,r=e.charAt(0),i=Math.log(n)/Math.log(256),a=Math.log(256)/Math.log(n);function o(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError(`Expected Uint8Array`);if(t.length===0)return``;let i=0,o=0,s=0,c=t.length;for(;s!==c&&t[s]===0;)s++,i++;let l=(c-s)*a+1>>>0,u=new Uint8Array(l);for(;s!==c;){let e=t[s],r=0;for(let t=l-1;(e!==0||r<o)&&t!==-1;t--,r++)e+=256*u[t]>>>0,u[t]=e%n>>>0,e=e/n>>>0;if(e!==0)throw Error(`Non-zero carry`);o=r,s++}let d=l-o;for(;d!==l&&u[d]===0;)d++;let f=r.repeat(i);for(;d<l;++d)f+=e.charAt(u[d]);return f}function s(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;let a=0,o=0,s=0;for(;e[a]===r;)o++,a++;let c=(e.length-a)*i+1>>>0,l=new Uint8Array(c);for(;a<e.length;){let r=e.charCodeAt(a);if(r>255)return;let i=t[r];if(i===255)return;let o=0;for(let e=c-1;(i!==0||o<s)&&e!==-1;e--,o++)i+=n*l[e]>>>0,l[e]=i%256>>>0,i=i/256>>>0;if(i!==0)throw Error(`Non-zero carry`);s=o,a++}let u=c-s;for(;u!==c&&l[u]===0;)u++;let d=new Uint8Array(o+(c-u)),f=o;for(;u!==c;)d[f++]=l[u++];return d}function c(e){let t=s(e);if(t)return t;throw Error(`Non-base`+n+` character`)}return{encode:o,decodeUnsafe:s,decode:c}}var fa=da,pa=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,ma=fa(pa);function ha(e){let t=e.length,n=0,r=0;for(;r<t;){let i=e.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<t){let t=e.charCodeAt(r);(t&64512)==56320&&(++r,i=((i&1023)<<10)+(t&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function ga(e,t,n){let r=e.length,i=n,a=0;for(;a<r;){let n=e.charCodeAt(a++);if(n&4294967168)if(!(n&4294965248))t[i++]=n>>6&31|192;else{if(n>=55296&&n<=56319&&a<r){let t=e.charCodeAt(a);(t&64512)==56320&&(++a,n=((n&1023)<<10)+(t&1023)+65536)}n&4294901760?(t[i++]=n>>18&7|240,t[i++]=n>>12&63|128,t[i++]=n>>6&63|128):(t[i++]=n>>12&15|224,t[i++]=n>>6&63|128)}else{t[i++]=n;continue}t[i++]=n&63|128}}var _a=new TextEncoder,va=50;function ya(e,t,n){_a.encodeInto(e,t.subarray(n))}function ba(e,t,n){e.length>va?ya(e,t,n):ga(e,t,n)}var xa=4096;function Sa(e,t,n){let r=t,i=r+n,a=[],o=``;for(;r<i;){let t=e[r++];if(!(t&128))a.push(t);else if((t&224)==192){let n=e[r++]&63;a.push((t&31)<<6|n)}else if((t&240)==224){let n=e[r++]&63,i=e[r++]&63;a.push((t&31)<<12|n<<6|i)}else if((t&248)==240){let n=e[r++]&63,i=e[r++]&63,o=e[r++]&63,s=(t&7)<<18|n<<12|i<<6|o;s>65535&&(s-=65536,a.push(s>>>10&1023|55296),s=56320|s&1023),a.push(s)}else a.push(t);a.length>=xa&&(o+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(o+=String.fromCharCode(...a)),o}var Ca=new TextDecoder,wa=200;function Ta(e,t,n){let r=e.subarray(t,t+n);return Ca.decode(r)}function Ea(e,t,n){return n>wa?Ta(e,t,n):Sa(e,t,n)}var Da=class{constructor(e,t){this.type=e,this.data=t}},V=class e extends Error{constructor(t){super(t);let n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,`name`,{configurable:!0,enumerable:!1,value:e.name})}};const Oa=4294967295;function ka(e,t,n){let r=n/4294967296,i=n;e.setUint32(t,r),e.setUint32(t+4,i)}function Aa(e,t,n){let r=Math.floor(n/4294967296),i=n;e.setUint32(t,r),e.setUint32(t+4,i)}function ja(e,t){let n=e.getInt32(t),r=e.getUint32(t+4);return n*4294967296+r}function Ma(e,t){let n=e.getUint32(t),r=e.getUint32(t+4);return n*4294967296+r}const Na=-1;var Pa=4294967295,Fa=17179869183;function Ia({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=Fa)if(t===0&&e<=Pa){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}else{let n=e/4294967296,r=e&4294967295,i=new Uint8Array(8),a=new DataView(i.buffer);return a.setUint32(0,t<<2|n&3),a.setUint32(4,r),i}else{let n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),Aa(r,4,e),n}}function La(e){let t=e.getTime(),n=Math.floor(t/1e3),r=(t-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function Ra(e){return e instanceof Date?Ia(La(e)):null}function za(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{let e=t.getUint32(0),n=t.getUint32(4);return{sec:(e&3)*4294967296+n,nsec:e>>>2}}case 12:return{sec:ja(t,4),nsec:t.getUint32(0)};default:throw new V(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function Ba(e){let t=za(e);return new Date(t.sec*1e3+t.nsec/1e6)}const Va={type:-1,encode:Ra,decode:Ba};var Ha=class{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Va)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{let r=-1-e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){let r=this.builtInEncoders[n];if(r!=null){let i=r(e,t);if(i!=null)return new Da(-1-n,i)}}for(let n=0;n<this.encoders.length;n++){let r=this.encoders[n];if(r!=null){let i=r(e,t);if(i!=null)return new Da(n,i)}}return e instanceof Da?e:null}decode(e,t,n){let r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,n):new Da(t,e)}};Ha.defaultCodec=new Ha;function Ua(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer}function Wa(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Ua(e)?new Uint8Array(e):Uint8Array.from(e)}const Ga=100,Ka=2048;var qa=class e{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??Ha.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??100,this.initialBufferSize=e?.initialBufferSize??2048,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e==`boolean`?this.encodeBoolean(e):typeof e==`number`?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e==`string`?this.encodeString(e):this.useBigInt64&&typeof e==`bigint`?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){let t=new ArrayBuffer(e),n=new Uint8Array(t),r=new DataView(t);n.set(this.bytes),this.view=r,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let t=ha(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),ba(e,this.bytes,this.pos),this.pos+=t}encodeObject(e,t){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e==`object`)this.encodeMap(e,t);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw Error(`Too large binary: ${t}`);let n=Wa(e);this.writeU8a(n)}encodeArray(e,t){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw Error(`Too large array: ${n}`);for(let n of e)this.doEncode(n,t+1)}countWithoutUndefined(e,t){let n=0;for(let r of t)e[r]!==void 0&&n++;return n}encodeMap(e,t){let n=Object.keys(e);this.sortKeys&&n.sort();let r=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else if(r<4294967296)this.writeU8(223),this.writeU32(r);else throw Error(`Too large map object: ${r}`);for(let r of n){let n=e[r];this.ignoreUndefined&&n===void 0||(this.encodeString(r),this.doEncode(n,t+1))}}encodeExtension(e){if(typeof e.data==`function`){let t=e.data(this.pos+6),n=t.length;if(n>=4294967296)throw Error(`Too large extension object: ${n}`);this.writeU8(201),this.writeU32(n),this.writeI8(e.type),this.writeU8a(t);return}let t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),ka(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Aa(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function Ja(e,t){return new qa(t).encodeSharedRef(e)}function Ya(e){return`${e<0?`-`:``}0x${Math.abs(e).toString(16).padStart(2,`0`)}`}var Xa=16,Za=16,Qa=class{constructor(e=Xa,t=Za){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){let r=this.caches[n-1];FIND_CHUNK:for(let i of r){let r=i.bytes;for(let i=0;i<n;i++)if(r[i]!==e[t+i])continue FIND_CHUNK;return i.str}return null}store(e,t){let n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){let r=this.find(e,t,n);if(r!=null)return this.hit++,r;this.miss++;let i=Sa(e,t,n),a=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(a,i),i}},$a=`array`,eo=`map_key`,to=`map_value`,no=e=>{if(typeof e==`string`||typeof e==`number`)return e;throw new V(`The type of key must be string or number but `+typeof e)},ro=class{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=$a,t.position=0,t.size=e,t.array=Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=eo,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw Error(`Invalid stack state. Released state is not on top of the stack.`);if(e.type===$a){let t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===eo||e.type===to){let t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},io=-1,ao=new DataView(new ArrayBuffer(0)),oo=new Uint8Array(ao.buffer);try{ao.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw Error(`This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access`)}var so=RangeError(`Insufficient data`),co=new Qa,lo=class e{constructor(e){this.totalPos=0,this.pos=0,this.view=ao,this.bytes=oo,this.headByte=io,this.stack=new ro,this.entered=!1,this.extensionCodec=e?.extensionCodec??Ha.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder===void 0?co:e.keyDecoder,this.mapKeyConverter=e?.mapKeyConverter??no}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=io,this.stack.reset()}setBuffer(e){let t=Wa(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===io&&!this.hasRemaining(1))this.setBuffer(e);else{let t=this.bytes.subarray(this.pos),n=Wa(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:n}=this;return RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,n;for await(let r of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(r);try{n=this.doDecodeSync(),t=!0}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:r,pos:i,totalPos:a}=this;throw RangeError(`Insufficient data in parsing ${Ya(r)} at ${a} (${i} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let n=t,r=-1;for await(let i of e){if(t&&r===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),n&&(r=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--r!==0;);}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){DECODE:for(;;){let e=this.readHeadByte(),t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){let n=e-128;if(n!==0){this.pushMapState(n),this.complete();continue DECODE}else t={}}else if(e<160){let n=e-144;if(n!==0){this.pushArrayState(n),this.complete();continue DECODE}else t=[]}else{let n=e-160;t=this.decodeString(n,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(e===217){let e=this.lookU8();t=this.decodeString(e,1)}else if(e===218){let e=this.lookU16();t=this.decodeString(e,2)}else if(e===219){let e=this.lookU32();t=this.decodeString(e,4)}else if(e===220){let e=this.readU16();if(e!==0){this.pushArrayState(e),this.complete();continue DECODE}else t=[]}else if(e===221){let e=this.readU32();if(e!==0){this.pushArrayState(e),this.complete();continue DECODE}else t=[]}else if(e===222){let e=this.readU16();if(e!==0){this.pushMapState(e),this.complete();continue DECODE}else t={}}else if(e===223){let e=this.readU32();if(e!==0){this.pushMapState(e),this.complete();continue DECODE}else t={}}else if(e===196){let e=this.lookU8();t=this.decodeBinary(e,1)}else if(e===197){let e=this.lookU16();t=this.decodeBinary(e,2)}else if(e===198){let e=this.lookU32();t=this.decodeBinary(e,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){let e=this.lookU8();t=this.decodeExtension(e,1)}else if(e===200){let e=this.lookU16();t=this.decodeExtension(e,2)}else if(e===201){let e=this.lookU32();t=this.decodeExtension(e,4)}else throw new V(`Unrecognized type byte: ${Ya(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let e=n.top();if(e.type===$a)if(e.array[e.position]=t,e.position++,e.position===e.size)t=e.array,n.release(e);else continue DECODE;else if(e.type===eo){if(t===`__proto__`)throw new V(`The key __proto__ is not allowed`);e.key=this.mapKeyConverter(t),e.type=to;continue DECODE}else if(e.map[e.key]=t,e.readCount++,e.readCount===e.size)t=e.map,n.release(e);else{e.key=null,e.type=eo;continue DECODE}}return t}}readHeadByte(){return this.headByte===io&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=io}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new V(`Unrecognized array type byte: ${Ya(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new V(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new V(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new V(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw so;let n=this.pos+t,r;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):Ea(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===eo:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new V(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw so;let n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new V(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=Ma(this.view,this.pos);return this.pos+=8,e}readI64(){let e=ja(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function uo(e,t){return new lo(t).decode(e)}var fo=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString()+`n`:t),po=e=>{let t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,`$1"$2n"$3`);return JSON.parse(t,(e,t)=>typeof t==`string`&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)};function mo(e){if(typeof e!=`string`)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return po(e)}catch{return e}}function ho(e){return typeof e==`string`?e:fo(e)||``}var go=Oe();function _o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function vo(e,...t){if(!_o(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function yo(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function bo(e,t){vo(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}var xo=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0,So=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function Co(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got `+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function wo(e){return typeof e==`string`&&(e=Co(e)),vo(e),e}var To=class{clone(){return this._cloneInto()}};function Eo(e){let t=t=>e().update(wo(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Do(e=32){if(xo&&typeof xo.getRandomValues==`function`)return xo.getRandomValues(new Uint8Array(e));if(xo&&typeof xo.randomBytes==`function`)return xo.randomBytes(e);throw Error(`crypto.getRandomValues must be defined`)}function Oo(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var ko=class extends To{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=So(this.buffer)}update(e){yo(this);let{view:t,buffer:n,blockLen:r}=this;e=wo(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=So(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){yo(this),bo(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Oo(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=So(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},Ao=BigInt(2**32-1),jo=BigInt(32);function Mo(e,t=!1){return t?{h:Number(e&Ao),l:Number(e>>jo&Ao)}:{h:Number(e>>jo&Ao)|0,l:Number(e&Ao)|0}}function No(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:o}=Mo(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}var Po=(e,t)=>BigInt(e>>>0)<<jo|BigInt(t>>>0),Fo=(e,t,n)=>e>>>n,Io=(e,t,n)=>e<<32-n|t>>>n,Lo=(e,t,n)=>e>>>n|t<<32-n,Ro=(e,t,n)=>e<<32-n|t>>>n,zo=(e,t,n)=>e<<64-n|t>>>n-32,Bo=(e,t,n)=>e>>>n-32|t<<64-n,Vo=(e,t)=>t,Ho=(e,t)=>e,Uo=(e,t,n)=>e<<n|t>>>32-n,Wo=(e,t,n)=>t<<n|e>>>32-n,Go=(e,t,n)=>t<<n-32|e>>>64-n,Ko=(e,t,n)=>e<<n-32|t>>>64-n;function qo(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Jo=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Yo=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Xo=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Zo=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,Qo=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),$o=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,H={fromBig:Mo,split:No,toBig:Po,shrSH:Fo,shrSL:Io,rotrSH:Lo,rotrSL:Ro,rotrBH:zo,rotrBL:Bo,rotr32H:Vo,rotr32L:Ho,rotlSH:Uo,rotlSL:Wo,rotlBH:Go,rotlBL:Ko,add:qo,add3L:Jo,add3H:Yo,add4L:Xo,add4H:Zo,add5H:$o,add5L:Qo},[es,ts]=(()=>H.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`.split(`.`).map(e=>BigInt(e))))(),ns=new Uint32Array(80),rs=new Uint32Array(80),is=class extends ko{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)ns[n]=e.getUint32(t),rs[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=ns[e-15]|0,n=rs[e-15]|0,r=H.rotrSH(t,n,1)^H.rotrSH(t,n,8)^H.shrSH(t,n,7),i=H.rotrSL(t,n,1)^H.rotrSL(t,n,8)^H.shrSL(t,n,7),a=ns[e-2]|0,o=rs[e-2]|0,s=H.rotrSH(a,o,19)^H.rotrBH(a,o,61)^H.shrSH(a,o,6),c=H.rotrSL(a,o,19)^H.rotrBL(a,o,61)^H.shrSL(a,o,6),l=H.add4L(i,c,rs[e-7],rs[e-16]);ns[e]=H.add4H(l,r,s,ns[e-7],ns[e-16])|0,rs[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=H.rotrSH(u,d,14)^H.rotrSH(u,d,18)^H.rotrBH(u,d,41),v=H.rotrSL(u,d,14)^H.rotrSL(u,d,18)^H.rotrBL(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=H.add5L(_,v,b,ts[e],rs[e]),S=H.add5H(x,g,t,y,es[e],ns[e]),C=x|0,w=H.rotrSH(n,r,28)^H.rotrBH(n,r,34)^H.rotrBH(n,r,39),T=H.rotrSL(n,r,28)^H.rotrBL(n,r,34)^H.rotrBL(n,r,39),ee=n&i^n&o^i&o,te=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=H.add(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let ne=H.add3L(C,T,te);n=H.add3H(ne,S,w,ee),r=ne|0}({h:n,l:r}=H.add(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=H.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=H.add(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=H.add(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=H.add(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=H.add(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=H.add(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=H.add(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){ns.fill(0),rs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},as=Eo(()=>new is),os=BigInt(0),ss=BigInt(1),cs=BigInt(2);function ls(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function us(e){if(!ls(e))throw Error(`Uint8Array expected`)}function ds(e,t){if(typeof t!=`boolean`)throw Error(e+` boolean expected, got `+t)}var fs=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ps(e){us(e);let t=``;for(let n=0;n<e.length;n++)t+=fs[e[n]];return t}function ms(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?os:BigInt(`0x`+e)}var hs={_0:48,_9:57,A:65,F:70,a:97,f:102};function gs(e){if(e>=hs._0&&e<=hs._9)return e-hs._0;if(e>=hs.A&&e<=hs.F)return e-(hs.A-10);if(e>=hs.a&&e<=hs.f)return e-(hs.a-10)}function _s(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=gs(e.charCodeAt(i)),a=gs(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function vs(e){return ms(ps(e))}function ys(e){return us(e),ms(ps(Uint8Array.from(e).reverse()))}function bs(e,t){return _s(e.toString(16).padStart(t*2,`0`))}function xs(e,t){return bs(e,t).reverse()}function Ss(e,t,n){let r;if(typeof t==`string`)try{r=_s(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(ls(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function Cs(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];us(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var ws=e=>typeof e==`bigint`&&os<=e;function Ts(e,t,n){return ws(e)&&ws(t)&&ws(n)&&t<=e&&e<n}function Es(e,t,n,r){if(!Ts(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function Ds(e){let t;for(t=0;e>os;e>>=ss,t+=1);return t}var Os=e=>(cs<<BigInt(e-1))-ss,ks={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||ls(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function As(e,t,n={}){let r=(t,n,r)=>{let i=ks[n];if(typeof i!=`function`)throw Error(`invalid validator function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`param `+String(t)+` is invalid. Expected `+n+`, got `+a)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}function js(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}var U=BigInt(0),W=BigInt(1),Ms=BigInt(2),Ns=BigInt(3),Ps=BigInt(4),Fs=BigInt(5),Is=BigInt(8);function G(e,t){let n=e%t;return n>=U?n:t+n}function Ls(e,t,n){if(t<U)throw Error(`invalid exponent, negatives unsupported`);if(n<=U)throw Error(`invalid modulus`);if(n===W)return U;let r=W;for(;t>U;)t&W&&(r=r*e%n),e=e*e%n,t>>=W;return r}function K(e,t,n){let r=e;for(;t-- >U;)r*=r,r%=n;return r}function Rs(e,t){if(e===U)throw Error(`invert: expected non-zero number`);if(t<=U)throw Error(`invert: expected positive modulus, got `+t);let n=G(e,t),r=t,i=U,a=W;for(;n!==U;){let e=r/n,t=r%n,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==W)throw Error(`invert: does not exist`);return G(i,t)}function zs(e){let t=(e-W)/Ms,n,r,i;for(n=e-W,r=0;n%Ms===U;n/=Ms,r++);for(i=Ms;i<e&&Ls(i,t,e)!==e-W;i++)if(i>1e3)throw Error(`Cannot find square root: likely non-prime P`);if(r===1){let t=(e+W)/Ps;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}let a=(n+W)/Ms;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw Error(`Cannot find square root`);let s=r,c=e.pow(e.mul(e.ONE,i),n),l=e.pow(o,a),u=e.pow(o,n);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(u);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let n=e.pow(c,W<<BigInt(s-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),s=t}return l}}function Bs(e){if(e%Ps===Ns){let t=(e+W)/Ps;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}if(e%Is===Fs){let t=(e-Fs)/Is;return function(e,n){let r=e.mul(n,Ms),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,Ms),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),n))throw Error(`Cannot find square root`);return s}}return zs(e)}var Vs=(e,t)=>(G(e,t)&W)===W,Hs=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Us(e){return As(e,Hs.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function Ws(e,t,n){if(n<U)throw Error(`invalid exponent, negatives unsupported`);if(n===U)return e.ONE;if(n===W)return t;let r=e.ONE,i=t;for(;n>U;)n&W&&(r=e.mul(r,i)),i=e.sqr(i),n>>=W;return r}function Gs(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function Ks(e,t){let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function qs(e,t,n=!1,r={}){if(e<=U)throw Error(`invalid field: expected ORDER > 0, got `+e);let{nBitLength:i,nByteLength:a}=Ks(e,t);if(a>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let o,s=Object.freeze({ORDER:e,isLE:n,BITS:i,BYTES:a,MASK:Os(i),ZERO:U,ONE:W,create:t=>G(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return U<=t&&t<e},is0:e=>e===U,isOdd:e=>(e&W)===W,neg:t=>G(-t,e),eql:(e,t)=>e===t,sqr:t=>G(t*t,e),add:(t,n)=>G(t+n,e),sub:(t,n)=>G(t-n,e),mul:(t,n)=>G(t*n,e),pow:(e,t)=>Ws(s,e,t),div:(t,n)=>G(t*Rs(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Rs(t,e),sqrt:r.sqrt||(t=>(o||=Bs(e),o(s,t))),invertBatch:e=>Gs(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?xs(e,a):bs(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Field.fromBytes: expected `+a+` bytes, got `+e.length);return n?ys(e):vs(e)}});return Object.freeze(s)}var Js=BigInt(0),Ys=BigInt(1);function Xs(e,t){let n=t.negate();return e?n:t}function Zs(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function Qs(e,t){return Zs(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function $s(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function ec(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}var tc=new WeakMap,nc=new WeakMap;function rc(e){return nc.get(e)||1}function ic(e,t){return{constTimeNegate:Xs,hasPrecomputes(e){return rc(e)!==1},unsafeLadder(t,n,r=e.ZERO){let i=t;for(;n>Js;)n&Ys&&(r=r.add(i)),i=i.double(),n>>=Ys;return r},precomputeWindow(e,n){let{windows:r,windowSize:i}=Qs(n,t),a=[],o=e,s=o;for(let e=0;e<r;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(n,r,i){let{windows:a,windowSize:o}=Qs(n,t),s=e.ZERO,c=e.BASE,l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let e=0;e<a;e++){let t=e*o,n=Number(i&l);i>>=d,n>o&&(n-=u,i+=Ys);let a=t,f=t+Math.abs(n)-1,p=e%2!=0,m=n<0;n===0?c=c.add(Xs(p,r[a])):s=s.add(Xs(m,r[f]))}return{p:s,f:c}},wNAFUnsafe(n,r,i,a=e.ZERO){let{windows:o,windowSize:s}=Qs(n,t),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let e=0;e<o;e++){let t=e*s;if(i===Js)break;let n=Number(i&c);if(i>>=u,n>s&&(n-=l,i+=Ys),n===0)continue;let o=r[t+Math.abs(n)-1];n<0&&(o=o.negate()),a=a.add(o)}return a},getPrecomputes(e,t,n){let r=tc.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&tc.set(t,n(r))),r},wNAFCached(e,t,n){let r=rc(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){let i=rc(e);return i===1?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){Zs(n,t),nc.set(e,n),tc.delete(e)}}}function ac(e,t,n,r){if($s(n,e),ec(r,t),n.length!==r.length)throw Error(`arrays of points and scalars must have equal length`);let i=e.ZERO,a=Ds(BigInt(n.length)),o=a>12?a-3:a>4?a-2:a?2:1,s=(1<<o)-1,c=Array(s+1).fill(i),l=Math.floor((t.BITS-1)/o)*o,u=i;for(let e=l;e>=0;e-=o){c.fill(i);for(let t=0;t<r.length;t++){let i=r[t],a=Number(i>>BigInt(e)&BigInt(s));c[a]=c[a].add(n[t])}let t=i;for(let e=c.length-1,n=i;e>0;e--)n=n.add(c[e]),t=t.add(n);if(u=u.add(t),e!==0)for(let e=0;e<o;e++)u=u.double()}return u}function oc(e){return Us(e.Fp),As(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Ks(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var q=BigInt(0),J=BigInt(1),sc=BigInt(2),cc=BigInt(8),lc={zip215:!0};function uc(e){let t=oc(e);return As(e,{hash:`function`,a:`bigint`,d:`bigint`,randomBytes:`function`},{adjustScalarBytes:`function`,domain:`function`,uvRatio:`function`,mapToCurve:`function`}),Object.freeze({...t})}function dc(e){let t=uc(e),{Fp:n,n:r,prehash:i,hash:a,randomBytes:o,nByteLength:s,h:c}=t,l=sc<<BigInt(s*8)-J,u=n.create,d=qs(t.n,t.nBitLength),f=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch{return{isValid:!1,value:q}}}),p=t.adjustScalarBytes||(e=>e),m=t.domain||((e,t,n)=>{if(ds(`phflag`,n),t.length||n)throw Error(`Contexts/pre-hash are not supported`);return e});function h(e,t){Es(`coordinate `+e,t,q,l)}function g(e){if(!(e instanceof y))throw Error(`ExtendedPoint expected`)}let _=js((e,t)=>{let{ex:r,ey:i,ez:a}=e,o=e.is0();t??=o?cc:n.inv(a);let s=u(r*t),c=u(i*t),l=u(a*t);if(o)return{x:q,y:J};if(l!==J)throw Error(`invZ was invalid`);return{x:s,y:c}}),v=js(e=>{let{a:n,d:r}=t;if(e.is0())throw Error(`bad point: ZERO`);let{ex:i,ey:a,ez:o,et:s}=e,c=u(i*i),l=u(a*a),d=u(o*o),f=u(d*d);if(u(d*u(u(c*n)+l))!==u(f+u(r*u(c*l))))throw Error(`bad point: equation left != right (1)`);if(u(i*a)!==u(o*s))throw Error(`bad point: equation left != right (2)`);return!0});class y{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,h(`x`,e),h(`y`,t),h(`z`,n),h(`t`,r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof y)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return h(`x`,t),h(`y`,n),new y(t,n,J,u(t*n))}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.ez));return e.map((e,n)=>e.toAffine(t[n])).map(y.fromAffine)}static msm(e,t){return ac(y,d,e,t)}_setWindowSize(e){S.setWindowSize(this,e)}assertValidity(){v(this)}equals(e){g(e);let{ex:t,ey:n,ez:r}=this,{ex:i,ey:a,ez:o}=e,s=u(t*o),c=u(i*r),l=u(n*o),d=u(a*r);return s===c&&l===d}is0(){return this.equals(y.ZERO)}negate(){return new y(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:e}=t,{ex:n,ey:r,ez:i}=this,a=u(n*n),o=u(r*r),s=u(sc*u(i*i)),c=u(e*a),l=n+r,d=u(u(l*l)-a-o),f=c+o,p=f-s,m=c-o,h=u(d*p),g=u(f*m),_=u(d*m);return new y(h,g,u(p*f),_)}add(e){g(e);let{a:n,d:r}=t,{ex:i,ey:a,ez:o,et:s}=this,{ex:c,ey:l,ez:d,et:f}=e;if(n===BigInt(-1)){let e=u((a-i)*(l+c)),t=u((a+i)*(l-c)),n=u(t-e);if(n===q)return this.double();let r=u(o*sc*f),p=u(s*sc*d),m=p+r,h=t+e,g=p-r,_=u(m*n),v=u(h*g),b=u(m*g);return new y(_,v,u(n*h),b)}let p=u(i*c),m=u(a*l),h=u(s*r*f),_=u(o*d),v=u((i+a)*(c+l)-p-m),b=_-h,x=_+h,S=u(m-n*p),C=u(v*b),w=u(x*S),T=u(v*S);return new y(C,w,u(b*x),T)}subtract(e){return this.add(e.negate())}wNAF(e){return S.wNAFCached(this,e,y.normalizeZ)}multiply(e){let t=e;Es(`scalar`,t,J,r);let{p:n,f:i}=this.wNAF(t);return y.normalizeZ([n,i])[0]}multiplyUnsafe(e,t=y.ZERO){let n=e;return Es(`scalar`,n,q,r),n===q?x:this.is0()||n===J?this:S.wNAFCachedUnsafe(this,n,y.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return S.unsafeLadder(this,r).is0()}toAffine(e){return _(this,e)}clearCofactor(){let{h:e}=t;return e===J?this:this.multiplyUnsafe(e)}static fromHex(e,r=!1){let{d:i,a}=t,o=n.BYTES;e=Ss(`pointHex`,e,o),ds(`zip215`,r);let s=e.slice(),c=e[o-1];s[o-1]=c&-129;let d=ys(s);Es(`pointHex.y`,d,q,r?l:n.ORDER);let p=u(d*d),{isValid:m,value:h}=f(u(p-J),u(i*p-a));if(!m)throw Error(`Point.fromHex: invalid y coordinate`);let g=(h&J)===J,_=(c&128)!=0;if(!r&&h===q&&_)throw Error(`Point.fromHex: x=0 and x_0=1`);return _!==g&&(h=u(-h)),y.fromAffine({x:h,y:d})}static fromPrivateKey(e){return T(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),r=xs(t,n.BYTES);return r[r.length-1]|=e&J?128:0,r}toHex(){return ps(this.toRawBytes())}}y.BASE=new y(t.Gx,t.Gy,J,u(t.Gx*t.Gy)),y.ZERO=new y(q,J,J,q);let{BASE:b,ZERO:x}=y,S=ic(y,s*8);function C(e){return G(e,r)}function w(e){return C(ys(e))}function T(e){let t=n.BYTES;e=Ss(`private key`,e,t);let r=Ss(`hashed private key`,a(e),2*t),i=p(r.slice(0,t)),o=r.slice(t,2*t),s=w(i),c=b.multiply(s);return{head:i,prefix:o,scalar:s,point:c,pointBytes:c.toRawBytes()}}function ee(e){return T(e).pointBytes}function te(e=new Uint8Array,...t){return w(a(m(Cs(...t),Ss(`context`,e),!!i)))}function ne(e,t,a={}){e=Ss(`message`,e),i&&(e=i(e));let{prefix:o,scalar:s,pointBytes:c}=T(t),l=te(a.context,o,e),u=b.multiply(l).toRawBytes(),d=C(l+te(a.context,u,c,e)*s);return Es(`signature.s`,d,q,r),Ss(`result`,Cs(u,xs(d,n.BYTES)),n.BYTES*2)}let re=lc;function ie(e,t,r,a=re){let{context:o,zip215:s}=a,c=n.BYTES;e=Ss(`signature`,e,2*c),t=Ss(`message`,t),r=Ss(`publicKey`,r,c),s!==void 0&&ds(`zip215`,s),i&&(t=i(t));let l=ys(e.slice(c,2*c)),u,d,f;try{u=y.fromHex(r,s),d=y.fromHex(e.slice(0,c),s),f=b.multiplyUnsafe(l)}catch{return!1}if(!s&&u.isSmallOrder())return!1;let p=te(o,d.toRawBytes(),u.toRawBytes(),t);return d.add(u.multiplyUnsafe(p)).subtract(f).clearCofactor().equals(y.ZERO)}return b._setWindowSize(8),{CURVE:t,getPublicKey:ee,sign:ne,verify:ie,ExtendedPoint:y,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>o(n.BYTES),precompute(e=8,t=y.BASE){return t._setWindowSize(e),t.multiply(BigInt(3)),t}}}}var fc=BigInt(`57896044618658097711785492504343953926634992332820282019728792003956564819949`),pc=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`),mc=BigInt(1),hc=BigInt(2),gc=BigInt(5),_c=BigInt(8);function vc(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=fc,o=e*e%a*e%a,s=K(K(o,hc,a)*o%a,mc,a)*e%a,c=K(s,gc,a)*s%a,l=K(c,t,a)*c%a,u=K(l,n,a)*l%a,d=K(u,r,a)*u%a;return{pow_p_5_8:K(K(K(K(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,hc,a)*e%a,b2:o}}function yc(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function bc(e,t){let n=fc,r=G(t*t*t,n),i=vc(e*G(r*r*t,n)).pow_p_5_8,a=G(e*r*i,n),o=G(t*a*a,n),s=a,c=G(a*pc,n),l=o===e,u=o===G(-e,n),d=o===G(-e*pc,n);return l&&(a=s),(u||d)&&(a=c),Vs(a,n)&&(a=G(-a,n)),{isValid:l||u,value:a}}var xc=(()=>qs(fc,void 0,!0))(),Sc=(()=>({a:BigInt(-1),d:BigInt(`37095705934669439343138083508754565189542113879843219016388785533085940283555`),Fp:xc,n:BigInt(`7237005577332262213973186563042994240857116359379907606001950938285454250989`),h:_c,Gx:BigInt(`15112221349535400772501151409588531511454012693041857206046113283949847762202`),Gy:BigInt(`46316835694926478169428394003475163141307993866256225615783033603165251855960`),hash:as,randomBytes:Do,adjustScalarBytes:yc,uvRatio:bc}))(),Cc=(()=>dc(Sc))(),wc=`EdDSA`,Tc=`JWT`,Ec=`.`,Dc=`base64url`,Oc=`utf8`,kc=`utf8`,Ac=`:`,jc=`did`,Mc=`key`,Nc=`base58btc`,Pc=`z`,Fc=`K36`,Ic=32,Lc=32;function Rc(e){return globalThis.Buffer==null?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function zc(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Rc(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Bc(e,t){t||=e.reduce((e,t)=>e+t.length,0);let n=zc(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return Rc(n)}function Vc(e,t){if(e.length>=255)throw TypeError(`Alphabet too long`);for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(n[o]!==255)throw TypeError(a+` is ambiguous`);n[o]=i}var s=e.length,c=e.charAt(0),l=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function d(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError(`Expected Uint8Array`);if(t.length===0)return``;for(var n=0,r=0,i=0,a=t.length;i!==a&&t[i]===0;)i++,n++;for(var o=(a-i)*u+1>>>0,l=new Uint8Array(o);i!==a;){for(var d=t[i],f=0,p=o-1;(d!==0||f<r)&&p!==-1;p--,f++)d+=256*l[p]>>>0,l[p]=d%s>>>0,d=d/s>>>0;if(d!==0)throw Error(`Non-zero carry`);r=f,i++}for(var m=o-r;m!==o&&l[m]===0;)m++;for(var h=c.repeat(n);m<o;++m)h+=e.charAt(l[m]);return h}function f(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;var t=0;if(e[t]!==` `){for(var r=0,i=0;e[t]===c;)r++,t++;for(var a=(e.length-t)*l+1>>>0,o=new Uint8Array(a);e[t];){var u=n[e.charCodeAt(t)];if(u===255)return;for(var d=0,f=a-1;(u!==0||d<i)&&f!==-1;f--,d++)u+=s*o[f]>>>0,o[f]=u%256>>>0,u=u/256>>>0;if(u!==0)throw Error(`Non-zero carry`);i=d,t++}if(e[t]!==` `){for(var p=a-i;p!==a&&o[p]===0;)p++;for(var m=new Uint8Array(r+(a-p)),h=r;p!==a;)m[h++]=o[p++];return m}}}function p(e){var n=f(e);if(n)return n;throw Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:f,decode:p}}var Hc=Vc,Uc=e=>{if(e instanceof Uint8Array&&e.constructor.name===`Uint8Array`)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error(`Unknown type, must be binary type`)},Wc=e=>new TextEncoder().encode(e),Gc=e=>new TextDecoder().decode(e),Kc=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error(`Unknown type, must be binary type`)}},qc=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw Error(`Invalid prefix character`);this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e==`string`){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error(`Can only multibase decode strings`)}or(e){return Yc(this,e)}},Jc=class{constructor(e){this.decoders=e}or(e){return Yc(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Yc=(e,t)=>new Jc({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),Xc=class{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Kc(e,t,n),this.decoder=new qc(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Zc=({name:e,prefix:t,encode:n,decode:r})=>new Xc(e,t,n,r),Qc=({prefix:e,name:t,alphabet:n})=>{let{encode:r,decode:i}=Hc(n,t);return Zc({prefix:e,name:t,encode:r,decode:e=>Uc(i(e))})},$c=(e,t,n,r)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let a=e.length;for(;e[a-1]===`=`;)--a;let o=new Uint8Array(a*n/8|0),s=0,c=0,l=0;for(let t=0;t<a;++t){let a=i[e[t]];if(a===void 0)throw SyntaxError(`Non-${r} character`);c=c<<n|a,s+=n,s>=8&&(s-=8,o[l++]=255&c>>s)}if(s>=n||255&c<<8-s)throw SyntaxError(`Unexpected end of data`);return o},el=(e,t,n)=>{let r=t[t.length-1]===`=`,i=(1<<n)-1,a=``,o=0,s=0;for(let r=0;r<e.length;++r)for(s=s<<8|e[r],o+=8;o>n;)o-=n,a+=t[i&s>>o];if(o&&(a+=t[i&s<<n-o]),r)for(;a.length*n&7;)a+=`=`;return a},Y=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>Zc({prefix:t,name:e,encode(e){return el(e,r,n)},decode(t){return $c(t,r,n,e)}}),tl=Zc({prefix:`\0`,name:`identity`,encode:e=>Gc(e),decode:e=>Wc(e)}),nl=Object.freeze({__proto__:null,identity:tl}),rl=Y({prefix:`0`,name:`base2`,alphabet:`01`,bitsPerChar:1}),il=Object.freeze({__proto__:null,base2:rl}),al=Y({prefix:`7`,name:`base8`,alphabet:`01234567`,bitsPerChar:3}),ol=Object.freeze({__proto__:null,base8:al}),sl=Qc({prefix:`9`,name:`base10`,alphabet:`0123456789`}),cl=Object.freeze({__proto__:null,base10:sl}),ll=Y({prefix:`f`,name:`base16`,alphabet:`0123456789abcdef`,bitsPerChar:4}),ul=Y({prefix:`F`,name:`base16upper`,alphabet:`0123456789ABCDEF`,bitsPerChar:4}),dl=Object.freeze({__proto__:null,base16:ll,base16upper:ul}),fl=Y({prefix:`b`,name:`base32`,alphabet:`abcdefghijklmnopqrstuvwxyz234567`,bitsPerChar:5}),pl=Y({prefix:`B`,name:`base32upper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,bitsPerChar:5}),ml=Y({prefix:`c`,name:`base32pad`,alphabet:`abcdefghijklmnopqrstuvwxyz234567=`,bitsPerChar:5}),hl=Y({prefix:`C`,name:`base32padupper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=`,bitsPerChar:5}),gl=Y({prefix:`v`,name:`base32hex`,alphabet:`0123456789abcdefghijklmnopqrstuv`,bitsPerChar:5}),_l=Y({prefix:`V`,name:`base32hexupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV`,bitsPerChar:5}),vl=Y({prefix:`t`,name:`base32hexpad`,alphabet:`0123456789abcdefghijklmnopqrstuv=`,bitsPerChar:5}),yl=Y({prefix:`T`,name:`base32hexpadupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV=`,bitsPerChar:5}),bl=Y({prefix:`h`,name:`base32z`,alphabet:`ybndrfg8ejkmcpqxot1uwisza345h769`,bitsPerChar:5}),xl=Object.freeze({__proto__:null,base32:fl,base32upper:pl,base32pad:ml,base32padupper:hl,base32hex:gl,base32hexupper:_l,base32hexpad:vl,base32hexpadupper:yl,base32z:bl}),Sl=Qc({prefix:`k`,name:`base36`,alphabet:`0123456789abcdefghijklmnopqrstuvwxyz`}),Cl=Qc({prefix:`K`,name:`base36upper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`}),wl=Object.freeze({__proto__:null,base36:Sl,base36upper:Cl}),Tl=Qc({name:`base58btc`,prefix:`z`,alphabet:`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`}),El=Qc({name:`base58flickr`,prefix:`Z`,alphabet:`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`}),Dl=Object.freeze({__proto__:null,base58btc:Tl,base58flickr:El}),Ol=Y({prefix:`m`,name:`base64`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,bitsPerChar:6}),kl=Y({prefix:`M`,name:`base64pad`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,bitsPerChar:6}),Al=Y({prefix:`u`,name:`base64url`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,bitsPerChar:6}),jl=Y({prefix:`U`,name:`base64urlpad`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=`,bitsPerChar:6}),Ml=Object.freeze({__proto__:null,base64:Ol,base64pad:kl,base64url:Al,base64urlpad:jl}),Nl=Array.from(`🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂`),Pl=Nl.reduce((e,t,n)=>(e[n]=t,e),[]),Fl=Nl.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function Il(e){return e.reduce((e,t)=>(e+=Pl[t],e),``)}function Ll(e){let t=[];for(let n of e){let e=Fl[n.codePointAt(0)];if(e===void 0)throw Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}var Rl=Zc({prefix:`🚀`,name:`base256emoji`,encode:Il,decode:Ll}),zl=Object.freeze({__proto__:null,base256emoji:Rl}),Bl=Wl,Vl=128,Hl=-128,Ul=2**31;function Wl(e,t,n){t||=[],n||=0;for(var r=n;e>=Ul;)t[n++]=e&255|Vl,e/=128;for(;e&Hl;)t[n++]=e&255|Vl,e>>>=7;return t[n]=e|0,Wl.bytes=n-r+1,t}var Gl=Jl,Kl=128,ql=127;function Jl(e,t){var n=0,t=t||0,r=0,i=t,a,o=e.length;do{if(i>=o)throw Jl.bytes=0,RangeError(`Could not decode varint`);a=e[i++],n+=r<28?(a&ql)<<r:(a&ql)*2**r,r+=7}while(a>=Kl);return Jl.bytes=i-t,n}var Yl=2**7,Xl=2**14,Zl=2**21,Ql=2**28,$l=2**35,eu=2**42,tu=2**49,nu=2**56,ru=2**63,iu=function(e){return e<Yl?1:e<Xl?2:e<Zl?3:e<Ql?4:e<$l?5:e<eu?6:e<tu?7:e<nu?8:e<ru?9:10},au={encode:Bl,decode:Gl,encodingLength:iu},ou=(e,t,n=0)=>(au.encode(e,t,n),t),su=e=>au.encodingLength(e),cu=(e,t)=>{let n=t.byteLength,r=su(e),i=r+su(n),a=new Uint8Array(i+n);return ou(e,a,0),ou(n,a,r),a.set(t,i),new lu(e,n,t,a)},lu=class{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}},uu=({name:e,code:t,encode:n})=>new du(e,t,n),du=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?cu(this.code,t):t.then(e=>cu(this.code,e))}else throw Error(`Unknown type, must be binary type`)}},fu=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),pu=uu({name:`sha2-256`,code:18,encode:fu(`SHA-256`)}),mu=uu({name:`sha2-512`,code:19,encode:fu(`SHA-512`)}),hu=Object.freeze({__proto__:null,sha256:pu,sha512:mu}),gu=0,_u=`identity`,vu=Uc,yu=e=>cu(gu,vu(e)),bu={code:gu,name:_u,encode:vu,digest:yu},xu=Object.freeze({__proto__:null,identity:bu});new TextEncoder,new TextDecoder;var Su={...nl,...il,...ol,...cl,...dl,...xl,...wl,...Dl,...Ml,...zl};({...hu,...xu});function Cu(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}var wu=Cu(`utf8`,`u`,e=>`u`+new TextDecoder(`utf8`).decode(e),e=>new TextEncoder().encode(e.substring(1))),Tu=Cu(`ascii`,`a`,e=>{let t=`a`;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);let t=zc(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),Eu={utf8:wu,"utf-8":wu,hex:Su.base16,latin1:Tu,ascii:Tu,binary:Tu,...Su};function Du(e,t=`utf8`){let n=Eu[t];if(!n)throw Error(`Unsupported encoding "${t}"`);return(t===`utf8`||t===`utf-8`)&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`):n.encoder.encode(e).substring(1)}function Ou(e,t=`utf8`){let n=Eu[t];if(!n)throw Error(`Unsupported encoding "${t}"`);return(t===`utf8`||t===`utf-8`)&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Rc(globalThis.Buffer.from(e,`utf-8`)):n.decoder.decode(`${n.prefix}${e}`)}function ku(e){return mo(Du(Ou(e,Dc),Oc))}function Au(e){return Du(Ou(ho(e),Oc),Dc)}function ju(e){return[`did`,`key`,`z`+Du(Bc([Ou(`K36`,Nc),e]),Nc)].join(`:`)}function Mu(e){return Du(e,Dc)}function Nu(e){return Ou(e,Dc)}function Pu(e){return Ou([Au(e.header),Au(e.payload)].join(`.`),kc)}function Fu(e){return[Au(e.header),Au(e.payload),Mu(e.signature)].join(`.`)}function Iu(e){let t=e.split(`.`);return{header:ku(t[0]),payload:ku(t[1]),signature:Nu(t[2]),data:Ou(t.slice(0,2).join(`.`),kc)}}function Lu(e=Do(32)){let t=Cc.getPublicKey(e);return{secretKey:Bc([e,t]),publicKey:t}}async function Ru(e,t,n,r,i=(0,go.fromMiliseconds)(Date.now())){let a={alg:wc,typ:`JWT`},o={iss:ju(r.publicKey),sub:e,aud:t,iat:i,exp:i+n},s=Pu({header:a,payload:o});return Fu({header:a,payload:o,signature:Cc.sign(s,r.secretKey.slice(0,32))})}function zu(e){return globalThis.Buffer==null?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Bu(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?zu(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Vu(e,t){t||=e.reduce((e,t)=>e+t.length,0);let n=Bu(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return zu(n)}function Hu(e,t){if(e.length>=255)throw TypeError(`Alphabet too long`);for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(n[o]!==255)throw TypeError(a+` is ambiguous`);n[o]=i}var s=e.length,c=e.charAt(0),l=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function d(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError(`Expected Uint8Array`);if(t.length===0)return``;for(var n=0,r=0,i=0,a=t.length;i!==a&&t[i]===0;)i++,n++;for(var o=(a-i)*u+1>>>0,l=new Uint8Array(o);i!==a;){for(var d=t[i],f=0,p=o-1;(d!==0||f<r)&&p!==-1;p--,f++)d+=256*l[p]>>>0,l[p]=d%s>>>0,d=d/s>>>0;if(d!==0)throw Error(`Non-zero carry`);r=f,i++}for(var m=o-r;m!==o&&l[m]===0;)m++;for(var h=c.repeat(n);m<o;++m)h+=e.charAt(l[m]);return h}function f(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;var t=0;if(e[t]!==` `){for(var r=0,i=0;e[t]===c;)r++,t++;for(var a=(e.length-t)*l+1>>>0,o=new Uint8Array(a);e[t];){var u=n[e.charCodeAt(t)];if(u===255)return;for(var d=0,f=a-1;(u!==0||d<i)&&f!==-1;f--,d++)u+=s*o[f]>>>0,o[f]=u%256>>>0,u=u/256>>>0;if(u!==0)throw Error(`Non-zero carry`);i=d,t++}if(e[t]!==` `){for(var p=a-i;p!==a&&o[p]===0;)p++;for(var m=new Uint8Array(r+(a-p)),h=r;p!==a;)m[h++]=o[p++];return m}}}function p(e){var n=f(e);if(n)return n;throw Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:f,decode:p}}var Uu=Hu,Wu=Uu,Gu=new Uint8Array,Ku=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},qu=e=>{if(e instanceof Uint8Array&&e.constructor.name===`Uint8Array`)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error(`Unknown type, must be binary type`)},Ju=e=>new TextEncoder().encode(e),Yu=e=>new TextDecoder().decode(e),Xu=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error(`Unknown type, must be binary type`)}},Zu=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw Error(`Invalid prefix character`);this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e==`string`){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error(`Can only multibase decode strings`)}or(e){return $u(this,e)}},Qu=class{constructor(e){this.decoders=e}or(e){return $u(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const $u=(e,t)=>new Qu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});var ed=class{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Xu(e,t,n),this.decoder=new Zu(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const td=({name:e,prefix:t,encode:n,decode:r})=>new ed(e,t,n,r),nd=({prefix:e,name:t,alphabet:n})=>{let{encode:r,decode:i}=Wu(n,t);return td({prefix:e,name:t,encode:r,decode:e=>qu(i(e))})};var rd=(e,t,n,r)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let a=e.length;for(;e[a-1]===`=`;)--a;let o=new Uint8Array(a*n/8|0),s=0,c=0,l=0;for(let t=0;t<a;++t){let a=i[e[t]];if(a===void 0)throw SyntaxError(`Non-${r} character`);c=c<<n|a,s+=n,s>=8&&(s-=8,o[l++]=255&c>>s)}if(s>=n||255&c<<8-s)throw SyntaxError(`Unexpected end of data`);return o},id=(e,t,n)=>{let r=t[t.length-1]===`=`,i=(1<<n)-1,a=``,o=0,s=0;for(let r=0;r<e.length;++r)for(s=s<<8|e[r],o+=8;o>n;)o-=n,a+=t[i&s>>o];if(o&&(a+=t[i&s<<n-o]),r)for(;a.length*n&7;)a+=`=`;return a};const X=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>td({prefix:t,name:e,encode(e){return id(e,r,n)},decode(t){return rd(t,r,n,e)}});var ad=e.r({identity:()=>od});const od=td({prefix:`\0`,name:`identity`,encode:e=>Yu(e),decode:e=>Ju(e)});var sd=e.r({base2:()=>cd});const cd=X({prefix:`0`,name:`base2`,alphabet:`01`,bitsPerChar:1});var ld=e.r({base8:()=>ud});const ud=X({prefix:`7`,name:`base8`,alphabet:`01234567`,bitsPerChar:3});var dd=e.r({base10:()=>fd});const fd=nd({prefix:`9`,name:`base10`,alphabet:`0123456789`});var pd=e.r({base16:()=>md,base16upper:()=>hd});const md=X({prefix:`f`,name:`base16`,alphabet:`0123456789abcdef`,bitsPerChar:4}),hd=X({prefix:`F`,name:`base16upper`,alphabet:`0123456789ABCDEF`,bitsPerChar:4});var gd=e.r({base32:()=>_d,base32hex:()=>xd,base32hexpad:()=>Cd,base32hexpadupper:()=>wd,base32hexupper:()=>Sd,base32pad:()=>yd,base32padupper:()=>bd,base32upper:()=>vd,base32z:()=>Td});const _d=X({prefix:`b`,name:`base32`,alphabet:`abcdefghijklmnopqrstuvwxyz234567`,bitsPerChar:5}),vd=X({prefix:`B`,name:`base32upper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,bitsPerChar:5}),yd=X({prefix:`c`,name:`base32pad`,alphabet:`abcdefghijklmnopqrstuvwxyz234567=`,bitsPerChar:5}),bd=X({prefix:`C`,name:`base32padupper`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=`,bitsPerChar:5}),xd=X({prefix:`v`,name:`base32hex`,alphabet:`0123456789abcdefghijklmnopqrstuv`,bitsPerChar:5}),Sd=X({prefix:`V`,name:`base32hexupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV`,bitsPerChar:5}),Cd=X({prefix:`t`,name:`base32hexpad`,alphabet:`0123456789abcdefghijklmnopqrstuv=`,bitsPerChar:5}),wd=X({prefix:`T`,name:`base32hexpadupper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUV=`,bitsPerChar:5}),Td=X({prefix:`h`,name:`base32z`,alphabet:`ybndrfg8ejkmcpqxot1uwisza345h769`,bitsPerChar:5});var Ed=e.r({base36:()=>Dd,base36upper:()=>Od});const Dd=nd({prefix:`k`,name:`base36`,alphabet:`0123456789abcdefghijklmnopqrstuvwxyz`}),Od=nd({prefix:`K`,name:`base36upper`,alphabet:`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`});var kd=e.r({base58btc:()=>Ad,base58flickr:()=>jd});const Ad=nd({name:`base58btc`,prefix:`z`,alphabet:`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`}),jd=nd({name:`base58flickr`,prefix:`Z`,alphabet:`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`});var Md=e.r({base64:()=>Nd,base64pad:()=>Pd,base64url:()=>Fd,base64urlpad:()=>Id});const Nd=X({prefix:`m`,name:`base64`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,bitsPerChar:6}),Pd=X({prefix:`M`,name:`base64pad`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,bitsPerChar:6}),Fd=X({prefix:`u`,name:`base64url`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,bitsPerChar:6}),Id=X({prefix:`U`,name:`base64urlpad`,alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=`,bitsPerChar:6});var Ld=e.r({base256emoji:()=>Ud}),Rd=Array.from(`🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂`),zd=Rd.reduce((e,t,n)=>(e[n]=t,e),[]),Bd=Rd.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function Vd(e){return e.reduce((e,t)=>(e+=zd[t],e),``)}function Hd(e){let t=[];for(let n of e){let e=Bd[n.codePointAt(0)];if(e===void 0)throw Error(`Non-base256emoji character: ${n}`);t.push(e)}return new Uint8Array(t)}const Ud=td({prefix:`🚀`,name:`base256emoji`,encode:Vd,decode:Hd});var Wd=Jd,Gd=128,Kd=-128,qd=2**31;function Jd(e,t,n){t||=[],n||=0;for(var r=n;e>=qd;)t[n++]=e&255|Gd,e/=128;for(;e&Kd;)t[n++]=e&255|Gd,e>>>=7;return t[n]=e|0,Jd.bytes=n-r+1,t}var Yd=Qd,Xd=128,Zd=127;function Qd(e,t){var n=0,t=t||0,r=0,i=t,a,o=e.length;do{if(i>=o)throw Qd.bytes=0,RangeError(`Could not decode varint`);a=e[i++],n+=r<28?(a&Zd)<<r:(a&Zd)*2**r,r+=7}while(a>=Xd);return Qd.bytes=i-t,n}var $d=2**7,ef=2**14,tf=2**21,nf=2**28,rf=2**35,af=2**42,of=2**49,sf=2**56,cf=2**63,lf=function(e){return e<$d?1:e<ef?2:e<tf?3:e<nf?4:e<rf?5:e<af?6:e<of?7:e<sf?8:e<cf?9:10},uf={encode:Wd,decode:Yd,encodingLength:lf},df=uf;const ff=(e,t=0)=>[df.decode(e,t),df.decode.bytes],pf=(e,t,n=0)=>(df.encode(e,t,n),t),mf=e=>df.encodingLength(e),hf=(e,t)=>{let n=t.byteLength,r=mf(e),i=r+mf(n),a=new Uint8Array(i+n);return pf(e,a,0),pf(n,a,r),a.set(t,i),new vf(e,n,t,a)},gf=e=>{let t=qu(e),[n,r]=ff(t),[i,a]=ff(t.subarray(r)),o=t.subarray(r+a);if(o.byteLength!==i)throw Error(`Incorrect length`);return new vf(n,i,o,t)},_f=(e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&Ku(e.bytes,t.bytes);var vf=class{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};const yf=({name:e,code:t,encode:n})=>new bf(e,t,n);var bf=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?hf(this.code,t):t.then(e=>hf(this.code,e))}else throw Error(`Unknown type, must be binary type`)}},xf=e.r({sha256:()=>Cf,sha512:()=>wf}),Sf=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));const Cf=yf({name:`sha2-256`,code:18,encode:Sf(`SHA-256`)}),wf=yf({name:`sha2-512`,code:19,encode:Sf(`SHA-512`)});var Tf=e.r({identity:()=>Af}),Ef=0,Df=`identity`,Of=qu,kf=e=>hf(Ef,Of(e));const Af={code:Ef,name:Df,encode:Of,digest:kf};var jf=new TextEncoder,Mf=new TextDecoder,Nf=class e{constructor(e,t,n,r){this.code=t,this.version=e,this.multihash=n,this.bytes=r,this.byteOffset=r.byteOffset,this.byteLength=r.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Hf,byteLength:Hf,code:Vf,version:Vf,multihash:Vf,bytes:Vf,_baseCache:Hf,asCID:Hf})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:n}=this;if(t!==Lf)throw Error(`Cannot convert a non dag-pb CID to CIDv0`);if(n.code!==Rf)throw Error(`Cannot convert non sha2-256 multihash CID to CIDv0`);return e.createV0(n)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:n}=this.multihash,r=hf(t,n);return e.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&_f(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:r}=this;switch(n){case 0:return Ff(t,r,e||Ad.encoder);default:return If(t,r,e||_d.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return`CID`}[Symbol.for(`nodejs.util.inspect.custom`)](){return`CID(`+this.toString()+`)`}static isCID(e){return Wf(/^0\.0/,Gf),!!(e&&(e[Bf]||e.asCID===e))}get toBaseEncodedString(){throw Error(`Deprecated, use .toString()`)}get codec(){throw Error(`"codec" property is deprecated, use integer "code" property instead`)}get buffer(){throw Error(`Deprecated .buffer property, use .bytes to get Uint8Array instead`)}get multibaseName(){throw Error(`"multibaseName" property is deprecated`)}get prefix(){throw Error(`"prefix" property is deprecated`)}static asCID(t){if(t instanceof e)return t;if(t!=null&&t.asCID===t){let{version:n,code:r,multihash:i,bytes:a}=t;return new e(n,r,i,a||zf(n,r,i.bytes))}else if(t!=null&&t[Bf]===!0){let{version:n,multihash:r,code:i}=t,a=gf(r);return e.create(n,i,a)}else return null}static create(t,n,r){if(typeof n!=`number`)throw Error(`String codecs are no longer supported`);switch(t){case 0:if(n!==Lf)throw Error(`Version 0 CID must use dag-pb (code: ${Lf}) block encoding`);return new e(t,n,r,r.bytes);case 1:return new e(t,n,r,zf(t,n,r.bytes));default:throw Error(`Invalid version`)}}static createV0(t){return e.create(0,Lf,t)}static createV1(t,n){return e.create(1,t,n)}static decode(t){let[n,r]=e.decodeFirst(t);if(r.length)throw Error(`Incorrect length`);return n}static decodeFirst(t){let n=e.inspectBytes(t),r=n.size-n.multihashSize,i=qu(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw Error(`Incorrect length`);let a=i.subarray(n.multihashSize-n.digestSize),o=new vf(n.multihashCode,n.digestSize,a,i);return[n.version===0?e.createV0(o):e.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(e){let t=0,n=()=>{let[n,r]=ff(e.subarray(t));return t+=r,n},r=n(),i=Lf;if(r===18?(r=0,t=0):r===1&&(i=n()),r!==0&&r!==1)throw RangeError(`Invalid CID version ${r}`);let a=t,o=n(),s=n(),c=t+s,l=c-a;return{version:r,codec:i,multihashCode:o,digestSize:s,multihashSize:l,size:c}}static parse(t,n){let[r,i]=Pf(t,n),a=e.decode(i);return a._baseCache.set(r,t),a}},Pf=(e,t)=>{switch(e[0]){case`Q`:{let n=t||Ad;return[Ad.prefix,n.decode(`${Ad.prefix}${e}`)]}case Ad.prefix:{let n=t||Ad;return[Ad.prefix,n.decode(e)]}case _d.prefix:{let n=t||_d;return[_d.prefix,n.decode(e)]}default:if(t==null)throw Error(`To parse non base32 or base58btc encoded CID multibase decoder must be provided`);return[e[0],t.decode(e)]}},Ff=(e,t,n)=>{let{prefix:r}=n;if(r!==Ad.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let i=n.encode(e).slice(1);return t.set(r,i),i}else return i},If=(e,t,n)=>{let{prefix:r}=n,i=t.get(r);if(i==null){let i=n.encode(e);return t.set(r,i),i}else return i},Lf=112,Rf=18,zf=(e,t,n)=>{let r=mf(e),i=r+mf(t),a=new Uint8Array(i+n.byteLength);return pf(e,a,0),pf(t,a,r),a.set(n,i),a},Bf=Symbol.for(`@ipld/js-cid/CID`),Vf={writable:!1,configurable:!1,enumerable:!0},Hf={writable:!1,enumerable:!1,configurable:!1},Uf=`0.0.0-dev`,Wf=(e,t)=>{if(e.test(Uf))console.warn(t);else throw Error(t)},Gf=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
3
|
+
Following code pattern:
|
|
4
|
+
|
|
5
|
+
if (CID.isCID(value)) {
|
|
6
|
+
doSomethingWithCID(value)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Is replaced with:
|
|
10
|
+
|
|
11
|
+
const cid = CID.asCID(value)
|
|
12
|
+
if (cid) {
|
|
13
|
+
// Make sure to use cid instead of value
|
|
14
|
+
doSomethingWithCID(cid)
|
|
15
|
+
}
|
|
16
|
+
`,Kf={...ad,...sd,...ld,...dd,...pd,...gd,...Ed,...kd,...Md,...Ld},qf={...xf,...Tf};function Jf(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}var Yf=Jf(`utf8`,`u`,e=>`u`+new TextDecoder(`utf8`).decode(e),e=>new TextEncoder().encode(e.substring(1))),Xf=Jf(`ascii`,`a`,e=>{let t=`a`;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);let t=Bu(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),Zf={utf8:Yf,"utf-8":Yf,hex:Kf.base16,latin1:Xf,ascii:Xf,binary:Xf,...Kf},Qf=Zf;function $f(e,t=`utf8`){let n=Qf[t];if(!n)throw Error(`Unsupported encoding "${t}"`);return(t===`utf8`||t===`utf-8`)&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?zu(globalThis.Buffer.from(e,`utf-8`)):n.decoder.decode(`${n.prefix}${e}`)}function ep(e,t=`utf8`){let n=Qf[t];if(!n)throw Error(`Unsupported encoding "${t}"`);return(t===`utf8`||t===`utf-8`)&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`):n.encoder.encode(e).substring(1)}var tp={waku:{publish:`waku_publish`,batchPublish:`waku_batchPublish`,subscribe:`waku_subscribe`,batchSubscribe:`waku_batchSubscribe`,subscription:`waku_subscription`,unsubscribe:`waku_unsubscribe`,batchUnsubscribe:`waku_batchUnsubscribe`,batchFetchMessages:`waku_batchFetchMessages`},irn:{publish:`irn_publish`,batchPublish:`irn_batchPublish`,subscribe:`irn_subscribe`,batchSubscribe:`irn_batchSubscribe`,subscription:`irn_subscription`,unsubscribe:`irn_unsubscribe`,batchUnsubscribe:`irn_batchUnsubscribe`,batchFetchMessages:`irn_batchFetchMessages`},iridium:{publish:`iridium_publish`,batchPublish:`iridium_batchPublish`,subscribe:`iridium_subscribe`,batchSubscribe:`iridium_batchSubscribe`,subscription:`iridium_subscription`,unsubscribe:`iridium_unsubscribe`,batchUnsubscribe:`iridium_batchUnsubscribe`,batchFetchMessages:`iridium_batchFetchMessages`}},np=e.t(((e,t)=>{var n=`Input must be an string, Buffer or Uint8Array`;function r(e){let t;if(e instanceof Uint8Array)t=e;else if(typeof e==`string`)t=new TextEncoder().encode(e);else throw Error(n);return t}function i(e){return Array.prototype.map.call(e,function(e){return(e<16?`0`:``)+e.toString(16)}).join(``)}function a(e){return(4294967296+e).toString(16).substring(1)}function o(e,t,n){let r=`
|
|
17
|
+
`+e+` = `;for(let i=0;i<t.length;i+=2){if(n===32)r+=a(t[i]).toUpperCase(),r+=` `,r+=a(t[i+1]).toUpperCase();else if(n===64)r+=a(t[i+1]).toUpperCase(),r+=a(t[i]).toUpperCase();else throw Error(`Invalid size `+n);i%6==4?r+=`
|
|
18
|
+
`+Array(e.length+4).join(` `):i<t.length-2&&(r+=` `)}console.log(r)}function s(e,t,n){let r=new Date().getTime(),i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;let a=new Date().getTime();console.log(`Generated random input in `+(a-r)+`ms`),r=a;for(let a=0;a<n;a++){let n=e(i),a=new Date().getTime(),o=a-r;r=a,console.log(`Hashed in `+o+`ms: `+n.substring(0,20)+`...`),console.log(Math.round(t/(1<<20)/(o/1e3)*100)/100+` MB PER SECOND`)}}t.exports={normalizeInput:r,toHex:i,debugPrint:o,testSpeed:s}})),rp=e.t(((e,t)=>{var n=np();function r(e,t,n){let r=e[t]+e[n],i=e[t+1]+e[n+1];r>=4294967296&&i++,e[t]=r,e[t+1]=i}function i(e,t,n,r){let i=e[t]+n;n<0&&(i+=4294967296);let a=e[t+1]+r;i>=4294967296&&a++,e[t]=i,e[t+1]=a}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,n,a,o,s){let c=u[o],d=u[o+1],f=u[s],p=u[s+1];r(l,e,t),i(l,e,c,d);let m=l[a]^l[e],h=l[a+1]^l[e+1];l[a]=h,l[a+1]=m,r(l,n,a),m=l[t]^l[n],h=l[t+1]^l[n+1],l[t]=m>>>24^h<<8,l[t+1]=h>>>24^m<<8,r(l,e,t),i(l,e,f,p),m=l[a]^l[e],h=l[a+1]^l[e+1],l[a]=m>>>16^h<<16,l[a+1]=h>>>16^m<<16,r(l,n,a),m=l[t]^l[n],h=l[t+1]^l[n+1],l[t]=h>>>31^m<<1,l[t+1]=m>>>31^h<<1}var s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(e){return e*2})),l=new Uint32Array(32),u=new Uint32Array(32);function d(e,t){let n=0;for(n=0;n<16;n++)l[n]=e.h[n],l[n+16]=s[n];for(l[24]^=e.t,l[25]^=e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),n=0;n<32;n++)u[n]=a(e.b,4*n);for(n=0;n<12;n++)o(0,8,16,24,c[n*16+0],c[n*16+1]),o(2,10,18,26,c[n*16+2],c[n*16+3]),o(4,12,20,28,c[n*16+4],c[n*16+5]),o(6,14,22,30,c[n*16+6],c[n*16+7]),o(0,10,20,30,c[n*16+8],c[n*16+9]),o(2,12,22,24,c[n*16+10],c[n*16+11]),o(4,14,16,26,c[n*16+12],c[n*16+13]),o(6,8,18,28,c[n*16+14],c[n*16+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^l[n]^l[n+16]}var f=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,n,r){if(e===0||e>64)throw Error(`Illegal output length, expected 0 < length <= 64`);if(t&&t.length>64)throw Error(`Illegal key, expected Uint8Array with 0 < length <= 64`);if(n&&n.length!==16)throw Error(`Illegal salt, expected Uint8Array with length is 16`);if(r&&r.length!==16)throw Error(`Illegal personal, expected Uint8Array with length is 16`);let i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};f.fill(0),f[0]=e,t&&(f[1]=t.length),f[2]=1,f[3]=1,n&&f.set(n,32),r&&f.set(r,48);for(let e=0;e<16;e++)i.h[e]=s[e]^a(f,e*4);return t&&(m(i,t),i.c=128),i}function m(e,t){for(let n=0;n<t.length;n++)e.c===128&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[n]}function h(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;d(e,!0);let t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(n&3);return t}function g(e,t,r,i,a){r||=64,e=n.normalizeInput(e),i&&=n.normalizeInput(i),a&&=n.normalizeInput(a);let o=p(r,t,i,a);return m(o,e),h(o)}function _(e,t,r,i,a){let o=g(e,t,r,i,a);return n.toHex(o)}t.exports={blake2b:g,blake2bHex:_,blake2bInit:p,blake2bUpdate:m,blake2bFinal:h}})),ip=e.t(((e,t)=>{var n=np();function r(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function i(e,t,n,r,i,o){c[e]=c[e]+c[t]+i,c[r]=a(c[r]^c[e],16),c[n]=c[n]+c[r],c[t]=a(c[t]^c[n],12),c[e]=c[e]+c[t]+o,c[r]=a(c[r]^c[e],8),c[n]=c[n]+c[r],c[t]=a(c[t]^c[n],7)}function a(e,t){return e>>>t^e<<32-t}var o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),c=new Uint32Array(16),l=new Uint32Array(16);function u(e,t){let n=0;for(n=0;n<8;n++)c[n]=e.h[n],c[n+8]=o[n];for(c[12]^=e.t,c[13]^=e.t/4294967296,t&&(c[14]=~c[14]),n=0;n<16;n++)l[n]=r(e.b,4*n);for(n=0;n<10;n++)i(0,4,8,12,l[s[n*16+0]],l[s[n*16+1]]),i(1,5,9,13,l[s[n*16+2]],l[s[n*16+3]]),i(2,6,10,14,l[s[n*16+4]],l[s[n*16+5]]),i(3,7,11,15,l[s[n*16+6]],l[s[n*16+7]]),i(0,5,10,15,l[s[n*16+8]],l[s[n*16+9]]),i(1,6,11,12,l[s[n*16+10]],l[s[n*16+11]]),i(2,7,8,13,l[s[n*16+12]],l[s[n*16+13]]),i(3,4,9,14,l[s[n*16+14]],l[s[n*16+15]]);for(n=0;n<8;n++)e.h[n]^=c[n]^c[n+8]}function d(e,t){if(!(e>0&&e<=32))throw Error(`Incorrect output length, should be in [1, 32]`);let n=t?t.length:0;if(t&&!(n>0&&n<=32))throw Error(`Incorrect key length, should be in [1, 32]`);let r={h:new Uint32Array(o),b:new Uint8Array(64),c:0,t:0,outlen:e};return r.h[0]^=16842752^n<<8^e,n>0&&(f(r,t),r.c=64),r}function f(e,t){for(let n=0;n<t.length;n++)e.c===64&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[n]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;u(e,!0);let t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(n&3)&255;return t}function m(e,t,r){r||=32,e=n.normalizeInput(e);let i=d(r,t);return f(i,e),p(i)}function h(e,t,r){let i=m(e,t,r);return n.toHex(i)}t.exports={blake2s:m,blake2sHex:h,blake2sInit:d,blake2sUpdate:f,blake2sFinal:p}})),ap=e.t(((e,t)=>{var n=rp(),r=ip();t.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal}})),Z={exports:{}};function op(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}var sp=cp;function cp(e,t,n){var r=n&&n.stringify||op,i=1;if(typeof e==`object`&&e){var a=t.length+i;if(a===1)return e;var o=Array(a);o[0]=r(e);for(var s=1;s<a;s++)o[s]=r(t[s]);return o.join(` `)}if(typeof e!=`string`)return e;var c=t.length;if(c===0)return e;for(var l=``,u=1-i,d=-1,f=e&&e.length||0,p=0;p<f;){if(e.charCodeAt(p)===37&&p+1<f){switch(d=d>-1?d:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c||t[u]==null)break;d<p&&(l+=e.slice(d,p)),l+=Number(t[u]),d=p+2,p++;break;case 105:if(u>=c||t[u]==null)break;d<p&&(l+=e.slice(d,p)),l+=Math.floor(Number(t[u])),d=p+2,p++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;d<p&&(l+=e.slice(d,p));var m=typeof t[u];if(m===`string`){l+=`'`+t[u]+`'`,d=p+2,p++;break}if(m===`function`){l+=t[u].name||`<anonymous>`,d=p+2,p++;break}l+=r(t[u]),d=p+2,p++;break;case 115:if(u>=c)break;d<p&&(l+=e.slice(d,p)),l+=String(t[u]),d=p+2,p++;break;case 37:d<p&&(l+=e.slice(d,p)),l+=`%`,d=p+2,p++,u--;break}++u}++p}return d===-1?e:(d<f&&(l+=e.slice(d)),l)}var lp=sp;Z.exports=yp;var up=zp().console||{},dp={mapHttpRequest:Mp,mapHttpResponse:Mp,wrapRequestSerializer:Np,wrapResponseSerializer:Np,wrapErrorSerializer:Np,req:Mp,res:Mp,err:Ap,errWithCause:Ap};function fp(e,t){return e===`silent`?1/0:t.levels.values[e]}var pp=Symbol(`pino.logFuncs`),mp=Symbol(`pino.hierarchy`),hp={error:`log`,fatal:`error`,warn:`error`,info:`log`,debug:`log`,trace:`log`};function gp(e,t){t[mp]={logger:t,parent:e[mp]}}function _p(e,t,n){let r={};t.forEach(e=>{r[e]=n[e]?n[e]:up[e]||up[hp[e]||`log`]||Pp}),e[pp]=r}function vp(e,t){return Array.isArray(e)?e.filter(function(e){return e!==`!stdSerializers.err`}):e===!0?Object.keys(t):!1}function yp(e){e||={},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!=`function`)throw Error(`pino: transmit option must have a send function`);let n=e.browser.write||up;e.browser.write&&(e.browser.asObject=!0);let r=e.serializers||{},i=vp(e.browser.serialize,r),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf(`!stdSerializers.err`)>-1&&(a=!1);let o=Object.keys(e.customLevels||{}),s=[`error`,`fatal`,`warn`,`info`,`debug`,`trace`].concat(o);typeof n==`function`&&s.forEach(function(e){n[e]=n}),(e.enabled===!1||e.browser.disabled)&&(e.level=`silent`);let c=e.level||`info`,l=Object.create(n);l.log||=Pp,_p(l,s,n),gp({},l),Object.defineProperty(l,`levelVal`,{get:d}),Object.defineProperty(l,`level`,{get:f,set:p});let u={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:jp(e),messageKey:e.messageKey||`msg`,onChild:e.onChild||Pp};l.levels=bp(e),l.level=c,l.isLevelEnabled=function(e){return this.levels.values[e]?this.levels.values[e]>=this.levels.values[this.level]:!1},l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=Pp,l.serializers=r,l._serialize=i,l._stdErrSerialize=a,l.child=function(...e){return m.call(this,u,...e)},t&&(l._logEvent=kp());function d(){return fp(this.level,this)}function f(){return this._level}function p(e){if(e!==`silent`&&!this.levels.values[e])throw Error(`unknown level `+e);this._level=e,Cp(this,u,l,`error`),Cp(this,u,l,`fatal`),Cp(this,u,l,`warn`),Cp(this,u,l,`info`),Cp(this,u,l,`debug`),Cp(this,u,l,`trace`),o.forEach(e=>{Cp(this,u,l,e)})}function m(n,a,o){if(!a)throw Error(`missing bindings for child Pino`);o||={},i&&a.serializers&&(o.serializers=a.serializers);let s=o.serializers;if(i&&s){var c=Object.assign({},r,s),l=e.browser.serialize===!0?Object.keys(c):i;delete a.serializers,Dp([a],l,c,this._stdErrSerialize)}function u(e){this._childLevel=(e._childLevel|0)+1,this.bindings=a,c&&(this.serializers=c,this._serialize=l),t&&(this._logEvent=kp([].concat(e._logEvent.bindings,a)))}u.prototype=this;let d=new u(this);return gp(this,d),d.child=function(...e){return m.call(this,n,...e)},d.level=o.level||this.level,n.onChild(d),d}return l}function bp(e){let t=e.customLevels||{};return{values:Object.assign({},yp.levels.values,t),labels:Object.assign({},yp.levels.labels,xp(t))}}function xp(e){let t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}yp.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:`trace`,20:`debug`,30:`info`,40:`warn`,50:`error`,60:`fatal`}},yp.stdSerializers=dp,yp.stdTimeFunctions=Object.assign({},{nullTime:Fp,epochTime:Ip,unixTime:Lp,isoTime:Rp});function Sp(e){let t=[];e.bindings&&t.push(e.bindings);let n=e[mp];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function Cp(e,t,n,r){if(Object.defineProperty(e,r,{value:fp(e.level,n)>fp(r,n)?Pp:n[pp][r],writable:!0,enumerable:!0,configurable:!0}),e[r]===Pp){if(!t.transmit)return;let i=fp(t.transmit.level||e.level,n);if(fp(r,n)<i)return}e[r]=Tp(e,t,n,r);let i=Sp(e);i.length!==0&&(e[r]=wp(i,e[r]))}function wp(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Tp(e,t,n,r){return function(i){return function(){let a=t.timestamp(),o=Array(arguments.length),s=Object.getPrototypeOf&&Object.getPrototypeOf(this)===up?up:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];var l=!1;if(t.serialize&&(Dp(o,this._serialize,this.serializers,this._stdErrSerialize),l=!0),t.asObject||t.formatters?i.call(s,...Ep(this,r,o,a,t)):i.apply(s,o),t.transmit){let i=t.transmit.level||e._level,s=fp(i,n),c=fp(r,n);if(c<s)return;Op(this,{ts:a,methodLevel:r,methodValue:c,transmitLevel:i,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:fp(e._level,n)},o,l)}}}(e[pp][r])}function Ep(e,t,n,r,i){let{level:a,log:o=e=>e}=i.formatters||{},s=n.slice(),c=s[0],l={},u=(e._childLevel|0)+1;if(u<1&&(u=1),r&&(l.time=r),a){let n=a(t,e.levels.values[t]);Object.assign(l,n)}else l.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(typeof c==`object`&&c)for(;u--&&typeof s[0]==`object`;)Object.assign(l,s.shift());return[o(l),...s]}else{if(typeof c==`object`&&c){for(;u--&&typeof s[0]==`object`;)Object.assign(l,s.shift());c=s.length?lp(s.shift(),s):void 0}else typeof c==`string`&&(c=lp(s.shift(),s));return c!==void 0&&(l[i.messageKey]=c),[o(l)]}}function Dp(e,t,n,r){for(let i in e)if(r&&e[i]instanceof Error)e[i]=yp.stdSerializers.err(e[i]);else if(typeof e[i]==`object`&&!Array.isArray(e[i])&&t)for(let r in e[i])t.indexOf(r)>-1&&r in n&&(e[i][r]=n[r](e[i][r]))}function Op(e,t,n,r=!1){let i=t.send,a=t.ts,o=t.methodLevel,s=t.methodValue,c=t.val,l=e._logEvent.bindings;r||Dp(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=n.filter(function(e){return l.indexOf(e)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,c),e._logEvent=kp(l)}function kp(e){return{ts:0,messages:[],bindings:e||[],level:{label:``,value:0}}}function Ap(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let n in e)t[n]===void 0&&(t[n]=e[n]);return t}function jp(e){return typeof e.timestamp==`function`?e.timestamp:e.timestamp===!1?Fp:Ip}function Mp(){return{}}function Np(e){return e}function Pp(){}function Fp(){return!1}function Ip(){return Date.now()}function Lp(){return Math.round(Date.now()/1e3)}function Rp(){return new Date(Date.now()).toISOString()}function zp(){function e(e){return typeof e<`u`&&e}try{return typeof globalThis<`u`||Object.defineProperty(Object.prototype,`globalThis`,{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}Z.exports.default=yp;var Bp=Z.exports.pino=yp,Vp={level:`info`},Hp=`custom_context`,Up=1e3*1024,Wp=Object.defineProperty,Gp=(e,t,n)=>t in e?Wp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kp=(e,t,n)=>Gp(e,typeof t==`symbol`?t:t+``,n),qp=class{constructor(e){Kp(this,`nodeValue`),Kp(this,`sizeInBytes`),Kp(this,`next`),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Jp=class{constructor(e){Kp(this,`lengthInNodes`),Kp(this,`sizeInBytes`),Kp(this,`head`),Kp(this,`tail`),Kp(this,`maxSizeInBytes`),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new qp(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}},Yp=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString()+`n`:t);function Xp(e){return typeof e==`string`?e:Yp(e)||``}var Zp=Object.defineProperty,Qp=(e,t,n)=>t in e?Zp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$p=(e,t,n)=>Qp(e,typeof t==`symbol`?t:t+``,n),em=class{constructor(e,t=Up){$p(this,`logs`),$p(this,`level`),$p(this,`levelValue`),$p(this,`MAX_LOG_SIZE_IN_BYTES`),this.level=e??`error`,this.levelValue=Z.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Jp(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===Z.exports.levels.values.error?console.error(e):t===Z.exports.levels.values.warn?console.warn(e):t===Z.exports.levels.values.debug?console.debug(e):t===Z.exports.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Xp({timestamp:new Date().toISOString(),log:e}));let t=typeof e==`string`?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new Jp(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push(Xp({extraMetadata:e})),new Blob(t,{type:`application/json`})}},tm=Object.defineProperty,nm=(e,t,n)=>t in e?tm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rm=(e,t,n)=>nm(e,typeof t==`symbol`?t:t+``,n),im=class{constructor(e,t=Up){rm(this,`baseChunkLogger`),this.baseChunkLogger=new em(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement(`a`);n.href=t,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}},am=Object.defineProperty,om=(e,t,n)=>t in e?am(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sm=(e,t,n)=>om(e,typeof t==`symbol`?t:t+``,n),cm=class{constructor(e,t=Up){sm(this,`baseChunkLogger`),this.baseChunkLogger=new em(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}},lm=Object.defineProperty,um=Object.defineProperties,dm=Object.getOwnPropertyDescriptors,fm=Object.getOwnPropertySymbols,pm=Object.prototype.hasOwnProperty,mm=Object.prototype.propertyIsEnumerable,hm=(e,t,n)=>t in e?lm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gm=(e,t)=>{for(var n in t||={})pm.call(t,n)&&hm(e,n,t[n]);if(fm)for(var n of fm(t))mm.call(t,n)&&hm(e,n,t[n]);return e},_m=(e,t)=>um(e,dm(t));function vm(e){return _m(gm({},e),{level:e?.level||Vp.level})}function ym(e,t,n=Hp){return e[n]=t,e}function bm(e,t=Hp){return e[t]||``}function xm(e,t,n=Hp){let r=bm(e,n);return r.trim()?`${r}/${t}`:t}function Sm(e,t,n=Hp){let r=xm(e,t,n);return ym(e.child({context:r}),r,n)}function Cm(e){let t=new im(e.opts?.level,e.maxSizeInBytes);return{logger:Z.exports(_m(gm({},e.opts),{level:`trace`,browser:_m(gm({},e.opts?.browser),{write:e=>t.write(e)})})),chunkLoggerController:t}}function wm(e){let t=new cm(e.opts?.level,e.maxSizeInBytes);return{logger:Z.exports(_m(gm({},e.opts),{level:`trace`,browser:_m(gm({},e.opts?.browser),{write:e=>t.write(e)})}),t),chunkLoggerController:t}}function Tm(e){if(typeof e.loggerOverride<`u`&&typeof e.loggerOverride!=`string`)return{logger:e.loggerOverride,chunkLoggerController:null};let t=_m(gm({},e.opts),{level:typeof e.loggerOverride==`string`?e.loggerOverride:e.opts?.level});return typeof window<`u`?Cm(_m(gm({},e),{opts:t})):wm(_m(gm({},e),{opts:t}))}var Em=class{},Dm=t(),Om=Oe(),km=class extends Em{constructor(e){super()}},Am=Om.FIVE_SECONDS,jm={pulse:`heartbeat_pulse`},Mm=class e extends km{constructor(e){super(e),this.events=new Dm.EventEmitter,this.interval=Am,this.interval=e?.interval||Am}static async init(t){let n=new e(t);return await n.init(),n}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,Om.toMiliseconds)(this.interval))}pulse(){this.events.emit(jm.pulse)}},Nm=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Pm=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Fm=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Im(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){Lm(e);return}return t}function Lm(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function Rm(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!Fm.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(Nm.test(e)||Pm.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,Im)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function zm(e){return!e||typeof e.then!=`function`?Promise.resolve(e):e}function Q(e,...t){try{return zm(e(...t))}catch(e){return Promise.reject(e)}}function Bm(e){let t=typeof e;return e===null||t!==`object`&&t!==`function`}function Vm(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Hm(e){if(Bm(e))return String(e);if(Vm(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON==`function`)return Hm(e.toJSON());throw Error(`[unstorage] Cannot stringify value!`)}var Um=`base64:`;function Wm(e){return typeof e==`string`?e:Um+qm(e)}function Gm(e){return typeof e!=`string`||!e.startsWith(Um)?e:Km(e.slice(7))}function Km(e){return globalThis.Buffer?Buffer.from(e,`base64`):Uint8Array.from(globalThis.atob(e),e=>e.codePointAt(0))}function qm(e){return globalThis.Buffer?Buffer.from(e).toString(`base64`):globalThis.btoa(String.fromCodePoint(...e))}function $(e){return e&&e.split(`?`)[0]?.replace(/[/\\]/g,`:`).replace(/:+/g,`:`).replace(/^:|:$/g,``)||``}function Jm(...e){return $(e.join(`:`))}function Ym(e){return e=$(e),e?e+`:`:``}function Xm(e,t){if(t===void 0)return!0;let n=0,r=e.indexOf(`:`);for(;r>-1;)n++,r=e.indexOf(`:`,r+1);return n<=t}function Zm(e,t){return t?e.startsWith(t)&&e[e.length-1]!==`$`:e[e.length-1]!==`$`}function Qm(e){return e}var $m=`memory`,eh=Qm(()=>{let e=new Map;return{name:$m,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,n){e.set(t,n)},setItemRaw(t,n){e.set(t,n)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}});function th(e={}){let t={mounts:{"":e.driver||eh()},mountpoints:[``],watching:!1,watchListeners:[],unwatch:{}},n=e=>{for(let n of t.mountpoints)if(e.startsWith(n))return{base:n,relativeKey:e.slice(n.length),driver:t.mounts[n]};return{base:``,relativeKey:e,driver:t.mounts[``]}},r=(e,n)=>t.mountpoints.filter(t=>t.startsWith(e)||n&&e.startsWith(t)).map(n=>({relativeBase:e.length>n.length?e.slice(n.length):void 0,mountpoint:n,driver:t.mounts[n]})),i=(e,n)=>{if(t.watching){n=$(n);for(let r of t.watchListeners)r(e,n)}},a=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await nh(t.mounts[e],i,e)},o=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},s=(e,t,r)=>{let i=new Map,a=e=>{let t=i.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},i.set(e.base,t)),t};for(let r of e){let e=typeof r==`string`,i=$(e?r:r.key),o=e?void 0:r.value,s=e||!r.options?t:{...t,...r.options},c=n(i);a(c).items.push({key:i,value:o,relativeKey:c.relativeKey,options:s})}return Promise.all([...i.values()].map(e=>r(e))).then(e=>e.flat())},c={hasItem(e,t={}){e=$(e);let{relativeKey:r,driver:i}=n(e);return Q(i.hasItem,r,t)},getItem(e,t={}){e=$(e);let{relativeKey:r,driver:i}=n(e);return Q(i.getItem,r,t).then(e=>Rm(e))},getItems(e,t={}){return s(e,t,e=>e.driver.getItems?Q(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:Jm(e.base,t.key),value:Rm(t.value)}))):Promise.all(e.items.map(t=>Q(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:Rm(e)})))))},getItemRaw(e,t={}){e=$(e);let{relativeKey:r,driver:i}=n(e);return i.getItemRaw?Q(i.getItemRaw,r,t):Q(i.getItem,r,t).then(e=>Gm(e))},async setItem(e,t,r={}){if(t===void 0)return c.removeItem(e);e=$(e);let{relativeKey:a,driver:o}=n(e);o.setItem&&(await Q(o.setItem,a,Hm(t),r),o.watch||i(`update`,e))},async setItems(e,t){await s(e,t,async e=>{if(e.driver.setItems)return Q(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:Hm(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>Q(e.driver.setItem,t.relativeKey,Hm(t.value),t.options)))})},async setItemRaw(e,t,r={}){if(t===void 0)return c.removeItem(e,r);e=$(e);let{relativeKey:a,driver:o}=n(e);if(o.setItemRaw)await Q(o.setItemRaw,a,t,r);else if(o.setItem)await Q(o.setItem,a,Wm(t),r);else return;o.watch||i(`update`,e)},async removeItem(e,t={}){typeof t==`boolean`&&(t={removeMeta:t}),e=$(e);let{relativeKey:r,driver:a}=n(e);a.removeItem&&(await Q(a.removeItem,r,t),(t.removeMeta||t.removeMata)&&await Q(a.removeItem,r+`$`,t),a.watch||i(`remove`,e))},async getMeta(e,t={}){typeof t==`boolean`&&(t={nativeOnly:t}),e=$(e);let{relativeKey:r,driver:i}=n(e),a=Object.create(null);if(i.getMeta&&Object.assign(a,await Q(i.getMeta,r,t)),!t.nativeOnly){let e=await Q(i.getItem,r+`$`,t).then(e=>Rm(e));e&&typeof e==`object`&&(typeof e.atime==`string`&&(e.atime=new Date(e.atime)),typeof e.mtime==`string`&&(e.mtime=new Date(e.mtime)),Object.assign(a,e))}return a},setMeta(e,t,n={}){return this.setItem(e+`$`,t,n)},removeMeta(e,t={}){return this.removeItem(e+`$`,t)},async getKeys(e,t={}){e=Ym(e);let n=r(e,!0),i=[],a=[],o=!0;for(let e of n){e.driver.flags?.maxDepth||(o=!1);let n=await Q(e.driver.getKeys,e.relativeBase,t);for(let t of n){let n=e.mountpoint+$(t);i.some(e=>n.startsWith(e))||a.push(n)}i=[e.mountpoint,...i.filter(t=>!t.startsWith(e.mountpoint))]}let s=t.maxDepth!==void 0&&!o;return a.filter(n=>(!s||Xm(n,t.maxDepth))&&Zm(n,e))},async clear(e,t={}){e=Ym(e),await Promise.all(r(e,!1).map(async e=>{if(e.driver.clear)return Q(e.driver.clear,e.relativeBase,t);if(e.driver.removeItem){let n=await e.driver.getKeys(e.relativeBase||``,t);return Promise.all(n.map(n=>e.driver.removeItem(n,t)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>rh(e)))},async watch(e){return await a(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),t.watchListeners.length===0&&await o()}},async unwatch(){t.watchListeners=[],await o()},mount(e,n){if(e=Ym(e),e&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=n,t.watching&&Promise.resolve(nh(n,i,e)).then(n=>{t.unwatch[e]=n}).catch(console.error),c},async unmount(e,n=!0){e=Ym(e),!(!e||!t.mounts[e])&&(t.watching&&e in t.unwatch&&(t.unwatch[e]?.(),delete t.unwatch[e]),n&&await rh(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=``){e=$(e)+`:`;let t=n(e);return{driver:t.driver,base:t.base}},getMounts(e=``,t={}){return e=$(e),r(e,t.parents).map(e=>({driver:e.driver,base:e.mountpoint}))},keys:(e,t={})=>c.getKeys(e,t),get:(e,t={})=>c.getItem(e,t),set:(e,t,n={})=>c.setItem(e,t,n),has:(e,t={})=>c.hasItem(e,t),del:(e,t={})=>c.removeItem(e,t),remove:(e,t={})=>c.removeItem(e,t)};return c}function nh(e,t,n){return e.watch?e.watch((e,r)=>t(e,n+r)):()=>{}}async function rh(e){typeof e.dispose==`function`&&await Q(e.dispose)}function ih(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function ah(e,t){let n,r=()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=ih(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n};return(e,n)=>r().then(r=>n(r.transaction(t,e).objectStore(t)))}var oh;function sh(){return oh||=ah(`keyval-store`,`keyval`),oh}function ch(e,t=sh()){return t(`readonly`,t=>ih(t.get(e)))}function lh(e,t,n=sh()){return n(`readwrite`,n=>(n.put(t,e),ih(n.transaction)))}function uh(e,t=sh()){return t(`readwrite`,t=>(t.delete(e),ih(t.transaction)))}function dh(e=sh()){return e(`readwrite`,e=>(e.clear(),ih(e.transaction)))}function fh(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},ih(e.transaction)}function ph(e=sh()){return e(`readonly`,e=>{if(e.getAllKeys)return ih(e.getAllKeys());let t=[];return fh(e,e=>t.push(e.key)).then(()=>t)})}var mh=`idb-keyval`,hh=(e={})=>{let t=e.base&&e.base.length>0?`${e.base}:`:``,n=e=>t+e,r;return e.dbName&&e.storeName&&(r=ah(e.dbName,e.storeName)),{name:mh,options:e,async hasItem(e){return!(typeof await ch(n(e),r)>`u`)},async getItem(e){return await ch(n(e),r)??null},setItem(e,t){return lh(n(e),t,r)},removeItem(e){return uh(n(e),r)},getKeys(){return ph(r)},clear(){return dh(r)}}},gh=`WALLET_CONNECT_V2_INDEXED_DB`,_h=`keyvaluestorage`,vh=class{constructor(){this.indexedDb=th({driver:hh({dbName:gh,storeName:_h})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ho(t))}async removeItem(e){await this.indexedDb.removeItem(e)}},yh=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},bh={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e||=0,Object.keys(this)[e]},e.prototype.__defineGetter__(`length`,function(){return Object.keys(this).length}),typeof yh<`u`&&yh.localStorage?bh.exports=yh.localStorage:typeof window<`u`&&window.localStorage?bh.exports=window.localStorage:bh.exports=new t})();function xh(e){return[e[0],mo(e[1]??``)]}var Sh=class{constructor(){this.localStorage=bh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(xh)}async getItem(e){let t=this.localStorage.getItem(e);if(t!==null)return mo(t)}async setItem(e,t){this.localStorage.setItem(e,ho(t))}async removeItem(e){this.localStorage.removeItem(e)}},Ch=`wc_storage_version`,wh=1,Th=async(e,t,n)=>{let r=Ch,i=await t.getItem(r);if(i&&i>=wh){n(t);return}let a=await e.getKeys();if(!a.length){n(t);return}let o=[];for(;a.length;){let n=a.shift();if(!n)continue;let r=n.toLowerCase();if(r.includes(`wc@`)||r.includes(`walletconnect`)||r.includes(`wc_`)||r.includes(`wallet_connect`)){let r=await e.getItem(n);await t.setItem(n,r),o.push(n)}}await t.setItem(r,wh),n(t),Eh(e,o)},Eh=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})},Dh=class{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new Sh;this.storage=e;try{Th(e,new vh,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};const Oh=`PARSE_ERROR`,kh=`INVALID_REQUEST`,Ah=`METHOD_NOT_FOUND`,jh=`INVALID_PARAMS`,Mh=`INTERNAL_ERROR`,Nh=`SERVER_ERROR`,Ph=[-32700,-32600,-32601,-32602,-32603],Fh=[-32e3,-32099],Ih={[Oh]:{code:-32700,message:`Parse error`},[kh]:{code:-32600,message:`Invalid Request`},[Ah]:{code:-32601,message:`Method not found`},[jh]:{code:-32602,message:`Invalid params`},[Mh]:{code:-32603,message:`Internal error`},[Nh]:{code:-32e3,message:`Server error`}},Lh=Nh;function Rh(e){return e<=Fh[0]&&e>=Fh[1]}function zh(e){return Ph.includes(e)}function Bh(e){return typeof e==`number`}function Vh(e){return Object.keys(Ih).includes(e)?Ih[e]:Ih[Lh]}function Hh(e){return Object.values(Ih).find(t=>t.code===e)||Ih[Lh]}function Uh(e){if(e.error.code===void 0)return{valid:!1,error:`Missing code for JSON-RPC error`};if(e.error.message===void 0)return{valid:!1,error:`Missing message for JSON-RPC error`};if(!Bh(e.error.code))return{valid:!1,error:`Invalid error code type for JSON-RPC: ${e.error.code}`};if(zh(e.error.code)){let t=Hh(e.error.code);if(t.message!==Ih.SERVER_ERROR.message&&e.error.message===t.message)return{valid:!1,error:`Invalid error code message for JSON-RPC: ${e.error.code}`}}return{valid:!0}}function Wh(e,t,n){return e.message.includes(`getaddrinfo ENOTFOUND`)||e.message.includes(`connect ECONNREFUSED`)?Error(`Unavailable ${n} RPC url at ${t}`):e}var Gh=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0;function t(){return(global==null?void 0:global.crypto)||(global==null?void 0:global.msCrypto)||{}}e.getBrowerCrypto=t;function n(){let e=t();return e.subtle||e.webkitSubtle}e.getSubtleCrypto=n;function r(){return!!t()&&!!n()}e.isBrowserCryptoAvailable=r})),Kh=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0;function t(){return typeof document>`u`&&typeof navigator<`u`&&navigator.product===`ReactNative`}e.isReactNative=t;function n(){return typeof process<`u`&&process.versions!==void 0&&process.versions.node!==void 0}e.isNode=n;function r(){return!t()&&!n()}e.isBrowser=r})),qh=e.t((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(ve(),e.a(y));n.__exportStar(Gh(),t),n.__exportStar(Kh(),t)})),Jh=e.r({isNodeJs:()=>Xh}),Yh=qh();e.i(Jh,e.o(qh()));const Xh=Yh.isNode;function Zh(e=3){return Date.now()*10**e+Math.floor(Math.random()*10**e)}function Qh(e=6){return BigInt(Zh(e))}function $h(e,t,n){return{id:n||Zh(),jsonrpc:`2.0`,method:e,params:t}}function eg(e,t){return{id:e,jsonrpc:`2.0`,result:t}}function tg(e,t,n){return{id:e,jsonrpc:`2.0`,error:ng(t,n)}}function ng(e,t){return e===void 0?Vh(Mh):(typeof e==`string`&&(e=Object.assign(Object.assign({},Vh(Nh)),{message:e})),t!==void 0&&(e.data=t),zh(e.code)&&(e=Hh(e.code)),e)}function rg(e){return e.includes(`*`)?ag(e):!/\W/g.test(e)}function ig(e){return e===`*`}function ag(e){return ig(e)?!0:!(!e.includes(`*`)||e.split(`*`).length!==2||e.split(`*`).filter(e=>e.trim()===``).length!==1)}function og(e){return!ig(e)&&ag(e)&&!e.split(`*`)[0].trim()}function sg(e){return!ig(e)&&ag(e)&&!e.split(`*`)[1].trim()}var cg=class{},lg=class extends cg{constructor(e){super()}},ug=class extends cg{constructor(){super()}},dg=class extends ug{constructor(e){super()}},fg=`^https?:`,pg=`^wss?:`;function mg(e){let t=e.match(new RegExp(/^\w+:/,`gi`));if(!(!t||!t.length))return t[0]}function hg(e,t){let n=mg(e);return n===void 0?!1:new RegExp(t).test(n)}function gg(e){return hg(e,fg)}function _g(e){return hg(e,pg)}function vg(e){return RegExp(`wss?://localhost(:d{2,5})?`).test(e)}function yg(e){return typeof e==`object`&&`id`in e&&`jsonrpc`in e&&e.jsonrpc===`2.0`}function bg(e){return yg(e)&&`method`in e}function xg(e){return yg(e)&&(Sg(e)||Cg(e))}function Sg(e){return`result`in e}function Cg(e){return`error`in e}function wg(e){return`error`in e&&e.valid===!1}var Tg=e.r({DEFAULT_ERROR:()=>Lh,IBaseJsonRpcProvider:()=>ug,IEvents:()=>cg,IJsonRpcConnection:()=>lg,IJsonRpcProvider:()=>dg,INTERNAL_ERROR:()=>Mh,INVALID_PARAMS:()=>jh,INVALID_REQUEST:()=>kh,METHOD_NOT_FOUND:()=>Ah,PARSE_ERROR:()=>Oh,RESERVED_ERROR_CODES:()=>Ph,SERVER_ERROR:()=>Nh,SERVER_ERROR_CODE_RANGE:()=>Fh,STANDARD_ERROR_MAP:()=>Ih,formatErrorMessage:()=>ng,formatJsonRpcError:()=>tg,formatJsonRpcRequest:()=>$h,formatJsonRpcResult:()=>eg,getBigIntRpcId:()=>Qh,getError:()=>Vh,getErrorByCode:()=>Hh,isHttpUrl:()=>gg,isJsonRpcError:()=>Cg,isJsonRpcPayload:()=>yg,isJsonRpcRequest:()=>bg,isJsonRpcResponse:()=>xg,isJsonRpcResult:()=>Sg,isJsonRpcValidationInvalid:()=>wg,isLocalhostUrl:()=>vg,isNodeJs:()=>Xh,isReservedErrorCode:()=>zh,isServerErrorCode:()=>Rh,isValidDefaultRoute:()=>ig,isValidErrorCode:()=>Bh,isValidLeadingWildcardRoute:()=>og,isValidRoute:()=>rg,isValidTrailingWildcardRoute:()=>sg,isValidWildcardRoute:()=>ag,isWsUrl:()=>_g,parseConnectionError:()=>Wh,payloadId:()=>Zh,validateJsonRpcError:()=>Uh});e.i(Tg,Jh);var Eg=t(),Dg=class extends dg{constructor(e){super(e),this.events=new Eg.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict($h(e.method,e.params||[],e.id||Qh().toString()),t)}async requestStrict(e,t){return new Promise(async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(e){r(e)}this.events.on(`${e.id}`,e=>{Cg(e)?r(e.error):n(e.result)});try{await this.connection.send(e,t)}catch(e){r(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit(`payload`,e),xg(e)?this.events.emit(`${e.id}`,e):this.events.emit(`message`,{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit(`error`,Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:``}`)),this.events.emit(`disconnect`)}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e==`string`&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit(`connect`))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||=(this.connection.on(`payload`,e=>this.onPayload(e)),this.connection.on(`close`,e=>this.onClose(e)),this.connection.on(`error`,e=>this.events.emit(`error`,e)),this.connection.on(`register_error`,e=>this.onClose()),!0)}},Og=e.t(((e,t)=>{t.exports=function(){throw Error(`ws does not work in the browser. Browser clients must use the native WebSocket object`)}})),kg=t(),Ag=()=>typeof WebSocket<`u`?WebSocket:typeof global<`u`&&typeof global.WebSocket<`u`?global.WebSocket:typeof window<`u`&&typeof window.WebSocket<`u`?window.WebSocket:typeof self<`u`&&typeof self.WebSocket<`u`?self.WebSocket:Og(),jg=()=>typeof WebSocket<`u`||typeof global<`u`&&typeof global.WebSocket<`u`||typeof window<`u`&&typeof window.WebSocket<`u`||typeof self<`u`&&typeof self.WebSocket<`u`,Mg=e=>e.split(`?`)[0],Ng=10,Pg=Ag(),Fg=class{constructor(e){if(this.url=e,this.events=new kg.EventEmitter,this.registering=!1,!_g(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<`u`}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>`u`){t(Error(`Connection already closed`));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>`u`&&(this.socket=await this.register());try{this.socket.send(ho(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!_g(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount(`register_error`)>=e||this.events.listenerCount(`open`)>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once(`register_error`,e=>{this.resetMaxListeners(),t(e)}),this.events.once(`open`,()=>{if(this.resetMaxListeners(),typeof this.socket>`u`)return t(Error(`WebSocket connection is missing or invalid`));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,n)=>{let r=new Pg(e,[],(0,Tg.isReactNative)()?void 0:{rejectUnauthorized:!vg(e)});jg()?r.onerror=e=>{let t=e;n(this.emitError(t.error))}:r.on(`error`,e=>{n(this.emitError(e))}),r.onopen=()=>{this.onOpen(r),t(r)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit(`open`)}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit(`close`,e)}onPayload(e){if(typeof e.data>`u`)return;let t=typeof e.data==`string`?mo(e.data):e.data;this.events.emit(`payload`,t)}onError(e,t){let n=this.parseError(t),r=tg(e,n.message||n.toString());this.events.emit(`payload`,r)}parseError(e,t=this.url){return Wh(e,Mg(t),`WS`)}resetMaxListeners(){this.events.getMaxListeners()>Ng&&this.events.setMaxListeners(Ng)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${Mg(this.url)}`));return this.events.emit(`register_error`,t),t}},Ig=e.t(((e,t)=>{var n=typeof globalThis<`u`&&globalThis||typeof self<`u`&&self||typeof global<`u`&&global,r=(function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e})();(function(e){(function(t){var n=e!==void 0&&e||typeof self<`u`&&self||typeof global<`u`&&global||{},r={searchParams:`URLSearchParams`in n,iterable:`Symbol`in n&&`iterator`in Symbol,blob:`FileReader`in n&&`Blob`in n&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:`FormData`in n,arrayBuffer:`ArrayBuffer`in n};function i(e){return e&&DataView.prototype.isPrototypeOf(e)}if(r.arrayBuffer)var a=[`[object Int8Array]`,`[object Uint8Array]`,`[object Uint8ClampedArray]`,`[object Int16Array]`,`[object Uint16Array]`,`[object Int32Array]`,`[object Uint32Array]`,`[object Float32Array]`,`[object Float64Array]`],o=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if(typeof e!=`string`&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===``)throw TypeError(`Invalid character in header field name: "`+e+`"`);return e.toLowerCase()}function c(e){return typeof e!=`string`&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(e.length!=2)throw TypeError(`Headers constructor: expected name/value pair to be length 2, found`+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}u.prototype.append=function(e,t){e=s(e),t=c(t);var n=this.map[e];this.map[e]=n?n+`, `+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=c(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),l(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),l(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),l(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);function d(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError(`Already read`));e.bodyUsed=!0}}function f(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function m(e){var t=new FileReader,n=f(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:`utf-8`;return t.readAsText(e,i),n}function h(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join(``)}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e==`string`?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&i(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=``),this.headers.get(`content-type`)||(typeof e==`string`?this.headers.set(`content-type`,`text/plain;charset=UTF-8`):this._bodyBlob&&this._bodyBlob.type?this.headers.set(`content-type`,this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`))},r.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error(`could not read FormData body as blob`);return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(r.blob)return this.blob().then(p);throw Error(`could not read as ArrayBuffer`)},this.text=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(h(this._bodyArrayBuffer));if(this._bodyFormData)throw Error(`could not read FormData body as text`);return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}var v=[`CONNECT`,`DELETE`,`GET`,`HEAD`,`OPTIONS`,`PATCH`,`POST`,`PUT`,`TRACE`];function y(e){var t=e.toUpperCase();return v.indexOf(t)>-1?t:e}function b(e,t){if(!(this instanceof b))throw TypeError(`Please use the "new" operator, this DOM object constructor cannot be called as a function.`);t||={};var r=t.body;if(e instanceof b){if(e.bodyUsed)throw TypeError(`Already read`);this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||`same-origin`,(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=y(t.method||this.method||`GET`),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if(`AbortController`in n)return new AbortController().signal}(),this.referrer=null,(this.method===`GET`||this.method===`HEAD`)&&r)throw TypeError(`Body not allowed for GET or HEAD requests`);if(this._initBody(r),(this.method===`GET`||this.method===`HEAD`)&&(t.cache===`no-store`||t.cache===`no-cache`)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,`$1_=`+new Date().getTime()):this.url+=(/\?/.test(this.url)?`&`:`?`)+`_=`+new Date().getTime()}}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function x(e){var t=new FormData;return e.trim().split(`&`).forEach(function(e){if(e){var n=e.split(`=`),r=n.shift().replace(/\+/g,` `),i=n.join(`=`).replace(/\+/g,` `);t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function S(e){var t=new u;return e.replace(/\r?\n[\t ]+/g,` `).split(`\r`).map(function(e){return e.indexOf(`
|
|
19
|
+
`)===0?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(`:`),r=n.shift().trim();if(r){var i=n.join(`:`).trim();try{t.append(r,i)}catch(e){console.warn(`Response `+e.message)}}}),t}_.call(b.prototype);function C(e,t){if(!(this instanceof C))throw TypeError(`Please use the "new" operator, this DOM object constructor cannot be called as a function.`);if(t||={},this.type=`default`,this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw RangeError(`Failed to construct 'Response': The status provided (0) is outside the range [200, 599].`);this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?``:``+t.statusText,this.headers=new u(t.headers),this.url=t.url||``,this._initBody(e)}_.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},C.error=function(){var e=new C(null,{status:200,statusText:``});return e.ok=!1,e.status=0,e.type=`error`,e};var w=[301,302,303,307,308];C.redirect=function(e,t){if(w.indexOf(t)===-1)throw RangeError(`Invalid status code`);return new C(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(e,t){this.message=e,this.name=t,this.stack=Error(e).stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,i){return new Promise(function(a,o){var l=new b(e,i);if(l.signal&&l.signal.aborted)return o(new t.DOMException(`Aborted`,`AbortError`));var d=new XMLHttpRequest;function f(){d.abort()}d.onload=function(){var e={statusText:d.statusText,headers:S(d.getAllResponseHeaders()||``)};l.url.indexOf(`file://`)===0&&(d.status<200||d.status>599)?e.status=200:e.status=d.status,e.url=`responseURL`in d?d.responseURL:e.headers.get(`X-Request-URL`);var t=`response`in d?d.response:d.responseText;setTimeout(function(){a(new C(t,e))},0)},d.onerror=function(){setTimeout(function(){o(TypeError(`Network request failed`))},0)},d.ontimeout=function(){setTimeout(function(){o(TypeError(`Network request timed out`))},0)},d.onabort=function(){setTimeout(function(){o(new t.DOMException(`Aborted`,`AbortError`))},0)};function p(e){try{return e===``&&n.location.href?n.location.href:e}catch{return e}}if(d.open(l.method,p(l.url),!0),l.credentials===`include`?d.withCredentials=!0:l.credentials===`omit`&&(d.withCredentials=!1),`responseType`in d&&(r.blob?d.responseType=`blob`:r.arrayBuffer&&(d.responseType=`arraybuffer`)),i&&typeof i.headers==`object`&&!(i.headers instanceof u||n.Headers&&i.headers instanceof n.Headers)){var m=[];Object.getOwnPropertyNames(i.headers).forEach(function(e){m.push(s(e)),d.setRequestHeader(e,c(i.headers[e]))}),l.headers.forEach(function(e,t){m.indexOf(t)===-1&&d.setRequestHeader(t,e)})}else l.headers.forEach(function(e,t){d.setRequestHeader(t,e)});l.signal&&(l.signal.addEventListener(`abort`,f),d.onreadystatechange=function(){d.readyState===4&&l.signal.removeEventListener(`abort`,f)}),d.send(l._bodyInit===void 0?null:l._bodyInit)})}return T.polyfill=!0,n.fetch||(n.fetch=T,n.Headers=u,n.Request=b,n.Response=C),t.Headers=u,t.Request=b,t.Response=C,t.fetch=T,Object.defineProperty(t,`__esModule`,{value:!0}),t})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})),Lg=t(),Rg=e.o(Ig()),zg=Object.defineProperty,Bg=Object.defineProperties,Vg=Object.getOwnPropertyDescriptors,Hg=Object.getOwnPropertySymbols,Ug=Object.prototype.hasOwnProperty,Wg=Object.prototype.propertyIsEnumerable,Gg=(e,t,n)=>t in e?zg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kg=(e,t)=>{for(var n in t||={})Ug.call(t,n)&&Gg(e,n,t[n]);if(Hg)for(var n of Hg(t))Wg.call(t,n)&&Gg(e,n,t[n]);return e},qg=(e,t)=>Bg(e,Vg(t)),Jg={headers:{Accept:`application/json`,"Content-Type":`application/json`},method:`POST`},Yg=10,Xg=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Lg.EventEmitter,this.isAvailable=!1,this.registering=!1,!gg(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error(`Connection already closed`);this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=ho(e),n=await(await(0,Rg.default)(this.url,qg(Kg({},Jg),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!gg(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount(`register_error`)>=e||this.events.listenerCount(`open`)>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once(`register_error`,e=>{this.resetMaxListeners(),t(e)}),this.events.once(`open`,()=>{if(this.resetMaxListeners(),typeof this.isAvailable>`u`)return t(Error(`HTTP connection is missing or invalid`));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=ho({id:1,jsonrpc:`2.0`,method:`test`,params:[]});await(0,Rg.default)(e,qg(Kg({},Jg),{body:t}))}this.onOpen()}catch(e){let t=this.parseError(e);throw this.events.emit(`register_error`,t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit(`open`)}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit(`close`)}onPayload(e){if(typeof e.data>`u`)return;let t=typeof e.data==`string`?mo(e.data):e.data;this.events.emit(`payload`,t)}onError(e,t){let n=this.parseError(t),r=tg(e,n.message||n.toString());this.events.emit(`payload`,r)}parseError(e,t=this.url){return Wh(e,t,`HTTP`)}resetMaxListeners(){this.events.getMaxListeners()>Yg&&this.events.setMaxListeners(Yg)}};Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return mo}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return ep}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return ju}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return Lu}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return la}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return Hi}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return uo}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return Ja}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return Ru}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return ma}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return tp}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Vu}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return vm}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return bg}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return bm}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return tg}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return Qh}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return Zh}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return Em}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return jm}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Cg}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return ho}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return Iu}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return $h}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Fg}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return xg}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Dh}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Dg}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Sg}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Xg}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return eg}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return Sm}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return $f}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return ap}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return Tm}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return ke}});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(e._$cssResult$===!0)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:ee,getOwnPropertySymbols:te,getPrototypeOf:ne}=Object,f=globalThis,p=f.trustedTypes,re=p?p.emptyScript:``,ie=f.reactiveElementPolyfillSupport,m=(e,t)=>e,h={toAttribute(e,t){switch(t){case Boolean:e=e?re:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},g=(e,t)=>!l(e,t),_={attribute:!0,type:String,converter:h,reflect:!1,hasChanged:g};Symbol.metadata??(Symbol.metadata=Symbol(`metadata`)),f.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){let a=r?.call(this);i.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(m(`elementProperties`)))return;let e=ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(m(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m(`properties`))){let e=this.properties,t=[...ee(e),...te(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(e=>e(this))}addController(e){var t;(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(e=>e.hostConnected?.call(e))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(e=>e.hostDisconnected?.call(e))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){let i=(n.converter?.toAttribute===void 0?h:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?h:e.converter;this._$Em=r,this[r]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??g)(this[e],t))return;this.P(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e)n.wrapped!==!0||this._$AL.has(t)||this[t]===void 0||this.P(t,this[t],n)}let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$EO)==null||e.forEach(e=>e.hostUpdate?.call(e)),this.update(n)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(e=>e.hostUpdated?.call(e)),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(e){}firstUpdated(e){}},ae;v.elementStyles=[],v.shadowRootOptions={mode:`open`},v[m(`elementProperties`)]=new Map,v[m(`finalized`)]=new Map,ie?.({ReactiveElement:v}),((ae=f.reactiveElementVersions)??(f.reactiveElementVersions=[])).push(`2.0.4`);var y=globalThis,b=y.trustedTypes,x=b?b.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,S=`$lit$`,C=`lit$${Math.random().toFixed(9).slice(2)}$`,w=`?`+C,oe=`<${w}>`,T=document,E=()=>T.createComment(``),D=e=>e===null||typeof e!=`object`&&typeof e!=`function`,O=Array.isArray,k=e=>O(e)||typeof e?.[Symbol.iterator]==`function`,A=`[
|
|
2
|
+
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,N=/>/g,P=RegExp(`>|${A}(?:([^\\s"'>=/]+)(${A}*=${A}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,`g`),F=/'/g,I=/"/g,L=/^(?:script|style|textarea|title)$/i,R=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),se=R(1),z=R(2),B=Symbol.for(`lit-noChange`),V=Symbol.for(`lit-nothing`),H=new WeakMap,U=T.createTreeWalker(T,129);function W(e,t){if(!Array.isArray(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return x===void 0?t:x.createHTML(t)}var G=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:``,o=j;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===j?c[1]===`!--`?o=M:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=P):(L.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=P):o=N:o===P?c[0]===`>`?(o=i??j,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?P:c[3]===`"`?I:F):o===I||o===F?o=P:o===M||o===N?o=j:(o=P,i=void 0);let d=o===P&&e[t+1].startsWith(`/>`)?` `:``;a+=o===j?n+oe:l>=0?(r.push(s),n.slice(0,l)+S+n.slice(l)+C+d):n+C+(l===-2?t:d)}return[W(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:``)),r]},K=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=G(t,n);if(this.el=e.createElement(l,r),U.currentNode=this.el.content,n===2){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=U.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(S)){let t=u[o++],n=i.getAttribute(e).split(C),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?le:r[1]===`?`?ue:r[1]===`@`?de:Y}),i.removeAttribute(e)}else e.startsWith(C)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(L.test(i.tagName)){let e=i.textContent.split(C),t=e.length-1;if(t>0){i.textContent=b?b.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],E()),U.nextNode(),c.push({type:2,index:++a});i.append(e[t],E())}}}else if(i.nodeType===8)if(i.data===w)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(C,e+1))!==-1;)c.push({type:7,index:a}),e+=C.length-1}a++}}static createElement(e,t){let n=T.createElement(`template`);return n.innerHTML=e,n}};function q(e,t,n=e,r){var i;if(t===B)return t;let a=r===void 0?n._$Cl:n._$Co?.[r],o=D(t)?void 0:t._$litDirective$;return a?.constructor!==o&&((i=a?._$AO)==null||i.call(a,!1),o===void 0?a=void 0:(a=new o(e),a._$AT(e,n,r)),r===void 0?n._$Cl=a:(n._$Co??=[])[r]=a),a!==void 0&&(t=q(e,a._$AS(e,t.values),a,r)),t}var ce=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??T).importNode(t,!0);U.currentNode=r;let i=U.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new J(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new fe(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=U.nextNode(),a++)}return U.currentNode=T,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},J=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=q(this,e,t),D(e)?e===V||e==null||e===``?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==B&&this._(e):e._$litType$===void 0?e.nodeType===void 0?k(e)?this.k(e):this._(e):this.T(e):this.$(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==V&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=K.createElement(W(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new ce(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=H.get(e.strings);return t===void 0&&H.set(e.strings,t=new K(e)),t}k(t){O(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.S(E()),this.S(E()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null||n.call(this,!1,!0,t);e&&e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Y=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=V}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=q(this,e,t,0),a=!D(e)||e!==this._$AH&&e!==B,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=q(this,r[n+o],t,o),s===B&&(s=this._$AH[o]),a||=!D(s)||s!==this._$AH[o],s===V?e=V:e!==V&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},le=class extends Y{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}},ue=class extends Y{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}},de=class extends Y{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=q(this,e,t,0)??V)===B)return;let n=this._$AH,r=e===V&&n!==V||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==V&&(n===V||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},fe=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){q(this,e)}},pe=y.litHtmlPolyfillSupport,me;pe?.(K,J),((me=y.litHtmlVersions)??(y.litHtmlVersions=[])).push(`3.1.4`);var he=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new J(t.insertBefore(E(),e),e,void 0,n??{})}return i._$AI(e),i},X=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=he(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return B}},Z;X._$litElement$=!0,X.finalized=!0,(Z=globalThis.litElementHydrateSupport)==null||Z.call(globalThis,{LitElement:X});var ge=globalThis.litElementPolyfillSupport;ge?.({LitElement:X});var _e;((_e=globalThis.litElementVersions)??(globalThis.litElementVersions=[])).push(`4.0.6`);var ve=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},ye=Object.defineProperty,be=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,$=(e,t,n)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,we=(e,t)=>{for(var n in t||={})Se.call(t,n)&&$(e,n,t[n]);if(Q)for(var n of Q(t))Ce.call(t,n)&&$(e,n,t[n]);return e},Te=(e,t)=>be(e,xe(t)),Ee={attribute:!0,type:String,converter:h,reflect:!1,hasChanged:g},De=(e=Ee,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return t!==void 0&&this.P(r,void 0,e),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error(`Unsupported decorator location: `+r)};function Oe(e){return(t,n)=>typeof n==`object`?De(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?Te(we({},e),{wrapped:!0}):e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Oe}});
|